Skip to content

Instantly share code, notes, and snippets.

@Narrat
Created April 10, 2017 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Narrat/0fc7efa2db50309201640c8261551eed to your computer and use it in GitHub Desktop.
Save Narrat/0fc7efa2db50309201640c8261551eed to your computer and use it in GitHub Desktop.
language agnostic tor-browser PKGBUILD
commit fae8d71d4e3584a4f0b143761a41ef977534ac3f
Author: Narrat <autumn-wind@web.de>
Date: Tue Apr 11 00:38:32 2017 +0200
Enable build of 32bit version
For source verification download the .asc file and specify the signing key.
Additionally: Not needed to include the .install file in the source array. There is already the install= var
diff --git a/.SRCINFO b/.SRCINFO
index d148658..8fe2c0b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -4,6 +4,7 @@ pkgbase = tor-browser
pkgrel = 1
url = https://www.torproject.org/projects/torbrowser.html.en
install = tor-browser.install
+ arch = i686
arch = x86_64
license = GPL
depends = gtk2
@@ -27,17 +28,21 @@ pkgbase = tor-browser
optdepends = gst-libav: h.264 video
optdepends = libpulse: PulseAudio audio driver
optdepends = libnotify: Gnome dialog boxes
- noextract = tor-browser-linux64-6.5.1_it.tar.xz
- source = https://dist.torproject.org/torbrowser/6.5.1/tor-browser-linux64-6.5.1_it.tar.xz
source = tor-browser.desktop
- source = tor-browser.install
source = tor-browser.png
source = tor-browser.sh
- md5sums = SKIP
+ validpgpkeys = EF6E286DDA85EA2A4BA7DE684E2C6E8793298290
md5sums = f0cfc7681d58a77251abc49b250802d3
- md5sums = 2bf2f92d3aef0e39a3a6d6ec0701d19c
md5sums = 494afbfa60fb4ce21840244cc3f7208c
md5sums = 3ef08aff0e2afebb1a2a7ffbf8f65897
+ source_i686 = https://dist.torproject.org/torbrowser/6.5.1/tor-browser-linux32-6.5.1_de.tar.xz
+ source_i686 = https://dist.torproject.org/torbrowser/6.5.1/tor-browser-linux32-6.5.1_de.tar.xz.asc
+ md5sums_i686 = SKIP
+ md5sums_i686 = SKIP
+ source_x86_64 = https://dist.torproject.org/torbrowser/6.5.1/tor-browser-linux64-6.5.1_de.tar.xz
+ source_x86_64 = https://dist.torproject.org/torbrowser/6.5.1/tor-browser-linux64-6.5.1_de.tar.xz.asc
+ md5sums_x86_64 = SKIP
+ md5sums_x86_64 = SKIP
pkgname = tor-browser
diff --git a/PKGBUILD b/PKGBUILD
index 3a4b52a..1ab2732 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ pkgver='6.5.1'
pkgrel=1
pkgdesc='Tor Browser Bundle: Anonymous browsing using firefox and tor (language-agnostic PKGBUILD)'
url='https://www.torproject.org/projects/torbrowser.html.en'
-arch=('x86_64')
+arch=('i686' 'x86_64')
license=('GPL')
depends=('gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
'dbus-glib' 'alsa-lib' 'desktop-file-utils' 'hicolor-icon-theme'
@@ -21,16 +21,19 @@ optdepends=('zenity: simple dialog boxes'
'libnotify: Gnome dialog boxes')
install="${pkgname}.install"
-_urlbase="https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-linux64-${pkgver}"
+validpgpkeys=('EF6E286DDA85EA2A4BA7DE684E2C6E8793298290')
+
+_urlbase32="https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-linux32-${pkgver}"
+_urlbase64="https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-linux64-${pkgver}"
_localetor() {
local _fulllocale="$(locale | grep LANG | cut -d= -f2 | cut -d. -f1 | sed s/_/\-/)"
local _shortlocale="$(locale | grep LANG | cut -d= -f2 | cut -d_ -f1)"
- if curl --output /dev/null --silent --head --fail "${_urlbase}_${_fulllocale}.tar.xz"; then
+ if curl --output /dev/null --silent --head --fail "${_urlbase64}_${_fulllocale}.tar.xz"; then
echo -n "${_fulllocale}"
- elif curl --output /dev/null --silent --head --fail "${_urlbase}_${_shortlocale}.tar.xz"; then
+ elif curl --output /dev/null --silent --head --fail "${_urlbase64}_${_shortlocale}.tar.xz"; then
echo -n "${_shortlocale}"
else
echo 'en-US'
@@ -40,19 +43,21 @@ _localetor() {
_language=$(_localetor)
-source=("${_urlbase}_${_language}.tar.xz"
- "${pkgname}.desktop"
- "${pkgname}.install"
+source_i686=("${_urlbase32}_${_language}.tar.xz"{,.asc})
+source_x86_64=("${_urlbase64}_${_language}.tar.xz"{,.asc})
+source=("${pkgname}.desktop"
"${pkgname}.png"
"${pkgname}.sh")
-
-md5sums=('SKIP'
- 'f0cfc7681d58a77251abc49b250802d3'
- '2bf2f92d3aef0e39a3a6d6ec0701d19c'
+md5sums_i686=('SKIP'
+ 'SKIP')
+md5sums_x86_64=('SKIP'
+ 'SKIP')
+md5sums=('f0cfc7681d58a77251abc49b250802d3'
'494afbfa60fb4ce21840244cc3f7208c'
'3ef08aff0e2afebb1a2a7ffbf8f65897')
-noextract=("tor-browser-linux64-${pkgver}_${_language}.tar.xz")
+noextract_x86_64=("tor-browser-linux64-${pkgver}_${_language}.tar.xz")
+noextract_i686=("tor-browser-linux32-${pkgver}_${_language}.tar.xz")
package() {
@@ -70,6 +75,10 @@ package() {
install -Dm 644 ${pkgname}.png ${pkgdir}/usr/share/pixmaps/${pkgname}.png
install -Dm 755 ${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}
- install -Dm 644 tor-browser-linux64-${pkgver}_${_language}.tar.xz ${pkgdir}/opt/${pkgname}/tor-browser-linux64-${pkgver}_${_language}.tar.xz
+ if [[ "$CARCH" == 'i686' ]]; then
+ install -Dm 644 tor-browser-linux32-${pkgver}_${_language}.tar.xz ${pkgdir}/opt/${pkgname}/tor-browser-linux32-${pkgver}_${_language}.tar.xz
+ else
+ install -Dm 644 tor-browser-linux64-${pkgver}_${_language}.tar.xz ${pkgdir}/opt/${pkgname}/tor-browser-linux64-${pkgver}_${_language}.tar.xz
+ fi
}
commit c8f5f52d2a8d2d230de0529261ae78894fd8a66b
Author: Narrat <autumn-wind@web.de>
Date: Tue Apr 11 00:45:34 2017 +0200
Reduce the install file
The pre_install message is completly useless, using the official supported way to build this package.
pre_upgrade should be unnecessary too, as the file is tracked by pacman an an upgrade should remove it.
Toned the messages down, as a wall of text is not helping and more or less discouraged.
diff --git a/tor-browser.install b/tor-browser.install
index 427d086..b473956 100644
--- a/tor-browser.install
+++ b/tor-browser.install
@@ -1,43 +1,16 @@
pkgname="tor-browser"
-pre_install() {
- echo
- echo "==> If you want to verify the gnupg signature you have to"
- echo "==> import the proper public key first (Found on https://www.torproject.org/docs/signing-keys.html.en)."
- echo "==> Choose one and use the following command to import it:"
- echo "==> "
- echo "==> gpg --recv-keys <keyid>"
- echo "==> "
- echo "==> After that, signature verifying should work."
- echo
-}
-
post_install() {
- echo
echo "==> ${pkgname} will be extracted to ~/.$pkgname"
echo "==> the first time you run $pkgname as your normal user!"
- echo "==> Just start it and have fun."
- echo
-}
-
-pre_upgrade() {
- # remove old files
- rm -rf /opt/$pkgname
}
post_upgrade() {
- echo
- echo "==> The $pkgname copy in your home directory will be upgraded at the"
- echo "==> first time you run it as your normal user!"
- echo "==> Just start and have fun."
- echo
+ echo "==> The $pkgname copy in your home directory will be upgraded the"
+ echo "==> next time you run it as your normal user!"
}
post_remove() {
- echo
echo "==> You have to remove the tor-brower directory in your home"
- echo "==> directory by hand: As your normal user, do:"
- echo "==> "
- echo "==> rm -rf ~/.${pkgname}"
- echo
+ echo "==> directory by hand (location: ~/.${pkgname})"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment