Remove distinfo files before making them and keep distinfo in signed result.
[dhcpcd-ui] / Makefile
1 PROG=           dhcpcd-ui
2 VERSION=        0.7.5
3
4 TOPDIR=         .
5 include ${TOPDIR}/iconfig.mk
6 include ${MKDIR}/subdir.mk
7
8 .PHONY:         icons
9
10 SUBDIR=         src ${MKICONS}
11
12 FOSSILID?=      current
13 DISTPREFIX?=    ${PROG}-${VERSION}
14 DISTFILEGZ?=    ${DISTPREFIX}.tar.gz
15 DISTFILE?=      ${DISTPREFIX}.tar.xz
16 DISTINFO=       ${DISTFILE}.distinfo
17 DISTINFOSIGN=   ${DISTINFO}.asc
18 CKSUM?=         cksum -a SHA256
19 PGP?=           netpgp
20
21 CLEANFILES+=    ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
22
23 _SNAP_SH=       date -u +%Y%m%d%H%M
24 _SNAP!=         ${_SNAP_SH}
25 SNAP=           ${_SNAP}$(shell ${_SNAP_SH})
26 SNAPDIR=        ${DISTPREFIX}-${SNAP}
27 SNAPFILE=       ${SNAPDIR}.tar.xz
28
29 dist:
30         fossil tarball --name ${DISTPREFIX} ${FOSSILID} /tmp/${DISTFILEGZ}
31         rm -rf /tmp/${DISTPREFIX}
32         tar -xzpf /tmp/${DISTFILEGZ} -C /tmp
33         (cd /tmp/${DISTPREFIX}; make icons)
34         rm -rf /tmp/${DISTPREFIX}/doc
35         tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX}
36         rm -rf /tmp/${DISTPREFIX} /tmp/${DISTFILEGZ}
37
38 distinfo: dist
39         rm -f ${DISTINFO} ${DISTINFOSIGN}
40         ${CKSUM} ${DISTFILE} >${DISTINFO}
41         #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
42         ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
43         chmod 644 ${DISTINFOSIGN}
44         ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
45
46 distclean:
47         (cd src; make clean)
48         rm -f config.h config.mk config.log
49
50 snapshot: icons
51         mkdir /tmp/${SNAPDIR}
52         cp -RPp * /tmp/${SNAPDIR}
53         (cd /tmp/${SNAPDIR}; make clean; rm config.h config.mk)
54         find /tmp/${SNAPDIR} -name .gitignore -delete
55         tar -cvJpf ${SNAPFILE} -C /tmp ${SNAPDIR}
56         rm -rf /tmp/${SNAPDIR}
57         ls -l ${SNAPFILE}
58
59 snap: snapshot
60
61 icons:
62         ${MAKE} -C icons