aboutsummaryrefslogtreecommitdiffstats
path: root/main/ifupdown-ng/APKBUILD
blob: 53800549409483fefa9a1e8334719e17e1305125 (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
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=ifupdown-ng
pkgver=0.11.2
pkgrel=0
pkgdesc="tools for managing network configuration"
url="https://github.com/ifupdown-ng/ifupdown-ng"
arch="all"
license="ISC"
checkdepends="kyua atf"
makedepends="scdoc"
install=""
subpackages="$pkgname-doc $pkgname-iproute2 $pkgname-ppp $pkgname-wireguard $pkgname-ethtool $pkgname-batman"
source="https://distfiles.dereferenced.org/ifupdown-ng/ifupdown-ng-$pkgver.tar.xz"
builddir="$srcdir/ifupdown-ng-$pkgver"
provides="ifupdown-any"
provider_priority=900

# We conflict with the vlan package because we provide our own
# vlan support with the link executor.
depends="!vlan"

# We only install the core executors right now.  The other executors are
# still being ported to run under ifupdown-ng natively, and so we will
# use the ifupdown scripts for now for those cases.  However, it is nice
# to make the automatic dependency resolution work, and ifupdown-ng
# provides some stubs to enable that.
_executor_stubs="bridge bond"

# These are optional executors which do not conflict with what we are
# presently shipping.  These executors require iproute2.
_executor_iproute2="vrf gre vxlan"

# These are all optional executors we plan to use.
_executor_opt="ppp wireguard ethtool batman $_executor_iproute2"

build() {
	make
	make docs
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" EXECUTOR_SCRIPTS_OPT="$_executor_opt" EXECUTOR_SCRIPTS_STUB="$_executor_stubs" install install_docs
}

iproute2() {
	pkgdesc="ifupdown-ng integration for iproute2"
	depends="iproute2-minimal"
	install_if="$pkgname $depends"

	for exec in $_executor_iproute2; do
		amove usr/libexec/ifupdown-ng/$exec
	done
}

ppp() {
	pkgdesc="ifupdown-ng integration for ppp"
	depends="ppp-daemon"
	install_if="$pkgname $depends"

	amove usr/libexec/ifupdown-ng/ppp
}

wireguard() {
	pkgdesc="ifupdown-ng integration for wireguard"
	depends="wireguard-tools-wg"
	install_if="$pkgname $depends"

	amove usr/libexec/ifupdown-ng/wireguard
}

ethtool() {
	pkgdesc="ifupdown-ng integration for ethtool"
	depends="ethtool"
	install_if="$pkgname $depends"

	amove usr/libexec/ifupdown-ng/ethtool
}

batman() {
	pkgdesc="ifupdown-ng integration for B.A.T.M.A.N. advanced"
	depends="batctl"
	install_if="$pkgname $depends"

	amove usr/libexec/ifupdown-ng/batman
}

openrc() {
	pkgdesc="ifupdown-ng openrc init scripts"
	install_if="$pkgname openrc"
	replaces="openrc"

	install -D -m755 "$builddir"/dist/openrc/networking.initd "$subpkgdir"/etc/init.d/networking
	install -D -m644 "$builddir"/dist/openrc/networking.confd "$subpkgdir"/etc/conf.d/networking
}

sha512sums="31009bfe07b45dac49b492f8150526f13a59c164e9f71304b73a7faa4fb154ae22dbdcf5d6d7b8fde6022414522ffc15fd49289ff3bab17c63e2398ac5a985dc  ifupdown-ng-0.11.2.tar.xz"