summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-11-04 16:07:10 +0000
committerRoy Marples <roy@marples.name>2016-11-04 16:07:10 +0000
commitb22390fad44b41f8d05363de3845656c28e047d6 (patch)
treeecdab03f4bb6a48a2455eb838e2691a42ad77b69
parenteb7b12e8025dcc585bdeda36f5a835259e5292c3 (diff)
downloaddhcpcd-ui-b22390fad44b41f8d05363de3845656c28e047d6.tar.xz
Add distinfo target from dhcpcd to produce signed distinfo files.
-rw-r--r--Makefile14
-rwxr-xr-xconfigure8
2 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a5f50c7..2d1a5dc 100644
--- 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)
diff --git a/configure b/configure
index a97afc5..8eb3374 100755
--- 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