From cf648d64b2b23ad91ad8cffa704a4a2d3687a091 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 28 Aug 2019 16:15:04 +0100 Subject: [PATCH] DragonFly: make import-src now prepares the source for importing I'm a lazy man and there's too many steps to import dhcpcd into DragonFlyBSD, so hopefully this makes it a lot easier. --- Makefile | 6 ++++++ configure | 11 +++++++++++ hooks/Makefile | 7 +++++++ src/Makefile | 28 ++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/Makefile b/Makefile index a39b0f89..1a1d5b0b 100644 --- a/Makefile +++ b/Makefile @@ -91,4 +91,10 @@ import: dist ${INSTALL} -d /tmp/${DISTPREFIX} tar xvJpf ${DISTFILE} -C /tmp +import-src: + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp LICENSE README.md /tmp/${DISTPREFIX} + for x in ${SUBDIRS}; do cd $$x; ${MAKE} DESTDIR=/tmp/${DISTPREFIX} $@ || exit $$?; cd ..; done + include Makefile.inc diff --git a/configure b/configure index a42e99db..69bf4a72 100755 --- a/configure +++ b/configure @@ -1217,6 +1217,14 @@ if [ "$FLS64" = yes ]; then echo "#define HAVE_SYS_BITOPS_H" >>$CONFIG_H fi +# Workaround for DragonFlyBSD import +if [ "$OS" = dragonfly ]; then + echo "#ifdef USE_PRIVATECRYPTO" >>$CONFIG_H + echo "#define HAVE_MD5_H" >>$CONFIG_H + echo "#define SHA2_H " >>$CONFIG_H + echo "#else" >>$CONFIG_H +fi + if [ -z "$MD5" ]; then MD5_LIB= printf "Testing for MD5Init ... " @@ -1353,6 +1361,9 @@ else [ -n "$SHA2_LIB" ] && echo "LDADD+= $SHA2_LIB" >>$CONFIG_MK fi +# Workarond for DragonFlyBSD import +[ "$OS" = dragonfly ] && echo "#endif" >>$CONFIG_H + if [ -z "$HMAC" ]; then HMAC_LIB= printf "Testing for hmac ... " diff --git a/hooks/Makefile b/hooks/Makefile index b07f9eb7..152806e7 100644 --- a/hooks/Makefile +++ b/hooks/Makefile @@ -61,4 +61,11 @@ import: ${HOOKSCRIPTS} ${INSTALL} -m ${NONBINMODE} ${SCRIPTS} /tmp/${DISTPREFIX}/dhcpcd-hooks ${INSTALL} -m ${NONBINMODE} ${FILES} /tmp/${DISTPREFIX}/dhcpcd-hooks +import-src: + ${INSTALL} -d ${DESTDIR}/hooks + cp dhcpcd-run-hooks.in dhcpcd-run-hooks.8.in [0-9]* ${DESTDIR}/hooks + rm ${DESTDIR}/hooks/50-dhcpcd-compat + if [ `uname` = Linux ]; then rm ${DESTDIR}/hooks/50-ypbind.in; \ + else rm ${DESTDIR}/hooks/50-yp.conf; fi + include ${TOP}/Makefile.inc diff --git a/src/Makefile b/src/Makefile index 665f5ff6..2811714d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -135,4 +135,32 @@ clean: distclean: clean rm -f .depend +import-src: ${SRCS} + ${INSTALL} -d ${DESTDIR}/src + touch if-bsd.h if-linux.h if-sun.h + cp defs.h ${SRCS} ${SRCS:.c=.h} dev.h ${MAN5}.in ${MAN8}.in ${DESTDIR}/src + rm if-bsd.h if-linux.h if-sun.h + rm -f ${DESTDIR}/src/if-bsd.h ${DESTDIR}/src/if-linux.h ${DESTDIR}/src/if-sun.h + ${INSTALL} -d ${DESTDIR}/compat + touch ../compat/rb.h ../compat/strtou.h + cd ..; cp ${COMPAT_SRCS} ${COMPAT_SRCS:.c=.h} ${DESTDIR}/compat + rm ../compat/rb.h ../compat/strtou.h + rm -f ${DESTDIR}/compat/rb.h ${DESTDIR}/compat/strtou.h + if ! grep HAVE_SYS_BITOPS_H ../config.h; then \ + cp ../compat/bitops.h ${DESTDIR}/compat; \ + fi + if grep compat/consttime_memequal.h ../config.h; then \ + cp ../compat/consttime_memequal.h ${DESTDIR}/compat; \ + fi + if [ -e ${DESTDIR}/compat/rb.c ]; then \ + cp ../compat/rbtree.h ${DESTDIR}/compat; \ + fi + if [ -e ${DESTDIR}/compat/strtoi.c ]; then \ + cp ../compat/_strtoi.h ${DESTDIR}/compat; \ + fi + ${INSTALL} -d ${DESTDIR}/compat/crypt + cd ..; cp ${CRYPT_SRCS} ${CRYPT_SRCS:.c=.h} ${DESTDIR}/compat/crypt + # DragonFlyBSD builds base version with private crypto + if [ `uname` = DragonFly ]; then rm ${DESTDIR}/compat/crypt/md5* ${DESTDIR}/compat/crypt/sha256*; fi + include ${TOP}/Makefile.inc -- 2.47.2