Home | History | Annotate | Download | only in zfs-snapshot
      1 DIR = \
      2 	`basename ${PWD}`
      3 ZFS_AUTO_SNAPSHOT_CHANGESET = \
      4 	`hg identify`
      5 
      6 pkg: clean
      7 	mkdir -p proto
      8 	find src | cpio -pvdum proto
      9 	# we tag the method script during the build, which will
     10 	# only happen if we're building from the original hg source,
     11 	# not from the dist tarball - see the dist: target.
     12 	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
     13 	pkgmk -f proto/src/prototype -p `uname -n``date +%Y%m%d%H%M%S` -d proto -r proto/src
     14 
     15 clean:
     16 	rm -rf proto/*
     17 	if [ -d proto ] ; then \
     18 		rmdir proto ; \
     19 	fi
     20 
     21 dist: clean
     22 	# save off a copy of the method script before tagging it
     23 	cp src/lib/svc/method/zfs-auto-snapshot zfs-auto-snapshot.src
     24 
     25 	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
     26 	mv src/lib/svc/method/tagged-method-script src/lib/svc/method/zfs-auto-snapshot
     27 	grep "zfs-auto-snapshot changeset" src/lib/svc/method/zfs-auto-snapshot
     28 	tar cf ${DIR}.tar -C .. ${DIR}/Changelog -C .. ${DIR}/Makefile \
     29 	-C .. ${DIR}/README.zfs-auto-snapshot.txt -C .. ${DIR}/src
     30 	gzip ${DIR}.tar
     31 	
     32 	# drop our saved method script back where we left it
     33 	cp zfs-auto-snapshot.src src/lib/svc/method/zfs-auto-snapshot
     34