## 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.
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
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}
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}/*