diff options
author | grufo | 2019-09-04 06:00:55 +0100 |
---|---|---|
committer | grufo | 2019-09-04 06:00:55 +0100 |
commit | 470a4e475bf1a2a721eda771eb7cab535ff73ed1 (patch) | |
tree | 248cf3ac2db53622aeecceda4b0e8232219b239a | |
parent | 9c99e394cf327d9b338d9b90772323c0c6104b26 (diff) | |
download | aur-470a4e475bf1a2a721eda771eb7cab535ff73ed1.tar.gz |
PKGBUILD: merged BrLi's contribution
-rw-r--r-- | PKGBUILD | 36 |
1 files changed, 23 insertions, 13 deletions
@@ -4,6 +4,7 @@ # Contributor: Yardena Cohen <yardenack AT gmail DOT com> # Contributor: Max Roder <maxroder AT web DOT de> # Contributor: Sebastian Jug <seb AT stianj DOT ug> +# Contributor: BrLi # # Before running makepkg, you must do this (as normal user): @@ -20,8 +21,6 @@ pkgrel='1' pkgdesc='Tor Browser Bundle: anonymous browsing using Firefox and Tor (international PKGBUILD)' url='https://www.torproject.org/projects/torbrowser.html' arch=('i686' 'x86_64') -_idstr32='linux32' -_idstr64='linux64' license=('GPL') depends=('mozilla-common' 'libxt' 'startup-notification' 'mime-types' 'dbus-glib' 'alsa-lib' 'desktop-file-utils' 'hicolor-icon-theme' @@ -34,6 +33,9 @@ optdepends=('zenity: simple dialog boxes' 'libnotify: Gnome dialog boxes') install="${pkgname}.install" +_idstr32='linux32' +_idstr64='linux64' +_urlbase="https://dist.torproject.org/torbrowser/${pkgver}" _archstr=$([[ "${CARCH}" == 'x86_64' ]] && echo -n "${_idstr64}" || echo -n "${_idstr32}") _localetor() { @@ -50,13 +52,12 @@ _localetor() { return 0 fi - local _urlbase="https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-${_archstr}-${pkgver}" 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 "${_urlbase}/${pkgname}-${_archstr}-${pkgver}_${_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 "${_urlbase}/${pkgname}-${_archstr}-${pkgver}_${_shortlocale}.tar.xz"; then echo -n "${_shortlocale}" else echo -n 'en-US' @@ -64,26 +65,35 @@ _localetor() { } +_language="$(_localetor)" + validpgpkeys=('EF6E286DDA85EA2A4BA7DE684E2C6E8793298290') -_language="$(_localetor)" +# Syntax: _dist_checksum 'linux32'/'linux64' +_dist_checksum() { + + curl "${_urlbase}/sha256sums-signed-build.txt" | grep "${1}-${pkgver}_${_language}.tar.xz" | cut -d ' ' -f1 + +} -source_i686=("https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-${_idstr32}-${pkgver}_${_language}.tar.xz"{,.asc}) -source_x86_64=("https://dist.torproject.org/torbrowser/${pkgver}/${pkgname}-${_idstr64}-${pkgver}_${_language}.tar.xz"{,.asc}) +source_i686=("${_urlbase}/${pkgname}-${_idstr32}-${pkgver}_${_language}.tar.xz"{,.asc}) +source_x86_64=("${_urlbase}/${pkgname}-${_idstr64}-${pkgver}_${_language}.tar.xz"{,.asc}) source=("${pkgname}.desktop" "${pkgname}.png" "${pkgname}.sh") +# No need for `makepkg -g`: the following sha256sums¸don't need to be updated +# with each release, everything is done automatically! Leave them like this! sha256sums=('9ee0a4672e2d0835ffb94bcf26e17b56432030496a9cdf019b70c96083c24340' 'bb6b0f27c33d21e0ef6df961e25418327c5e8b01c003bbe18c0a8dae3e16d77d' '3a491ad1a476f2fb343f274eab4e8df925637438e6dac3591f092b3ef3294da3') -sha256sums_i686=('49b84482a6c27971aa9b2421a5e2967c3382b4566610ab8a25d9bd1767e1bbdb' +sha256sums_i686=($(_dist_checksum "${_idstr32}") 'SKIP') -sha256sums_x86_64=('5f334f14161952476adde3fbd843f93f647d47a0d7e30eb5d1635fb7569a2503' +sha256sums_x86_64=($(_dist_checksum "${_idstr64}") 'SKIP') noextract=("${pkgname}-${_idstr64}-${pkgver}_${_language}.tar.xz" - "${pkgname}-${_idstr32}-${pkgver}_${_language}.tar.xz") + "${pkgname}-${_idstr32}-${pkgver}_${_language}.tar.xz") prepare() { @@ -122,8 +132,8 @@ package() { sed -i "s/__REPL_LANGUAGE__/${_language}/g" "${pkgname}.desktop" sed -i "s/__REPL_NAME__/${pkgname}/g" "${pkgname}.sh" - sed -i "s/__REPL_VERSION__/${pkgver}/g" "${pkgname}.sh" - sed -i "s/__REPL_RELEASE__/${pkgrel}/g" "${pkgname}.sh" + sed -i "s/__REPL_VERSION__/${pkgver}/g" "${pkgname}.sh" + sed -i "s/__REPL_RELEASE__/${pkgrel}/g" "${pkgname}.sh" sed -i "s/__REPL_LANGUAGE__/${_language}/g" "${pkgname}.sh" sed -i "s/__REPL_ARCH__/${_archstr}/g" "${pkgname}.sh" |