summaryrefslogtreecommitdiff
path: root/contrib/packages/alpine/gnunet/APKBUILD
blob: da2b2dec4fd5897e03293515b2c18f7d091682a8 (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
# Contributor: xrs <xrs@mail36.net>
# Maintainer: xrs <xrs@mail36.net>
pkgname=gnunet
pkgver=0.11.6
pkgrel=0
pkgdesc="A framework for secure and privacy enhancing peer-to-peer networking"
url="https://gnunet.org"
arch="all"
license="AGPL-3.0"
depends="libgpg-error libgcrypt nettle unbound-libs gnutls gnutls-utils gnurl
	libgnurl libmicrohttpd openssl libunistring libidn2 nss sqlite zlib
	miniupnpc gmp gettext bash which iptables coreutils sudo"
depends_dev="libgpg-error-dev libgcrypt-dev nettle-dev unbound-dev gnutls-dev
	gnurl-dev libmicrohttpd-dev openssl-dev libunistring-dev libidn2-dev
	nss-dev sqlite-dev zlib-dev miniupnpc-dev gmp-dev gettext"
makedepends="$depends_dev autoconf automake libtool gettext-dev python3
	texlive texinfo"
install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall"
pkgusers="gnunet"
pkggroups="gnunet gnunetdns"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="!check suid" # No check because The GNUnet project lacks a good CI at the moment.
source="https://mirrors.ocf.berkeley.edu/gnu/gnunet/gnunet-$pkgver.tar.gz
	gnunet-system.conf
	gnunet-user.conf
	gnunet-system-services.initd
	gnunet-user-services.initd
	gnunet.xsession
	"

prepare() {
	default_prepare
	autoreconf -if # FIXME: See https://bugs.gnunet.org/view.php?id=5902
}

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

check() {
	make DESTDIR="$pkgdir" check
	exit 0
}

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

	libexecdir=$pkgdir/usr/lib/gnunet/libexec/
	# Limit access to critical gnunet-helper-dns to group "gnunetdns"
	chgrp gnunetdns $libexecdir/gnunet-helper-dns
	chgrp gnunetdns $libexecdir/gnunet-service-dns
	# Limit access to certain SUID binaries by group "gnunet"
	chgrp gnunet    $libexecdir/gnunet-helper-exit
	chgrp gnunet    $libexecdir/gnunet-helper-vpn
	chgrp gnunet    $libexecdir/gnunet-helper-nat-client
	chgrp gnunet    $libexecdir/gnunet-helper-nat-server
	chmod u+s       $libexecdir/gnunet-helper-exit
	chmod u+s       $libexecdir/gnunet-helper-vpn
	chmod 2750      $libexecdir/gnunet-helper-dns
	chmod 2700      $libexecdir/gnunet-service-dns
	chmod u+s       $libexecdir/gnunet-helper-nat-client
	chmod u+s       $libexecdir/gnunet-helper-nat-server

	install -m644 -D $srcdir/$pkgname-user.conf \
		$pkgdir/etc/skel/.config/$pkgname.conf
	install -m644 -D $srcdir/$pkgname-system.conf \
		$pkgdir/etc/$pkgname.conf
	install -m755 -D $srcdir/$pkgname-system-services.initd \
		$pkgdir/etc/init.d/$pkgname-system-services
	install -m755 -D $srcdir/$pkgname-user-services.initd \
		$pkgdir/etc/init.d/$pkgname-user-services
	install -m755 -D $srcdir/$pkgname.xsession \
		$pkgdir/etc/X11/xinit/xinitrc.d/80-$pkgname-user-services
}

dev() {
	default_dev

	# dev() will move gnunet-config from $pkg to $pkg-dev, but it's an
	# intended part of $pkg.
	install -m755 -D $builddir/src/util/.libs/gnunet-config \
		$pkgdir/usr/bin/gnunet-config
}

sha512sums="1c6ea2ac7280d2edb30df627b79e017d199e93cd3970ce49f3f049abfb1dddfed541118e55766c422edf4a80e140c4eb2cfc681e0d4a1384e39811d024df9278  gnunet-0.11.6.tar.gz
a0f55413ed2c6edd6746a751d92ddac95ba70f20eefb07330817870d749456448f44bba95d245911a00f6078e0c2ac626004e3b764be5e5e049c00626c4c5ac0  gnunet-system.conf
b21112ff16aee771332aa9c33f55b0c7f46fe0266053543241e3efbe25dba56482c0e11112a192eefe59f1c74d2af5d7071b6a4e1e875cfc7e9d55b5fe8a0a33  gnunet-user.conf
96ab78bb48d5fb10f0b34336ad05e73b543c4362c73436ef20b3bb83dff214e997acf38a2ea493b1901bdc37c8877d83cdaebd73a0e50831e2f23413c8edda76  gnunet-system-services.initd
f67252e18c5fd701338653efe4cc14caae9213c1955f690cddec9fd7ad31a22680e931fbe908a1c5a78dc05094e547b2279f9a488f2ed80cc169590ad5ffa064  gnunet-user-services.initd
839a081aca19b863f378db980e6447ad30c6c0ee72fac6e11c65e57e86886d675ebc61069e17f696b6ca868e8ce259cabf80feb90b04b23f3da3c628f7beb915  gnunet.xsession"