aboutsummaryrefslogtreecommitdiffstats
path: root/community/jool-tools/APKBUILD
blob: c2652f3d9744205dcb33626276e4bfaefc5c91b6 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
_projname=jool
pkgname=jool-tools
# Keep in sync with _ver in community/jool-modules-{rpi,vanilla}!
pkgver=4.0.6
pkgrel=3
pkgdesc="Userspace control tools for SIIT / NAT64 Jool"
url="https://www.jool.mx"
arch="all"
license="GPL-2.0-only"
makedepends="argp-standalone iptables-dev libnl3-dev"
subpackages="
	$pkgname-static
	$pkgname-openrc
	$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	"
source="https://github.com/NICMx/Jool/releases/download/v$pkgver/$_projname-$pkgver.tar.gz
	jool.conf
	jool_siit.conf
	joold.conf
	jool.initd
	joold.initd
	"
builddir="$srcdir/$_projname-$pkgver"

build() {
	# --disable-shared - w/o this option the build fails with:
	#   relocation R_X86_64_PC32 against symbol `argp_program_version_hook'
	#   can not be used when making a shared object; recompile with -fPIC
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-shared
	make
}

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

	install -D -m 0644 "$srcdir"/jool.conf "$pkgdir"/etc/jool/jool.conf
	install -D -m 0644 "$srcdir"/jool_siit.conf "$pkgdir"/etc/jool/jool_siit.conf
	install -D -m 0644 "$srcdir"/joold.conf "$pkgdir"/etc/jool/joold.conf

	install -D -m 0755 "$srcdir"/jool.initd "$pkgdir"/etc/init.d/jool
	ln -s jool "$pkgdir"/etc/init.d/jool_siit
	install -D -m 0755 "$srcdir"/joold.initd "$pkgdir"/etc/init.d/joold
}

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share/
}

sha512sums="8648cc876d801b34c4bc9616da642727d1e49ed2937daa7fdca58c0fd80dbd1c432018af410c44c1d24224aba5289f726f43adc259cdf8193832d39a86d0f6a6  jool-4.0.6.tar.gz
4ae4c20fde75a0fdaed1c7c46ab5078297846b0734d31c7053575ff549984617a5486727c98f442125c6abfe8b170cde23ae4c24a4d6ff14b2ce31490bd46633  jool.conf
a48c84c49c24dd6639b86393fa7870b91fa700ba1e561e2440db1f4a94f3393171407a3cc683f4fc7a26a591578ec732dd3f708c1b4c45787a6e7ec038576357  jool_siit.conf
15758922ba83219f7edf34d93d825fcafb354b551a79f9b70e486faebcb154f55a52806aca6f7b9ec0d8277caa64a06a2525829be41c538cb3c678a78112b5e9  joold.conf
2eefae657e75d264838b435be38178cb3fe98f429f2367cf7cd08646c637f4a8ad3e226b4d7f7d460b28b81b8def9a5f5fd2617e2dd1c0c11889775e25951b21  jool.initd
5c9547b2546b0e360b4d1b1bd824edbc533d3b5f469724192ef164a28f8fa243972f54b3e028d9b27ec972fba5d5fc48d87c472333bbc1142a5a64241f1a32e2  joold.initd"