| 1 |
PROG= dhcpcd-ui |
| 2 |
PACKAGE= ${PROG} |
| 3 |
VERSION= 0.7.9 |
| 4 |
|
| 5 |
TOPDIR= . |
| 6 |
include ${TOPDIR}/iconfig.mk |
| 7 |
include ${MKDIR}/subdir.mk |
| 8 |
|
| 9 |
.PHONY: icons |
| 10 |
|
| 11 |
SUBDIR= src ${MKICONS} |
| 12 |
|
| 13 |
DIST!= if test -d .git; then echo "dist-git"; \ |
| 14 |
else echo "dist-inst"; fi |
| 15 |
DISTPREFIX?= ${PACKAGE}-${VERSION} |
| 16 |
DISTFILETAR?= ${DISTPREFIX}.tar |
| 17 |
DISTFILE?= ${DISTFILETAR}.xz |
| 18 |
DISTINFO= ${DISTFILE}.distinfo |
| 19 |
DISTINFOMD= ${DISTINFO}.md |
| 20 |
DISTSIGN= ${DISTFILE}.asc |
| 21 |
|
| 22 |
CLEANFILES+= ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} |
| 23 |
|
| 24 |
_SNAP_SH= date -u +%Y%m%d%H%M |
| 25 |
_SNAP!= ${_SNAP_SH} |
| 26 |
SNAP= ${_SNAP}$(shell ${_SNAP_SH}) |
| 27 |
SNAPDIR= ${DISTPREFIX}-${SNAP} |
| 28 |
SNAPFILE= ${SNAPDIR}.tar.xz |
| 29 |
|
| 30 |
SHA256?= sha256 |
| 31 |
PGP?= gpg |
| 32 |
|
| 33 |
dist-git: |
| 34 |
git archive --prefix=${DISTPREFIX}/ v${VERSION} | xz >${DISTFILE} |
| 35 |
|
| 36 |
dist-inst: |
| 37 |
mkdir /tmp/${DISTPREFIX} |
| 38 |
cp -RPp * /tmp/${DISTPREFIX} |
| 39 |
(cd /tmp/${DISTPREFIX}; make clean) |
| 40 |
tar -cvJpf ${DISTFILE} -C /tmp ${DISTPREFIX} |
| 41 |
rm -rf /tmp/${DISTPREFIX} |
| 42 |
|
| 43 |
dist: ${DIST} |
| 44 |
|
| 45 |
distinfo: dist |
| 46 |
rm -f ${DISTINFO} ${DISTSIGN} |
| 47 |
${SHA256} ${DISTFILE} >${DISTINFO} |
| 48 |
wc -c <${DISTFILE} \ |
| 49 |
| xargs printf 'Size (${DISTFILE}) = %s\n' >>${DISTINFO} |
| 50 |
${PGP} --armour --detach-sign ${DISTFILE} |
| 51 |
chmod 644 ${DISTSIGN} |
| 52 |
ls -l ${DISTFILE} ${DISTINFO} ${DISTSIGN} |
| 53 |
|
| 54 |
${DISTINFOMD}: ${DISTINFO} |
| 55 |
echo '```' >${DISTINFOMD} |
| 56 |
cat ${DISTINFO} >>${DISTINFOMD} |
| 57 |
echo '```' >>${DISTINFOMD} |
| 58 |
|
| 59 |
release: distinfo ${DISTINFOMD} |
| 60 |
gh release create v${VERSION} \ |
| 61 |
--title "${PACKAGE} ${VERSION}" --draft --generate-notes \ |
| 62 |
--notes-file ${DISTINFOMD} \ |
| 63 |
${DISTFILE} ${DISTSIGN} |
| 64 |
|
| 65 |
distclean: |
| 66 |
(cd src; make clean) |
| 67 |
rm -f config.h config.mk config.log \ |
| 68 |
dhcpcd-ui-*.tar.xz* |
| 69 |
|
| 70 |
snapshot: icons |
| 71 |
mkdir /tmp/${SNAPDIR} |
| 72 |
cp -RPp * /tmp/${SNAPDIR} |
| 73 |
(cd /tmp/${SNAPDIR}; make clean; rm config.h config.mk) |
| 74 |
find /tmp/${SNAPDIR} -name .gitignore -delete |
| 75 |
tar -cvJpf ${SNAPFILE} -C /tmp ${SNAPDIR} |
| 76 |
rm -rf /tmp/${SNAPDIR} |
| 77 |
ls -l ${SNAPFILE} |
| 78 |
|
| 79 |
snap: snapshot |
| 80 |
|
| 81 |
icons: |
| 82 |
${MAKE} -C icons |