summaryrefslogtreecommitdiffstats
path: root/main/dhcp/APKBUILD
blob: 95ba191d75034e0e7d213fd9574d9e8ba9f24851 (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
106
107
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dhcp
pkgver=4.3.0
_realver=${pkgver/_p/-P}
pkgrel=1
pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)"
url="https://www.isc.org/"
arch="all"
license="ISC"
depends=
pkgusers="dhcp"
pkggroups="dhcp"
makedepends="perl"
install="dhcp.pre-install dhcp.pre-upgrade dhcp.post-upgrade"
subpackages="$pkgname-doc $pkgname-dev $pkgname-dbg dhclient dhcrelay"
source="http://ftp.isc.org/isc/dhcp/${_realver}/$pkgname-$_realver.tar.gz
	dhcp-3.0-fix-perms.patch
	fix-includes.patch
	dhcrelay.initd
	dhcrelay.confd
	dhcpd.confd
	dhcpd.initd"

prepare() {
	cd "$srcdir/$pkgname-$_realver"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$srcdir/$pkgname-$_realver"
	# fix ipv6
	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/dhcp \
		--with-cli-pid-file=/var/run/dhcp/dhclient.pid \
		--with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
		--with-srv-pid-file=/var/run/dhcp/dhcpd.pid \
		--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
		--with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \
		--enable-dhcpv6 \
		--enable-paranoia \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		|| return 1
	make || return 1
}

package() {
	cd "$srcdir/$pkgname-$_realver"
	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/dhcpd.initd "$pkgdir"/etc/init.d/dhcpd
	install -m644 -D "$srcdir"/dhcpd.confd "$pkgdir"/etc/conf.d/dhcpd
	install -d "$pkgdir"/var/lib/dhcp
	install -d "$pkgdir"/var/run/dhcp
}

dhclient() {
	pkgdesc="ISC dhcp client"
	install -d -o dhcp -g dhcp "$subpkgdir"/var/lib/dhcp
	install -d -o dhcp -g dhcp "$subpkgdir"/var/run/dhcp
	install -d "$subpkgdir"/usr/sbin
	install -d "$subpkgdir"/etc/dhcp
	mv "$pkgdir"/usr/sbin/dhclient "$subpkgdir"/usr/sbin/
	mv "$pkgdir"/etc/dhcp/dhclient.conf* "$subpkgdir"/etc/dhcp/
}

dhcrelay() {
	pkgdesc="ISC dhcp relay server"
	replaces="dhcp"
	install -d "$subpkgdir"/var/run/dhcp \
		"$subpkgdir"/usr/sbin || return 1
	mv "$pkgdir"/usr/sbin/dhcrelay "$subpkgdir"/usr/sbin/
	install -m755 -D "$srcdir"/dhcrelay.initd \
		"$subpkgdir"/etc/init.d/dhcrelay 
	install -m644 -D "$srcdir"/dhcrelay.confd \
		"$subpkgdir"/etc/conf.d/dhcrelay
}

md5sums="1020d77e1a4c1f01b76279caff9beb80  dhcp-4.3.0.tar.gz
a9eaf182dae3984670da52f20ae10fba  dhcp-3.0-fix-perms.patch
f4c72603a4772b68bc26c311472ad2eb  fix-includes.patch
1597c012bb1a2c0828254c87f0a904ad  dhcrelay.initd
db84514fe15fd7d81136afbaae738f55  dhcrelay.confd
026570f93fe76d2cdb0bbe6782b3ea5a  dhcpd.confd
215f9e4f8643d7356342ebc624bfc56d  dhcpd.initd"
sha256sums="a7b6517d5cf32c5e49d2323a63de00efe5391df7cb0045dfa0ec8f6ee46ebe8a  dhcp-4.3.0.tar.gz
7482f93ec9140aa86b20d3fcc8cf336f1f2babf6217a909522c30a7947b0327d  dhcp-3.0-fix-perms.patch
a3490fdb267f88c2b5de77620cc866c873d8994f02d1dda0fa2ce8ab936740ed  fix-includes.patch
d97fe25d5e20851a7ca7e0b77bc7256c91f6592b1bd186d152d5c3e621570a36  dhcrelay.initd
409b895ed489e75c1a08f72961b45d641b93fd9357f528abc78b1fd036b7f730  dhcrelay.confd
e8a413e9102948b336f60041fc3cade33125faf56d8319ee65d9f3c63199a8e7  dhcpd.confd
7046c70408ae59648a2aafa9bb864581f6b0162bab25cadc36abed57bb680038  dhcpd.initd"
sha512sums="e995436cc1af58cecda3bebd8a6f5539dadce95cdd611dc5e1f653e5a38a985410594a3525b8d8709df9280fd599e25699326b1d7c196a451e95f6b8a34ad525  dhcp-4.3.0.tar.gz
d5697a56fbbff25199962608986e7ffb533ed4afd3e344e3c79d2010dda73cc0b088f06c454e9f0c69eb054e09a374455fa71d3f73306e0c98fa76df4dd321b7  dhcp-3.0-fix-perms.patch
88693958b752c5f9ccd7cb4faa677debdf71ce51e75cf4b2c303f2df16798c25da0bb24ead66ece1ac029ddc731cf36bc6a81ce56d5f75e142e1eacf1e8eb20f  fix-includes.patch
cc1d569fe3d826507b697f5749a468af9381416e19657a4239ab174e21d3dc281093f05a6ef6d21fb81f4c74d9aea1de98c76cb4b892224a16e9a173860006d6  dhcrelay.initd
fd15dbaa4c61c3c26f407bf13dde859470a1adba134da064b653ccc152ce42635ee8de2fe113ae21ba8470e97e3caad8c1a47b69eb25e5e92b40e26790b96f6d  dhcrelay.confd
7b7a77b7826b475a4113ebeee54501ce417cc56e85754301a82a185d88b4713d198f615a366e63e0e2b0aef988c8137dcd1e18c4036d993378257079da17693d  dhcpd.confd
6f2944bb3cef2cd533fbb307f5299e97ff3b6a0972807b14f1e80d61c7d2937599b178c1b49373bd529a228705578480f4850990bc87168d13d8a265699dd3a5  dhcpd.initd"