APKBUILD 1.91 KB
Newer Older
1 2
# Contributor: Christine Dodrill <me@christine.website>
# Maintainer: Christine Dodrill <me@christine.website>
Sam Dodrill's avatar
Sam Dodrill committed
3
pkgname=tor
J0WI's avatar
J0WI committed
4 5
pkgver=0.4.1.7
pkgrel=0
Sam Dodrill's avatar
Sam Dodrill committed
6
pkgdesc="Anonymous network connectivity"
J0WI's avatar
J0WI committed
7
url="https://www.torproject.org/"
Sam Dodrill's avatar
Sam Dodrill committed
8
arch="all"
9
license="BSD-3-Clause"
Sam Dodrill's avatar
Sam Dodrill committed
10
pkgusers="tor"
11
makedepends="linux-headers bash libevent-dev openssl-dev ca-certificates
12
	zlib-dev"
13
install="$pkgname.post-upgrade $pkgname.pre-install"
14
subpackages="$pkgname-doc $pkgname-openrc"
Francesco Colista's avatar
Francesco Colista committed
15
source="https://www.torproject.org/dist/$pkgname-$pkgver.tar.gz
Sam Dodrill's avatar
Sam Dodrill committed
16
	tor.initd
17 18
	tor.confd
	torrc.sample.patch"
19
builddir="$srcdir/$pkgname-$pkgver"
Sam Dodrill's avatar
Sam Dodrill committed
20

Leonardo Arena's avatar
Leonardo Arena committed
21
# secfixes:
J0WI's avatar
J0WI committed
22 23
#   0.4.0.5-r0:
#     - CVE-2019-8955
24 25
#   0.3.5.8-r0:
#   - CVE-2019-8955
Leonardo Arena's avatar
Leonardo Arena committed
26 27
#   0.3.0.8-r0:
#   - CVE-2017-0376
28 29 30
#   0.3.2.10-r0:
#   - CVE-2018-0490
#   - CVE-2018-0491
Leonardo Arena's avatar
Leonardo Arena committed
31

Sam Dodrill's avatar
Sam Dodrill committed
32
build() {
33
	cd "$builddir"
34

Sam Dodrill's avatar
Sam Dodrill committed
35 36 37 38 39 40 41 42
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
43 44 45 46 47 48 49 50
		--enable-transparent
	make
}

check() {
	cd "$builddir"

	make test
Sam Dodrill's avatar
Sam Dodrill committed
51 52 53
}

package() {
54
	cd "$builddir"
55

56
	make DESTDIR="$pkgdir" install
57 58 59

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

Sam Dodrill's avatar
Sam Dodrill committed
62
	install -m755 -D "$srcdir"/$pkgname.initd \
63
		"$pkgdir"/etc/init.d/$pkgname
Sam Dodrill's avatar
Sam Dodrill committed
64
	install -m644 -D "$srcdir"/$pkgname.confd \
65
		"$pkgdir"/etc/conf.d/$pkgname
Sam Dodrill's avatar
Sam Dodrill committed
66 67
}

J0WI's avatar
J0WI committed
68
sha512sums="f6ead1412d23516a16f31e1157b4538071752ae09a421d9dceaa7cf76599c01490f9bfcb8e26f1a75e888359adf6adcd029ca64cf48e3b45b07e2d62482c9541  tor-0.4.1.7.tar.gz
69 70 71
6de4ada16ba58264a247da70343eabd763e992d6b6683977fc1c67b7b4a9731748a7ec9751e869ad4b4ae9c72cf71b2e12dc289bb6e2aee499917f7663f4a735  tor.initd
2b0de119bfdf9eb57e13317b7392190b1b8272c8f96023c71d3fc29215d887e9a3d0ffcef37cdb50b18d34e4b2251f75a739e258e0bb72aabd3339418b22fd67  tor.confd
da386ff7e387312e647f04d360517a1f4cb1efbee36f4a3a6feb89a979bb12fa350fe6dfed49af0cb076ae30bb0c527b5d54127683eaa5aa45d6940dddd89dfb  torrc.sample.patch"