]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DragonFly: make import-src now prepares the source for importing
authorRoy Marples <roy@marples.name>
Wed, 28 Aug 2019 15:15:04 +0000 (16:15 +0100)
committerRoy Marples <roy@marples.name>
Wed, 28 Aug 2019 15:15:04 +0000 (16:15 +0100)
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
configure
hooks/Makefile
src/Makefile

index a39b0f896da4ebbe8005173cc6a7b9a432584254..1a1d5b0ba3b544df3762523aeb3a56cfddaaec7d 100644 (file)
--- 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
index a42e99dbe736b89088d56365b044cdf0a658196b..69bf4a727859f4feaa1110b9e35f8ce40b352fb7 100755 (executable)
--- 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  <sha256.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 ... "
index b07f9eb78c1561ae84e89acb485767a9dfdc9e1f..152806e7da6fcc14ad6438b0ab379e9d5d6a49f0 100644 (file)
@@ -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
index 665f5ff66dc90812050ea620b74cbed1ef4103a3..2811714d8cd66e42edce6bba887dae6333570c98 100644 (file)
@@ -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