zfs-auto-snapshot/Makefile

34 lines
1.3 KiB
Makefile
Raw Normal View History

2008-09-23 11:12:19 +02:00
DIR = \
`basename ${PWD}`
ZFS_AUTO_SNAPSHOT_CHANGESET = \
`hg identify`
2008-09-23 11:12:19 +02:00
2008-06-29 19:38:39 +02:00
pkg: clean
mkdir -p proto
find src | cpio -pvdum proto
# we tag the method script during the build, which will
# only happen if we're building from the original hg source,
# not from the dist tarball - see the dist: target.
cat src/lib/svc/method/zfs-auto-snapshot | sed -e "s/~ZFS_AUTO_SNAPSHOT_CHANGESET~/${ZFS_AUTO_SNAPSHOT_CHANGESET}/g" > proto/src/lib/svc/method/zfs-auto-snapshot
pkgmk -f proto/src/prototype -p `uname -n``date +%Y%m%d%H%M%S` -d proto -r proto/src
2008-06-29 19:38:39 +02:00
clean:
rm -rf proto/*
2008-09-23 11:12:19 +02:00
if [ -d proto ] ; then \
rmdir proto ; \
fi
dist: clean
# save off a copy of the method script before tagging it
cp src/lib/svc/method/zfs-auto-snapshot zfs-auto-snapshot.src
cat src/lib/svc/method/zfs-auto-snapshot | sed -e "s/~ZFS_AUTO_SNAPSHOT_CHANGESET~/${ZFS_AUTO_SNAPSHOT_CHANGESET}/g" > src/lib/svc/method/tagged-method-script
mv src/lib/svc/method/tagged-method-script src/lib/svc/method/zfs-auto-snapshot
grep "zfs-auto-snapshot changeset" src/lib/svc/method/zfs-auto-snapshot
2008-09-23 11:12:19 +02:00
tar cf ${DIR}.tar -C .. ${DIR}/Changelog -C .. ${DIR}/Makefile \
-C .. ${DIR}/README.zfs-auto-snapshot.txt -C .. ${DIR}/src
gzip ${DIR}.tar
# drop our saved method script back where we left it
cp zfs-auto-snapshot.src src/lib/svc/method/zfs-auto-snapshot