From d0300133197265863f2d81047fb99587bfe95086 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Sat, 28 Mar 2015 19:55:16 +0100 Subject: [PATCH] dhcp: fix crossbuild Who the hell build such a fucked up buildsystem? --- srcpkgs/dhcp/files/003_cross_fix.patch | 12 ++++++++++++ srcpkgs/dhcp/template | 20 ++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/dhcp/files/003_cross_fix.patch diff --git a/srcpkgs/dhcp/files/003_cross_fix.patch b/srcpkgs/dhcp/files/003_cross_fix.patch new file mode 100644 index 0000000000..60bb5ed436 --- /dev/null +++ b/srcpkgs/dhcp/files/003_cross_fix.patch @@ -0,0 +1,12 @@ +--- lib/export/dns/Makefile.in.orig 2011-05-17 01:47:16.000000000 +0200 ++++ lib/export/dns/Makefile.in 2015-03-28 19:34:39.143820772 +0100 +@@ -166,7 +166,8 @@ code.h: gen + ./gen -s ${srcdir} > code.h + + gen: ${srcdir}/gen.c +- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} ++ ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ ++ ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS} + + #We don't need rbtdb64 for this library + #rbtdb64.@O@: rbtdb.c diff --git a/srcpkgs/dhcp/template b/srcpkgs/dhcp/template index 07d7ec1f31..3ec447fe80 100644 --- a/srcpkgs/dhcp/template +++ b/srcpkgs/dhcp/template @@ -10,13 +10,25 @@ license="ISC" homepage="https://www.isc.org/software/dhcp" distfiles="ftp://ftp.isc.org/isc/${pkgname}/${pkgname}-${version}/${pkgname}-${version}.tar.gz" checksum=505c5754526ba92669bfd64daa8b529c6694c4528b45c3f35743c6fd4bd72897 -configure_args=" - --enable-paranoia +conf_files="/etc/dhcpd.conf" +_configure_args+="--sbindir=/usr/bin --sysconfdir=/etc --enable-paranoia --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases --with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases --with-cli-lease-file=/var/lib/dhclient/dhclient.leases --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases" -conf_files="/etc/dhcpd.conf" + +pre_configure() { + if [ "$CROSS_BUILD" ]; then + # assume that there is /dev/random. Fixes cross compiling + sed -i "2i\ac_cv_file__dev_random=yes" configure + + # patching bind Makefile to patch with a cross fix while building (WTF?!) + sed -i "s#./configure#patch -p0 < $FILESDIR/003_cross_fix.patch \&\& ac_cv_file__dev_random=yes ./configure $configure_args#" bind/Makefile + fi + + # set real configure_args + configure_args+="$_configure_args" +} post_install() { vsv dhcpd4 @@ -28,7 +40,7 @@ dhclient_package() { conf_files="/etc/dhclient.conf" pkg_install() { vmove etc/dhclient.conf - vmove usr/sbin/dhclient + vmove usr/bin/dhclient vmove usr/share/man/man5/dhclient* vmove usr/share/man/man8/dhclient* vsv dhclient