Add distinfo target from dhcpcd to produce signed distinfo files.
authorRoy Marples <roy@marples.name>
Fri, 4 Nov 2016 16:07:10 +0000 (16:07 +0000)
committerRoy Marples <roy@marples.name>
Fri, 4 Nov 2016 16:07:10 +0000 (16:07 +0000)
Makefile
configure

index a5f50c78d3e8397eae985e1261ec60ae483dc7f3..2d1a5dc9ad795bd880c181461212f56053b5f7f9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,12 @@ FOSSILID?=   current
 DISTPREFIX?=   ${PROG}-${VERSION}
 DISTFILEGZ?=   ${DISTPREFIX}.tar.gz
 DISTFILE?=     ${DISTPREFIX}.tar.xz
+DISTINFO=      ${DISTFILE}.distinfo
+DISTINFOSIGN=  ${DISTINFO}.asc
+CKSUM?=                cksum -a SHA256
+PGP?=          netpgp
 
-CLEANFILES+=   *.tar.xz
+CLEANFILES+=   ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
 
 _SNAP_SH=      date -u +%Y%m%d%H%M
 _SNAP!=                ${_SNAP_SH}
@@ -30,7 +34,13 @@ dist:
        rm -rf /tmp/${DISTPREFIX}/doc
        tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX}
        rm -rf /tmp/${DISTPREFIX} /tmp/${DISTFILEGZ}
-       ls -l ${DISTFILE}
+
+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}
 
 distclean:
        (cd src; make clean)
index a97afc5170b797528ce671d7e9c7e9413b6e8025..8eb33742fc9df8a3bee83a20cb9a83a7c45f2cc5 100755 (executable)
--- a/configure
+++ b/configure
@@ -146,6 +146,14 @@ echo "/* $OS */" >$CONFIG_H
 VERSION=$($SED -ne 's/VERSION= //p' Makefile)
 echo "#define VERSION          \"$VERSION\"" >>$CONFIG_H
 
+case "$OS" in
+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 PREFIX SYSCONFDIR BINDIR; do
        eval v=\$$x
        # Make files look nice for import