summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9614e1ae2c6469cdfcb6ae0619cc23547efcfe6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: grufo <madmurphy333 AT gmail DOT com>
# Contributor: midgard <arch.midgard AT janmaes DOT com>
# Contributor: TrialnError <autumn-wind AT web DOT de>
# Contributor: Yardena Cohen <yardenack AT gmail DOT com>
# Contributor: Max Roder <maxroder AT web DOT de>
# Contributor: Sebastian Jug <seb AT stianj DOT ug>

#
# Before running makepkg, you must do this:
#
# gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 0x4E2C6E8793298290
#

# To port this PKGBUILD to another language of tor-browser you have to change
# ONLY the variable `${_language}` both below and in `tor-browser.install`

_language='fa'

# This PKGBUILD is based on https://aur.archlinux.org/packages/tor-browser/

_appname='tor-browser'
pkgname="${_appname}-${_language,,}"
pkgver='8.5.2'
pkgrel='1'
pkgdesc="Tor Browser Bundle: anonymous browsing using Firefox and Tor (${_language})"
url='https://www.torproject.org/projects/torbrowser.html'
arch=('i686' 'x86_64')
_idstr32='linux32'
_idstr64='linux64'
license=('GPL')
depends=('gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
	'dbus-glib' 'alsa-lib' 'desktop-file-utils' 'hicolor-icon-theme'
	'libvpx' 'icu' 'libevent' 'nss' 'hunspell' 'sqlite')
optdepends=('zenity: simple dialog boxes'
	'kdialog: KDE dialog boxes'
	'gst-plugins-good: H.264 video'
	'gst-libav: H.264 video'
	'libpulse: PulseAudio audio driver'
	'libnotify: Gnome dialog boxes')
install="${_appname}.install"

_archstr=$([[ "${CARCH}" == 'x86_64' ]] && echo -n "${_idstr64}" || echo -n "${_idstr32}")

validpgpkeys=('EF6E286DDA85EA2A4BA7DE684E2C6E8793298290')

source_i686=("https://dist.torproject.org/torbrowser/${pkgver}/${_appname}-${_idstr32}-${pkgver}_${_language}.tar.xz"{,.asc})
source_x86_64=("https://dist.torproject.org/torbrowser/${pkgver}/${_appname}-${_idstr64}-${pkgver}_${_language}.tar.xz"{,.asc})
source=("${_appname}.desktop"
	"${_appname}.png"
	"${_appname}.sh")

sha256sums=('e9b6620a5683b2df7878d35a087039bf4449eb8648361a12ddbd968d98b59e8b'
            '17fc2f5784d080233aca16e788d62ab6fe3e57cf781b123cfe32767de97d6d3b'
            '3a491ad1a476f2fb343f274eab4e8df925637438e6dac3591f092b3ef3294da3')
sha256sums_i686=('SKIP'
                 'SKIP')
sha256sums_x86_64=('SKIP'
                   'SKIP')

noextract=("${_appname}-${_idstr64}-${pkgver}_${_language}.tar.xz"
	"${_appname}-${_idstr32}-${pkgver}_${_language}.tar.xz")

package() {

	cd "${srcdir}"

	sed -i "s/__REPL_LANGUAGE__/${_language}/g"	"${_appname}.desktop"
	sed -i "s/__REPL_NAME__/${pkgname}/g"		"${_appname}.desktop"

	sed -i "s/__REPL_NAME__/${pkgname}/g"		"${_appname}.sh"
	sed -i "s/__REPL_VERSION__/${pkgver}/g"		"${_appname}.sh"
	sed -i "s/__REPL_RELEASE__/${pkgrel}/g"		"${_appname}.sh"
	sed -i "s/__REPL_LANGUAGE__/${_language}/g"	"${_appname}.sh"
	sed -i "s/__REPL_ARCH__/${_archstr}/g"		"${_appname}.sh"

	install -Dm 644 "${_appname}.desktop"	"${pkgdir}/usr/share/applications/${pkgname}.desktop"
	install -Dm 644 "${_appname}.png"	"${pkgdir}/usr/share/pixmaps/${pkgname}.png"
	install -Dm 755 "${_appname}.sh"	"${pkgdir}/usr/bin/${pkgname}"

	install -Dm 644 "${_appname}-${_archstr}-${pkgver}_${_language}.tar.xz" "${pkgdir}/opt/${pkgname}/${_appname}-${_archstr}-${pkgver}_${_language}.tar.xz"

}