2008-09-23 11:12:19 +02:00
|
|
|
DIR = \
|
|
|
|
`basename ${PWD}`
|
2008-10-03 14:43:27 +02:00
|
|
|
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
|
2008-10-03 14:43:27 +02:00
|
|
|
find src | cpio -pvdum proto
|
2008-10-20 00:23:38 +02:00
|
|
|
# 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.
|
2008-10-03 14:43:27 +02:00
|
|
|
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
|
|
|
|
|
2008-10-03 14:43:27 +02:00
|
|
|
dist: clean
|
2008-10-20 00:23:38 +02:00
|
|
|
# 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
|
2008-10-20 00:23:38 +02:00
|
|
|
|
|
|
|
# drop our saved method script back where we left it
|
|
|
|
cp zfs-auto-snapshot.src src/lib/svc/method/zfs-auto-snapshot
|