aboutsummaryrefslogtreecommitdiffstats
path: root/community/tor/APKBUILD
blob: ac4576411b1417e88b023efdd5ec80cdbdadcf11 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Contributor: Christine Dodrill <me@christine.website>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=tor
pkgver=0.4.8.11
pkgrel=0
pkgdesc="Anonymous network connectivity"
url="https://www.torproject.org/"
arch="all !s390x" # The extended_fmt test fail, try again next bump/upgrade
license="BSD-3-Clause AND GPL-3.0-only"
pkgusers="tor"
makedepends="ca-certificates
	libcap-dev
	libevent-dev
	libseccomp-dev
	openssl-dev>3
	xz-dev
	zlib-dev
	zstd-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://www.torproject.org/dist/tor-$pkgver.tar.gz
	0002-disable-wildcard-escaping-test.patch
	0003-disable-sandbox_chown_filename-test_patch
	0004-disable-more-sandbox-tests_patch
	tor.initd
	tor.confd
	torrc.sample.patch
	"

# secfixes:
#   0.4.7.8-r0:
#     - CVE-2022-33903
#   0.4.6.7-r0:
#     - CVE-2021-38385
#   0.4.6.5-r0:
#     - CVE-2021-28548
#     - CVE-2021-28549
#     - CVE-2021-28550
#   0.4.5.7-r0:
#     - CVE-2021-28089
#     - CVE-2021-28090
#   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 \
		--localstatedir=/var \
		--mandir=/usr/share/man \
		--enable-gpl \
		--disable-html-manual
	make
}

check() {
	# FIXME: find out why these specific tests only fail on these archs
	case "$CARCH" in
	aarch64|riscv64)
		patch src/test/test_sandbox.c \
		"$srcdir"/0003-disable-sandbox_chown_filename-test_patch
		patch src/test/test_sandbox.c \
		"$srcdir"/0004-disable-more-sandbox-tests_patch
		;;
	arm*) patch src/test/test_sandbox.c \
		"$srcdir"/0003-disable-sandbox_chown_filename-test_patch
		;;
	esac

	# TODO: use 'make check' instead, may need to update some skips !49207
	make test
}

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

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

	install -Dm0755 "$srcdir"/"$pkgname".initd \
		"$pkgdir"/etc/init.d/"$pkgname"
	install -Dm0644 "$srcdir"/"$pkgname".confd \
		"$pkgdir"/etc/conf.d/"$pkgname"
}

sha512sums="
186fb690a751b4c0dda87afc741627a4c8c9b1a781b295dcf25b767c40c3b62664c08c63fc98f80095af76dfa1060b42e19936941528d091db50fafdce88be6e  tor-0.4.8.11.tar.gz
c18e54a07de2baf50c3fbf0d100e964e0f39310f41df332507e737a1da3fa5d478445f679534d244f7d3978b341aa4723ca22830294ec409e6863476bd46356f  0002-disable-wildcard-escaping-test.patch
44a72a72a140c4fc7f3ce03b8a9a2b9244d6330ec5939778a2132470b8012676a5239fbb4b5a8b6dd80bf20f51e54d8e4a5b03384b0ec5a3aff22e22ee2970f5  0003-disable-sandbox_chown_filename-test_patch
2ea6ac4e02134903d85dc91ba90a20a94f95a0e950225c670b1364046277ba2fb4b6ab00d5d7d1b9dbfc072ee18c54603dd87ed8e4321362ca7102f8a965287d  0004-disable-more-sandbox-tests_patch
6de4ada16ba58264a247da70343eabd763e992d6b6683977fc1c67b7b4a9731748a7ec9751e869ad4b4ae9c72cf71b2e12dc289bb6e2aee499917f7663f4a735  tor.initd
2b0de119bfdf9eb57e13317b7392190b1b8272c8f96023c71d3fc29215d887e9a3d0ffcef37cdb50b18d34e4b2251f75a739e258e0bb72aabd3339418b22fd67  tor.confd
da386ff7e387312e647f04d360517a1f4cb1efbee36f4a3a6feb89a979bb12fa350fe6dfed49af0cb076ae30bb0c527b5d54127683eaa5aa45d6940dddd89dfb  torrc.sample.patch
"