openrc/mk/dist.mk

44 lines
1019 B
Makefile
Raw Normal View History

2008-01-10 16:37:42 +00:00
# rules to make a distribution tarball from a git repo
2009-05-01 15:11:40 +01:00
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
2008-01-10 16:37:42 +00:00
GITREF?= ${VERSION}
2008-03-03 13:14:54 +00:00
DISTPREFIX?= ${NAME}-${VERSION}
2008-01-10 16:37:42 +00:00
DISTFILE?= ${DISTPREFIX}.tar.bz2
2009-01-12 23:12:06 +00:00
CLEANFILES+= ${NAME}-*.tar.bz2
CHANGELOG_LIMIT?= --after="1 year ago"
2009-01-12 23:12:06 +00:00
_SNAP_SH= date -u +%Y%m%d%H%M
_SNAP:= $(shell ${_SNAP_SH})
SNAP= ${_SNAP}
2009-01-12 23:12:06 +00:00
SNAPDIR= ${DISTPREFIX}-${SNAP}
SNAPFILE= ${SNAPDIR}.tar.bz2
2008-01-10 16:37:42 +00:00
changelog:
2015-02-18 12:46:51 -06:00
git log ${CHANGELOG_LIMIT} --format=full > ChangeLog
2008-01-10 16:37:42 +00:00
dist:
2009-04-30 15:05:39 +01:00
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
2009-01-12 23:12:06 +00:00
distcheck: dist
rm -rf ${DISTPREFIX}
tar xf ${DISTFILE}
MAKEFLAGS= $(MAKE) -C ${DISTPREFIX}
MAKEFLAGS= $(MAKE) -C ${DISTPREFIX} check
rm -rf ${DISTPREFIX}
2009-01-12 23:12:06 +00:00
snapshot:
rm -rf /tmp/${SNAPDIR}
mkdir /tmp/${SNAPDIR}
cp -RPp * /tmp/${SNAPDIR}
(cd /tmp/${SNAPDIR}; make clean)
rm -rf /tmp/${SNAPDIR}/.git 2>/dev/null || true
2009-01-12 23:12:06 +00:00
tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR}
rm -rf /tmp/${SNAPDIR}
ls -l ${SNAPFILE}
snap: snapshot