aboutsummaryrefslogtreecommitdiffstats
path: root/community/tor/APKBUILD
blob: 59094bd3879c1c7d356cdc01e1152880c7927fe2 (plain) (blame)
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
# Contributor: Christine Dodrill <me@christine.website>
# Maintainer: Christine Dodrill <me@christine.website>
pkgname=tor
pkgver=0.4.4.6
pkgrel=0
pkgdesc="Anonymous network connectivity"
url="https://www.torproject.org/"
arch="all"
license="BSD-3-Clause"
pkgusers="tor"
makedepends="linux-headers bash libevent-dev openssl-dev ca-certificates
	zlib-dev xz-dev"
install="$pkgname.post-upgrade $pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://www.torproject.org/dist/tor-$pkgver.tar.gz
	tor.initd
	tor.confd
	torrc.sample.patch"

case "$CARCH" in
	armhf) _zstd="--disable-zstd" ;;
	* )
		makedepends="$makedepends zstd-dev"
		_zstd="--enable-zstd"
		;;
esac

# secfixes:
#   0.4.2.7-r0:
#     - CVE-2020-10592
#     - CVE-2020-10593
#   0.3.5.8-r0:
#     - CVE-2019-8955
#   0.3.0.8-r0:
#     - CVE-2017-0376
#   0.3.2.10-r0:
#     - CVE-2018-0490
#     - CVE-2018-0491

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		$_zstd
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install

	install -dm755 -o $pkgusers \
		"$pkgdir"/var/lib/$pkgname \
		"$pkgdir"/var/log/$pkgname

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="84f981bed6d8c89d3de437e35dd2ad2ca3ee5efd7ce6b78e3e00bf40f644f495b960a7a741be5dd7ba096d73d5f941974722a44e9d3ef4fbcd02b20274d565fb  tor-0.4.4.6.tar.gz
6de4ada16ba58264a247da70343eabd763e992d6b6683977fc1c67b7b4a9731748a7ec9751e869ad4b4ae9c72cf71b2e12dc289bb6e2aee499917f7663f4a735  tor.initd
2b0de119bfdf9eb57e13317b7392190b1b8272c8f96023c71d3fc29215d887e9a3d0ffcef37cdb50b18d34e4b2251f75a739e258e0bb72aabd3339418b22fd67  tor.confd
da386ff7e387312e647f04d360517a1f4cb1efbee36f4a3a6feb89a979bb12fa350fe6dfed49af0cb076ae30bb0c527b5d54127683eaa5aa45d6940dddd89dfb  torrc.sample.patch"