summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorshapow2015-11-18 16:58:17 -0500
committershapow2015-11-18 16:58:17 -0500
commitd0ab0414c7d47aa16cd889973a591ef5c24a1a41 (patch)
tree5b0fe093483f56f9d147375d511e3bf2899f63ca
parent744e54171f2856bc336856f22401bc0cf3a2d03c (diff)
downloadaur-d0ab0414c7d47aa16cd889973a591ef5c24a1a41.tar.gz
updated PKGBUILD, added launch script, added application launcher, added icon
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD43
-rw-r--r--tor-messenger-bin.desktop34
-rw-r--r--tor-messenger-bin.pngbin0 -> 18697 bytes
-rwxr-xr-xtor-messenger-bin.sh112
5 files changed, 183 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 16ef1a4d05b4..9a6d4ad2d418 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -6,6 +6,12 @@ pkgbase = tor-messenger-bin
arch = i686
arch = x86_64
license = MIT
+ source = tor-messenger-bin.desktop
+ source = tor-messenger-bin.png
+ source = tor-messenger-bin.sh
+ sha512sums = 6d88533128f288acc4164381ffdd3402a08cddad127722f610b380fb31eb8a850509d1714269fdffb25e897053297e60185ac7b7bfc752a59805454852e63a11
+ sha512sums = 6007a2fc63d33ceaee78c40e196d339bc9c40e73b45934416878f4dc4be6dbe7dbe364d1cdd6a811d0c0a5bd70c463300e3df4e40e8369a20e3d6a8a04059042
+ sha512sums = 1a0206afe8e3a61fb11e255851f770bdb8a44e06db5a2edb69f50ac3daf4ebb5b985005e7db46a6c419a6cb7f14d07a70f6c248ce62cb783df1b6caf18c7abea
source_i686 = https://dist.torproject.org/tormessenger/0.1.0b3/tor-messenger-linux32-0.1.0b3_en-US.tar.xz
sha512sums_i686 = f901dc8b8754d1adf5352d4f70aee5d9fa5c971393db750b29a18311fbda6cc5a0d2ad73a3f2891dd410e91c0c081753e9bec54955e872ed4e272604d4b43673
source_x86_64 = https://dist.torproject.org/tormessenger/0.1.0b3/tor-messenger-linux64-0.1.0b3_en-US.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
index 3e7f3080f1eb..88ec846b2499 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,48 @@
-# Submitter: Jonas Heinrich <onny@project-insanity.org>
-# Maintainer: Jonas Heinrich <onny@project-insanity.org>
-
-# missing ico and license file
+# Maintainer: shapow <echo c2hhcG93QDRyYXkuY28K | base64 -d>
+# Contributor: Jonas Heinrich <onny at project-insanity dot org>
pkgname=tor-messenger-bin
pkgver=0.1.0b3
+_language='en-US'
pkgrel=1
pkgdesc="A cross-platform chat program that aims to be secure by default and sends all of its traffic over Tor"
arch=('i686' 'x86_64')
url="https://www.torproject.org/"
license=('MIT')
+
source_i686=("https://dist.torproject.org/tormessenger/0.1.0b3/tor-messenger-linux32-0.1.0b3_en-US.tar.xz")
source_x86_64=("https://dist.torproject.org/tormessenger/0.1.0b3/tor-messenger-linux64-0.1.0b3_en-US.tar.xz")
+source+=("${pkgname}.desktop"
+ "${pkgname}.png"
+ "${pkgname}.sh")
+
sha512sums_i686=('f901dc8b8754d1adf5352d4f70aee5d9fa5c971393db750b29a18311fbda6cc5a0d2ad73a3f2891dd410e91c0c081753e9bec54955e872ed4e272604d4b43673')
sha512sums_x86_64=('3084b55db0219336dccd9a5e48460acd0aa4b29cdbe4bfe16d238b5fd70866cdcc5849ef9952b6bd86a0f3d58a383442e5835dac1f14b6b93a5645a9b3feaa82')
+sha512sums+=('6d88533128f288acc4164381ffdd3402a08cddad127722f610b380fb31eb8a850509d1714269fdffb25e897053297e60185ac7b7bfc752a59805454852e63a11'
+ '6007a2fc63d33ceaee78c40e196d339bc9c40e73b45934416878f4dc4be6dbe7dbe364d1cdd6a811d0c0a5bd70c463300e3df4e40e8369a20e3d6a8a04059042'
+ '1a0206afe8e3a61fb11e255851f770bdb8a44e06db5a2edb69f50ac3daf4ebb5b985005e7db46a6c419a6cb7f14d07a70f6c248ce62cb783df1b6caf18c7abea')
-prepare() {
- sed -ie 's|"\$(dirname "\$\*")"/Messenger|/opt/tor-messenger|g' "${srcdir}/tor-messenger/start-tor-messenger.desktop"
- sed -ie 's|Messenger/start-tor-messenger|tor-messenger/start-tor-messenger|g' "${srcdir}/tor-messenger/start-tor-messenger.desktop"
-}
+noextract_i686=("tor-messenger-linux32-0.1.0b3_en-US.tar.xz")
+noextract_x86_64=("tor-messenger-linux64-0.1.0b3_en-US.tar.xz")
package() {
- cd ${srcdir}
- install -vd $pkgdir/opt/tor-messenger
- cp -ar "${srcdir}/tor-messenger/Messenger" "${pkgdir}/opt/tor-messenger"
+ cd "${srcdir}"
+
+ sed -i "s/REPL_NAME/${pkgname}/g" ${pkgname}.sh
+ sed -i "s/REPL_VERSION/${pkgver}/g" ${pkgname}.sh
+ sed -i "s/REPL_LANGUAGE/${_language}/g" ${pkgname}.sh
+
+ sed -i "s/REPL_NAME/${pkgname}/g" ${pkgname}.desktop
+ sed -i "s/REPL_COMMENT/${pkgdesc}/g" ${pkgname}.desktop
+ sed -i "s/REPL_LANGUAGE/${_language}/g" ${pkgname}.desktop
+
+ install -Dm 644 ${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop
+ install -Dm 644 ${pkgname}.png ${pkgdir}/usr/share/pixmaps/${pkgname}.png
+ install -Dm 755 ${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}
- install -Dm644 "${srcdir}/tor-messenger/start-tor-messenger.desktop" "${pkgdir}/usr/share/applications/start-tor-messenger.desktop"
+ if [[ "$CARCH" == 'i686' ]]; then
+ install -Dm 644 tor-messenger-linux32-${pkgver}_${_language}.tar.xz ${pkgdir}/opt/${pkgname}/tor-messenger-linux32-${pkgver}_${_language}.tar.xz
+ else
+ install -Dm 644 tor-messenger-linux64-${pkgver}_${_language}.tar.xz ${pkgdir}/opt/${pkgname}/tor-messenger-linux64-${pkgver}_${_language}.tar.xz
+ fi
}
diff --git a/tor-messenger-bin.desktop b/tor-messenger-bin.desktop
new file mode 100644
index 000000000000..40b3192e6b63
--- /dev/null
+++ b/tor-messenger-bin.desktop
@@ -0,0 +1,34 @@
+#!/usr/bin/env ./Messenger/execdesktop
+#
+# This file is a self-modifying .desktop file that can be run from the shell.
+# It preserves arguments and environment for the start-tor-messenger script.
+#
+# Run './start-tor-messenger.desktop --help' to display the full set of
+# options.
+#
+# When invoked from the shell, this file must always be in a Tor Messenger
+# root directory. When run from the file manager or desktop GUI, it is
+# relocatable.
+#
+# After first invocation, it will update itself with the absolute path to the
+# current TBB location, to support relocation of this .desktop file for GUI
+# invocation. You can also add Tor Messenger to your desktop's application
+# menu by running './start-tor-messenger.desktop --register-app'
+#
+# If you use --register-app, and then relocate your TBB directory, Tor
+# Messenger will no longer launch from your desktop's app launcher/dock.
+# However, if you re-run --register-app from inside that new directory, the
+# script will correct the absolute paths and re-register itself.
+#
+# This file will also still function if the path changes when TBB is used as a
+# portable app, so long as it is run directly from that new directory, either
+# via the shell or via the file manager.
+
+[Desktop Entry]
+Type=Application
+Name=Tor Messenger
+GenericName=Instant Messenger
+Comment=Tor Messenger is +1 for privacy and -1 for mass surveillance
+Categories=Network;Chat;Security;
+Exec=/usr/bin/tor-messenger-bin
+Icon=/usr/share/pixmaps/REPL_NAME.png
diff --git a/tor-messenger-bin.png b/tor-messenger-bin.png
new file mode 100644
index 000000000000..b0190f8d338c
--- /dev/null
+++ b/tor-messenger-bin.png
Binary files differ
diff --git a/tor-messenger-bin.sh b/tor-messenger-bin.sh
new file mode 100755
index 000000000000..829104fc6639
--- /dev/null
+++ b/tor-messenger-bin.sh
@@ -0,0 +1,112 @@
+#!/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 2015 for tor-messenger (shapow <echo c2hhcG93QDRyYXkuY28K \
+# | base64 -d>)
+#
+# 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 PKGBUILD
+NAME='tor-messenger-bin'
+VERSION='0.1.0b3'
+LANGUAGE="en-US"
+
+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-messenger-linux${ARCH}-${VERSION}_${LANGUAGE}.tar.xz \
+ -C $INSTALL_DIRECTORY >> $LOG_FILE 2>&1 || notify "Error" \
+ "The tor-messenger 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/Messenger/start-tor-messenger ]] && 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-Messenger directory to use
+
+ All unrecognized arguments will be passed to the messenger,
+ 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-messenger 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-messenger
+cd $INSTALL_DIRECTORY/Messenger && ./start-tor-messenger --class Tor\ Messenger "${args[@]}"