Add the distinfo target, from dhcpcd.
authorRoy Marples <roy@marples.name>
Fri, 4 Nov 2016 15:45:19 +0000 (15:45 +0000)
committerRoy Marples <roy@marples.name>
Fri, 4 Nov 2016 15:45:19 +0000 (15:45 +0000)
Makefile
configure

index dbc0673fd2527e93f12fd6fb6b25ef49e4542c78..dbe0950a368bdb9fa885d78d78edd9e9933091b0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,11 @@ SED_STATUSARG=               -e 's:@STATUSARG@:${STATUSARG}:g'
 DISTPREFIX?=   ${PKG}-${VERSION}
 DISTFILEGZ?=   ${DISTPREFIX}.tar.gz
 DISTFILE?=     ${DISTPREFIX}.tar.xz
+DISTINFO=      ${DISTFILE}.distinfo
+DISTINFOSIGN=  ${DISTINFO}.asc
+CKSUM?=                cksum -a SHA256
+PGP?=          netpgp
+
 FOSSILID?=     current
 
 .SUFFIXES: .in
@@ -53,7 +58,7 @@ clean:
        rm -f ${TARGET}
 
 distclean: clean
-       rm -f config.mk ${DISTFILE}
+       rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
 
 installdirs:
 
@@ -83,3 +88,10 @@ dist:
        fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
        gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
        rm ${DISTFILEGZ}
+
+distinfo: dist
+       ${CKSUM} ${DISTFILE} >${DISTINFO}
+       #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
+       ${PGP} --sign --detach --armor --output=${DISTINFOSIGN} ${DISTINFO}
+       chmod 644 ${DISTINFOSIGN}
+       ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
index b430b20fc344d450fdfb7bac3e344e85e6536709..a890cf0dc634e047604ab3001248249c27f75d6b 100755 (executable)
--- a/configure
+++ b/configure
@@ -120,14 +120,21 @@ echo "Configuring openresolv for ... $OS"
 rm -rf $CONFIG_MK
 echo "# $OS" >$CONFIG_MK
 
-# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled
-# regardless of if it's not running.
-# So we force onestatus to work around this silly bug.
-if [ -z "$STATUSARG" ]; then
-       case "$OS" in
-       freebsd*)       STATUSARG="onestatus";;
-       esac
-fi
+case "$OS" in
+freebsd*)
+       # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled
+       # regardless of if it's not running.
+       # So we force onestatus to work around this silly bug.
+       if [ -z "$STATUSARG" ]; then
+               STATUSARG="onestatus"
+       fi
+       ;;
+linux*)
+       # cksum does't support -a and netpgp is rare
+       echo "CKSUM=            sha256sum --tag" >>$CONFIG_MK
+       echo "PGP=              gpg2" >>$CONFIG_MK
+       ;;
+esac
 
 for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG
 do