Improve Makefile to build a tarball from fossil, to include the pdns_recursor
authorRoy Marples <roy@marples.name>
Thu, 12 Mar 2015 19:42:49 +0000 (19:42 +0000)
committerRoy Marples <roy@marples.name>
Thu, 12 Mar 2015 19:42:49 +0000 (19:42 +0000)
helper.
Fixes [aa084ee000].

Makefile

index 1a1c908d492316587abfc70dfc7abf5cdcde1c62..e575bfdac70673e95752a8fb52a7026c3e23914d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,5 @@
-NAME=          openresolv
+PKG=           openresolv
 VERSION=       3.6.1
-PKG=           ${NAME}-${VERSION}
 
 # Nasty hack so that make clean works without configure being run
 _CONFIG_MK!=   test -e config.mk && echo config.mk || echo config-null.mk
@@ -36,6 +35,11 @@ SED_VARDIR=          -e 's:@VARDIR@:${VARDIR}:g'
 SED_RCDIR=             -e 's:@RCDIR@:${RCDIR}:g'
 SED_RESTARTCMD=                -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
 
+DISTPREFIX?=   ${PKG}-${VERSION}
+DISTFILEGZ?=   ${DISTPREFIX}.tar.gz
+DISTFILE?=     ${DISTPREFIX}.tar.bz2
+FOSSILID?=     current
+
 .SUFFIXES: .in
 
 all: ${TARGET}
@@ -46,10 +50,10 @@ all: ${TARGET}
                $< > $@
 
 clean:
-       rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
+       rm -f ${TARGET}
 
 distclean: clean
-       rm -f config.mk
+       rm -f config.mk ${DISTFILE}
 
 installdirs:
 
@@ -71,13 +75,11 @@ maninstall:
 install: proginstall maninstall
 
 import:
-       rm -rf /tmp/${PKG}
-       ${INSTALL} -d /tmp/${PKG}
-       cp README ${SRCS} /tmp/${PKG}
-
-dist: import
-       cp configure Makefile GNUmakefile config-null.mk resolvconf.conf \
-           /tmp/${PKG}
-       tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
-       rm -rf /tmp/${PKG} 
-       ls -l ${PKG}.tar.bz2
+       rm -rf /tmp/${DISTPREFIX}
+       ${INSTALL} -d /tmp/${DISTPREFIX}
+       cp README ${SRCS} /tmp/${DISPREFIX}
+
+dist:
+       fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
+       gunzip -c ${DISTFILEGZ} |  bzip2 >${DISTFILE}
+       rm ${DISTFILEGZ}