]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
build: Allow DESTDIR to work for import as well.
authorRoy Marples <roy@marples.name>
Wed, 28 Aug 2019 21:30:52 +0000 (22:30 +0100)
committerRoy Marples <roy@marples.name>
Wed, 28 Aug 2019 21:30:52 +0000 (22:30 +0100)
BUILDING.md
Makefile

index 95779511fa05a3363e2ed8eef06ee5f7e646acf3..6779ccec1e3b8a440c7013e1c9669ef2e120fb24 100644 (file)
@@ -134,16 +134,17 @@ You can decide which polling mechanism dhcpcd will select in eloop like so
 
 
 ## Importing into another source control system
-To prepare dhcpcd for import into a platform source tree (like NetBSD)
-you can use the make import target to create /tmp/dhcpcd-$version and
-populate it with all the source files and hooks needed.
+To import the full sources, use the import target.
+To import only the needed sources and documentation, use the import-src
+target.
+Both targets support DESTDIR to set the installation directory,
+if unset it defaults to `/tmp/dhcpcd-$VERSION`
+Example: `make DESTDIR=/usr/src/contrib/dhcpcd import-src`
+
 In this instance, you may wish to disable some configured tests when
 the binary has to run on older versions which lack support, such as getline.
 `./configure --without-getline`
 
-There is also the import-src target which installs just the needed source
-files in a specific directory (like DragonFly).
-`make DESTDIR=/usr/src/contrib/dhcpcd import-src`
 
 ## Hooks
 Not all the hooks in dhcpcd-hooks are installed by default.
index deff77b5ddfba223e031d44de4eabe3ceebd1209..dcd4624c9578b25f361f71d52efed9efbdd8177f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,7 @@ SUBDIRS=        src hooks
 
 VERSION!=      sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
 
-DIST!=         if test -f .fslckout; then echo "dist-fossil"; \
-               elif test -d .git; then echo "dist-git"; \
+DIST!=         if test -d .git; then echo "dist-git"; \
                else echo "dist-inst"; fi
 FOSSILID?=     current
 GITREF?=       HEAD
@@ -52,12 +51,6 @@ distclean: clean
        rm -f config.h config.mk config.log \
                ${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
 
-
-dist-fossil:
-       fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-       gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-       rm ${DISTFILEGZ}
-
 dist-git:
        git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
 
@@ -86,10 +79,17 @@ snapshot:
        tar cf - -C /tmp ${DISTPREFIX} | xz >${DISTFILE}
        ls -l ${DISTFILE}
 
-import: dist
-       rm -rf /tmp/${DISTPREFIX}
-       ${INSTALL} -d /tmp/${DISTPREFIX}
-       tar xvJpf ${DISTFILE} -C /tmp
+_import: dist
+       rm -rf ${DESTDIR}/*
+       ${INSTALL} -d ${DESTDIR}
+       tar xvpf ${DISTFILE} -C ${DESTDIR} --strip 1
+       @${ECHO}
+       @${ECHO} "============================================================="
+       @${ECHO} "dhcpcd-${VERSION} imported to ${DESTDIR}"
+
+import:
+       ${MAKE} _import DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else  echo /tmp/${DISTPREFIX}; fi`
+
 
 _import-src:
        rm -rf ${DESTDIR}/*