]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix building the distribution.
authorRoy Marples <roy@marples.name>
Thu, 16 Mar 2017 10:01:12 +0000 (10:01 +0000)
committerRoy Marples <roy@marples.name>
Thu, 16 Mar 2017 10:01:12 +0000 (10:01 +0000)
Makefile

index 5e2f3d0c4b67cb0788a22c3c6eb41a83a1b40198..baa7caca2bd433ee974d6dc2a32eb90ba976e768 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,13 @@ 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"; \
+               else echo "dist-inst"; fi
 FOSSILID?=     current
+GITREF?=       HEAD
 
-DISTPREFIX?=   ${PROG}-${VERSION}
+DISTPREFIX?=   dhcpcd-${VERSION}
 DISTFILEGZ?=   ${DISTPREFIX}.tar.gz
 DISTFILE?=     ${DISTPREFIX}.tar.xz
 DISTINFO=      ${DISTFILE}.distinfo
@@ -45,11 +49,24 @@ distclean: clean
        rm -f config.h config.mk config.log \
                ${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
 
-dist:
+
+dist-fossil:
        fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
        gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
        rm ${DISTFILEGZ}
 
+dist-git:
+       git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+       mkdir /tmp/${DISTPREFIX}
+       cp -RPp * /tmp/${DISTPREFIX}
+       (cd /tmp/${DISTPREFIX}; make clean)
+       tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+       rm -rf /tmp/${DISTPREFIX}
+
+dist: ${DIST}
+
 distinfo: dist
        rm -f ${DISTINFO} ${DISTINFOSIGN}
        ${CKSUM} ${DISTFILE} >${DISTINFO}