]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add import target for easy import into NetBSD
authorRoy Marples <roy@marples.name>
Wed, 15 Jul 2009 09:36:43 +0000 (09:36 +0000)
committerRoy Marples <roy@marples.name>
Wed, 15 Jul 2009 09:36:43 +0000 (09:36 +0000)
Makefile
configure
defs.h
dhcpcd-hooks/Makefile

index f2177a15264be991edc93d369efc4209f3e2ce5d..946d195bd85cd2e32b35aede233a046c034d8052 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,12 +50,13 @@ DISTFILE?=  ${DISTPREFIX}.tar.bz2
 
 CLEANFILES+=   *.tar.bz2
 
+.PHONY:                import import-bsd
+
 .SUFFIXES:     .in
 
 .in:
        ${SED} ${SED_DBDIR} ${SED_HOOKDIR} ${SED_SCRIPT} ${SED_SYS} $< > $@
 
-
 all: ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
 
 .c.o:
@@ -98,4 +99,16 @@ clean:
 dist:
        git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
 
+import-bsd:
+       rm -rf /tmp/${DISTPREFIX}
+       ${INSTALL} -d /tmp/${DISTPREFIX}
+       cp ${SRCS} *.in /tmp/${DISTPREFIX}
+       cp $$(${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} | \
+               sed -e 's/^.*c //g' -e 's/\\//g' .depend | \
+               tr ' ' '\n' | \
+               sort -u) /tmp/${DISTPREFIX}
+       cd dhcpcd-hooks; ${MAKE} DISTPREFIX=${DISTPREFIX} $@
+
+import: import-bsd
+
 include Makefile.inc
index 885cc555076ce83947b9779b2e5d2b85e6a9eaab..b3a242382fbbfdeb10968ceab8c66d87d2c87a24 100755 (executable)
--- a/configure
+++ b/configure
@@ -50,11 +50,20 @@ echo "/* $PLATFORM */" >$CONFIG_H
 
 echo "Configuring dhcpcd for ... $PLATFORM"
 
-for x in SYSCONFDIR SBINDIR LIBNAME LIBEXECDIR DBDIR RUNDIR MANDIR; do
+for x in SYSCONFDIR SBINDIR LIBEXECDIR DBDIR RUNDIR; do
+       # Make files look nice for import
+       l=$((10 - ${#x}))
+       if [ $l -gt 2 ]; then
+               t="     "
+       else
+               t=
+       fi
        eval v=\$$x
-       echo "$x=               $v" >>$CONFIG_MK
-       echo "#define $x        \"$v\"" >>$CONFIG_H
+       echo "$x=$t     $v" >>$CONFIG_MK
+       echo "#define $x$t      \"$v\"" >>$CONFIG_H
 done
+echo "LIBNAME= $LIBNAME" >>$CONFIG_MK
+echo "MANDIR=          $MANDIR" >>$CONFIG_MK
 
 if [ "$CC" != cc ]; then
        echo "Using compiler $CC"
@@ -108,7 +117,7 @@ esac
 LDELF=/libexec/ld.elf_so
 if [ -e "$LDELF" ]; then
        echo "Linking against $LDELF"
-       echo "LDFLAGS+=         -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK
+       echo "LDFLAGS+= -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK
 fi
 
 printf "Testing for arc4random support ... "
diff --git a/defs.h b/defs.h
index e97aef14c9418e270131c5c8059940f9aa345bdc..08524dddc9213d8a325ae52b3a4aed6de9fc216f 100644 (file)
--- a/defs.h
+++ b/defs.h
 #define PACKAGE                        "dhcpcd"
 #define VERSION                        "5.0.6"
 
-/* Some systems do not have a working fork. */
-/* #define THERE_IS_NO_FORK */
-
-/* Paths to things */
-#ifndef SYSCONFDIR
-# define SYSCONFDIR            "/etc"
-#endif
-#ifndef LIBEXECDIR
-# define LIBEXECDIR            "/libexec"
-#endif
-#ifndef RUNDIR
-# define RUNDIR                        "/var/run"
-#endif
-#ifndef DBDIR
-# define DBDIR                 "/var/db"
-#endif
-
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
 #endif
index a8ed21fb2c9775de8a0962a76a3fcb7a2af4a310..4a48a30606374695d2ece7c4fbe206128f1bcce4 100644 (file)
@@ -12,3 +12,6 @@ install:
        ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
        ${INSTALL} -m ${NONBINMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR}
 
+import-bsd:
+       ${INSTALL} -d /tmp/${DISTPREFIX}/dhcpcd-hooks
+       cp ${SCRIPTS} 50-ntp.conf /tmp/${DISTPREFIX}/dhcpcd-hooks