diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-11-13 22:50:26 -0600 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-11-15 08:30:38 +0700 |
commit | d451a16241d3dfcc8230e1b2e421c31aaf3d06df (patch) | |
tree | e1b8d4d287c0f380ee063ed7aef6c4480415a1ea /network | |
parent | 22174076591e196810501befcb082e07d3b76c3f (diff) |
network/tor-browser: Added (tor-based browser)
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r-- | network/tor-browser/README | 9 | ||||
-rw-r--r-- | network/tor-browser/doinst.sh | 7 | ||||
-rw-r--r-- | network/tor-browser/slack-desc | 19 | ||||
-rw-r--r-- | network/tor-browser/tor-browser.SlackBuild | 105 | ||||
-rw-r--r-- | network/tor-browser/tor-browser.desktop | 9 | ||||
-rw-r--r-- | network/tor-browser/tor-browser.info | 10 | ||||
-rw-r--r-- | network/tor-browser/tor-browser.sh | 111 |
7 files changed, 270 insertions, 0 deletions
diff --git a/network/tor-browser/README b/network/tor-browser/README new file mode 100644 index 000000000000..cf58ac7003c2 --- /dev/null +++ b/network/tor-browser/README @@ -0,0 +1,9 @@ +The Tor Browser lets you use Tor on Windows, Mac OS X, or Linux +without needing to install any software. +It can run off a USB flash drive, comes with a pre-configured web +browser to protect your anonymity, and is self-contained. + +By default, this package will build en-US version. +If you want to build other language, eg. France, download the +appropriate source and run : +PRGLANG=fr ./tor-browser.SlackBuild diff --git a/network/tor-browser/doinst.sh b/network/tor-browser/doinst.sh new file mode 100644 index 000000000000..9a8ded3c6034 --- /dev/null +++ b/network/tor-browser/doinst.sh @@ -0,0 +1,7 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi diff --git a/network/tor-browser/slack-desc b/network/tor-browser/slack-desc new file mode 100644 index 000000000000..358ca972abad --- /dev/null +++ b/network/tor-browser/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +tor-browser: tor-browser (tor-based browser) +tor-browser: +tor-browser: The Tor Browser lets you use Tor on Windows, Mac OS X, or Linux +tor-browser: without needing to install any software. +tor-browser: It can run off a USB flash drive, comes with a pre-configured web +tor-browser: browser to protect your anonymity, and is self-contained. +tor-browser: +tor-browser: +tor-browser: Project URL: https://www.torproject.org/projects/torbrowser.html.en +tor-browser: +tor-browser: diff --git a/network/tor-browser/tor-browser.SlackBuild b/network/tor-browser/tor-browser.SlackBuild new file mode 100644 index 000000000000..30b232b5bb99 --- /dev/null +++ b/network/tor-browser/tor-browser.SlackBuild @@ -0,0 +1,105 @@ +#!/bin/sh + +# Slackware build script for tor-browser + +# Copyright 2014 Willy Sudiarto Raharjo <willysr@slackbuilds.org> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=tor-browser +VERSION=${VERSION:-4.0.1} +PRGLANG=${PRGLANG:-en-US} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" + SRCARCH=32 +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" + SRCARCH=32 +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + SRCARCH=64 +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + SRCARCH=32 +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf ${PRGNAM}_${PRGLANG} +tar xvf $CWD/${PRGNAM}-linux${SRCARCH}-${VERSION}_${PRGLANG}.tar.xz +cd ${PRGNAM}_${PRGLANG} +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p $PKG/opt/ +mv * $PKG/opt/ + +mkdir -p $PKG/usr/bin +install -m 0755 $CWD/tor-browser.sh $PKG/usr/bin/tor-browser + +sed -i "s/REPL_NAME/$PRGNAM/g" $PKG/usr/bin/tor-browser +sed -i "s/REPL_VERSION/$VERSION/g" $PKG/usr/bin/tor-browser +sed -i "s/REPL_LANGUAGE/${PRGLANG}/g" $PKG/usr/bin/tor-browser + +# We have to copy the original source into the package +mkdir -p $PKG/opt/$PRGNAM +install -m 0644 $CWD/${PRGNAM}-linux${SRCARCH}-${VERSION}_${PRGLANG}.tar.xz $PKG/opt/$PRGNAM + +mkdir -p $PKG/usr/share/pixmaps +install -m 0644 $PKG/opt/Browser/browser/icons/mozicon128.png $PKG/usr/share/pixmaps/tor-browser.png + +mkdir -p $PKG/usr/share/applications/ +install -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/ + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/tor-browser/tor-browser.desktop b/network/tor-browser/tor-browser.desktop new file mode 100644 index 000000000000..7f60af0d38f4 --- /dev/null +++ b/network/tor-browser/tor-browser.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Exec=tor-browser %u +Icon=tor-browser +Type=Application +Categories=Network; +Name=Tor-Browser +GenericName=Anonymous Web Browser +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +X-KDE-StartupNotify=true diff --git a/network/tor-browser/tor-browser.info b/network/tor-browser/tor-browser.info new file mode 100644 index 000000000000..fa8fa74c5a78 --- /dev/null +++ b/network/tor-browser/tor-browser.info @@ -0,0 +1,10 @@ +PRGNAM="tor-browser" +VERSION="4.0.1" +HOMEPAGE="https://www.torproject.org" +DOWNLOAD="https://www.torproject.org/dist/torbrowser/4.0.1/tor-browser-linux32-4.0.1_en-US.tar.xz" +MD5SUM="da23464bf241ca6852b4749b5ac55087" +DOWNLOAD_x86_64="https://www.torproject.org/dist/torbrowser/4.0.1/tor-browser-linux64-4.0.1_en-US.tar.xz" +MD5SUM_x86_64="a53e3d5a18b6be4adf9374a21c97048e" +REQUIRES="" +MAINTAINER="Willy Sudiarto Raharjo" +EMAIL="willysr@slackbuilds.org" diff --git a/network/tor-browser/tor-browser.sh b/network/tor-browser/tor-browser.sh new file mode 100644 index 000000000000..983a968691d3 --- /dev/null +++ b/network/tor-browser/tor-browser.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2009 Benjamin Drung <bdrung at ubuntu dot com> +# Copyright (C) 2012 Alessio Sergi <al3hex at gmail dot com> +# modified 2012 for tor-browser (Max Roder <maxroder at web dot de>) +# modified 2014 by Yardena Cohen <yardenack at gmail dot com> +# modified 2014 by Willy Sudiarto Raharjo <willysr@slackbuilds.org> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set -e + +# filled by the SLACKBUILD +NAME='REPL_NAME' +VERSION='REPL_VERSION' +LANGUAGE="REPL_LANGUAGE" + +ARCH=$(getconf LONG_BIT) + +notify() { + local title="$1" + local message="$2" + + if [ $(which zenity 2>/dev/null) ]; then + zenity --info --title "$title" --text "$message" + elif [ $(which notify-send 2>/dev/null) ]; then + notify-send "$title" "$message" + elif [ $(which kdialog 2>/dev/null) ]; then + kdialog --title "$title" --passivepopup "$message" + else + echo -e "$0: [$title] $message" >&2 + fi +} + +update() { + echo "$0: Extracting files to $INSTALL_DIRECTORY." >> $LOG_FILE + rm -rf $INSTALL_DIRECTORY/* + tar --strip-components=1 -xJf /opt/$NAME/tor-browser-linux${ARCH}-${VERSION}_${LANGUAGE}.tar.xz \ + -C $INSTALL_DIRECTORY >> $LOG_FILE 2>&1 || notify "Error" \ + "The tor-browser archive could not be extracted to your home directory. \ + \nCheck permissions of $INSTALL_DIRECTORY. \ + \nThe error log can be found in $LOG_FILE." + + [[ -f $INSTALL_DIRECTORY/start-tor-browser ]] && echo $VERSION > $VERSION_FILE +} + +usage() { + cat <<EOF +Usage: ${0##*/} [option] + +Options: + -h|--help Show this help message and exit + -u|--update Force update of the copy in your home directory + --dir=<directory> The Tor-Browser directory to use + + All unrecognized arguments will be passed to the browser, + but arguments with spaces will break, until Tor fixes this bug: + https://trac.torproject.org/projects/tor/ticket/12161 +EOF +} + +DIRECTORY=~/.$NAME +args=() +for arg; do + case "$arg" in + -h|--help) usage; exit 0 ;; + -u|--update) update=1 ;; + --dir=*) DIRECTORY="${arg#*=}" ;; + *) args+=("$arg") ;; + esac +done + +INSTALL_DIRECTORY=$DIRECTORY/INSTALL +VERSION_FILE=$DIRECTORY/VERSION +LOG_FILE=$DIRECTORY/LOG + +# create directory, if it is missing (e.g. first run) +[[ ! -d "$INSTALL_DIRECTORY" ]] && mkdir -p "$INSTALL_DIRECTORY" +cd "$DIRECTORY" + +# create version file if missing +[[ ! -f $VERSION_FILE ]] && echo 0 > $VERSION_FILE + +#get installed version +while read line +do + INSTALLED_VERSION=$line +done < $VERSION_FILE + +# start update if old or no tor-browser is installed +if [[ "$INSTALLED_VERSION" == "$VERSION" ]] && [[ $update != 1 ]]; then + # clear log + > $LOG_FILE +else + echo "$0: Your version in $DIRECTORY is outdated or you do not have installed $NAME yet." > $LOG_FILE + update +fi + +# start tor-browser +cd $INSTALL_DIRECTORY && ./start-tor-browser --class Tor\ Browser "${args[@]}" |