aboutsummaryrefslogtreecommitdiffstats
path: root/main/dhcp
diff options
context:
space:
mode:
authortcely <tcely@users.noreply.github.com>2019-03-07 21:14:19 -0500
committerNatanael Copa <ncopa@alpinelinux.org>2019-05-03 19:05:59 +0200
commitbc1bb5c883f92dba9d21723535f515f4649e0243 (patch)
tree160e433d79297d592b6270741f1fecb656acc6d6 /main/dhcp
parent25ba76706fe915ff7767a7d234da500e62c2fea0 (diff)
downloadaports-bc1bb5c883f92dba9d21723535f515f4649e0243.tar.bz2
aports-bc1bb5c883f92dba9d21723535f515f4649e0243.tar.xz
main/dhcp: add dhcp-server-ldap flavor
Diffstat (limited to 'main/dhcp')
-rw-r--r--main/dhcp/APKBUILD93
1 files changed, 83 insertions, 10 deletions
diff --git a/main/dhcp/APKBUILD b/main/dhcp/APKBUILD
index 8e8117646b..2408113309 100644
--- a/main/dhcp/APKBUILD
+++ b/main/dhcp/APKBUILD
@@ -7,15 +7,21 @@ pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)"
url="https://www.isc.org/"
arch="all"
license="MPL-2.0"
-depends=
+depends="dhcp-server"
+depends_server_ldap="!$pkgname-server-vanilla $pkgname"
+depends_server_vanilla="!$pkgname-server-ldap $pkgname"
# busybox utils are not sufficient for dhclient
#depends_dhclient_optional="bash iputils net-tools sed util-linux"
depends_dhclient="coreutils iproute2 run-parts $depends_dhclient_optional"
pkgusers="dhcp"
pkggroups="dhcp"
-makedepends="perl linux-headers $depends_dhclient $depends_dhclient_optional"
+makedepends="krb5-dev linux-headers openldap-dev perl $depends_dhclient"
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade"
-subpackages="$pkgname-doc $pkgname-dev $pkgname-dbg $pkgname-openrc dhclient dhcrelay dhcrelay-openrc"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-dbg $pkgname-openrc
+ dhclient dhcrelay dhcrelay-openrc
+ $pkgname-server-vanilla:server_vanilla
+ $pkgname-server-ldap:server_ldap
+ $pkgname-server:server_empty:noarch"
source="http://ftp.isc.org/isc/$pkgname/${_realver}/$pkgname-$_realver.tar.gz
01-dhclient-script-fix-bare-ip.patch
02-dhclient-script-remove-bashisms.patch
@@ -33,32 +39,57 @@ builddir="$srcdir/$pkgname-$_realver"
# - CVE-2018-5732
# - CVE-2018-5733
-build() {
- cd "$builddir"
+_configure() {
# fix ipv6
export CFLAGS="$CFLAGS -D_GNU_SOURCE \
-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'"
+
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc/dhcp \
- --with-cli-pid-file=/var/run/dhcp/dhclient.pid \
+ --localstatedir=/var \
+ --with-srv-conf-file=/etc/dhcp/dhcpd.conf \
+ --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
+ --with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
+ --with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \
--with-srv-pid-file=/var/run/dhcp/dhcpd.pid \
- --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
+ --with-srv6-pid-file=/var/run/dhcp/dhcpd6.pid \
+ --with-cli-pid-file=/var/run/dhcp/dhclient.pid \
+ --with-cli6-pid-file=/var/run/dhcp/dhclient6.pid \
--with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \
- --enable-dhcpv6 \
+ --with-relay6-pid-file=/var/run/dhcp/dhcrelay6.pid \
+ --with-libbind=no \
+ --enable-dhcpv4o6 \
--enable-paranoia \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info
+ --enable-log-pid \
+ "$@"
+
+}
+build() {
+ cd "$builddir"
+ cp -a "$builddir" "${builddir}-ldap"
+
+ _configure
+ make -j1 -C bind && make
+
+ cd "${builddir}-ldap"
+ _configure \
+ --with-ldap \
+ --with-ldapcrypto \
+ --with-ldap-gssapi
make -j1 -C bind && make
}
check() {
cd "$builddir"
make check
+
+ cd "${builddir}-ldap"
+ make check
}
package() {
@@ -79,7 +110,15 @@ package() {
install -d "$pkgdir"/var/run/dhcp
}
+dbg() {
+ depends="$depends_dbg"
+
+ default_dbg
+}
+
openrc() {
+ depends="$depends_openrc"
+
local dir _etcdir="$pkgdir/etc.${subpkgname%-openrc}"
for dir in conf.d init.d; do
if [ -d "$_etcdir/$dir" ]; then
@@ -92,9 +131,41 @@ openrc() {
default_openrc
}
+server_empty() {
+ pkgdesc="ISC dhcpd server (virtual)"
+ depends="dhcp-server-vanilla"
+ provider_priority=0
+
+ install -d "$subpkgdir"
+ rmdir "$pkgdir/usr/sbin" || :
+}
+
+server_ldap() {
+ pkgdesc="ISC dhcpd server with LDAP support"
+ depends="$depends_server_ldap"
+ provides="dhcp-server"
+ provider_priority=100
+
+ install -d "$subpkgdir"
+ make DESTDIR="$subpkgdir" -C "${builddir}-ldap/server" install-sbinPROGRAMS
+ cd "$builddir"
+ rm -rf "${builddir}-ldap"
+}
+
+server_vanilla() {
+ pkgdesc="ISC dhcpd server"
+ depends="$depends_server_vanilla"
+ provides="dhcp-server"
+ provider_priority=200
+
+ install -d "$subpkgdir"/usr/sbin
+ mv "$pkgdir/usr/sbin/dhcpd" "$subpkgdir/usr/sbin/"
+}
+
dhclient() {
pkgdesc="ISC dhcp client"
depends="$depends_dhclient"
+
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
@@ -108,7 +179,9 @@ dhclient() {
dhcrelay() {
pkgdesc="ISC dhcp relay server"
+ depends="$depends_dhcrelay"
replaces="dhcp"
+
install -d "$subpkgdir"/var/run/dhcp \
"$subpkgdir"/usr/sbin
mv "$pkgdir"/usr/sbin/dhcrelay "$subpkgdir"/usr/sbin/