meillo@47: #!/bin/sh
meillo@47: #
meillo@47: # generate a tar.gz archive to distribute
meillo@47: # generate an md5sum and a detached signature of the archive
meillo@47: #
meillo@47: # requires:
meillo@47: # - mercurial (hg)
meillo@47: # - md5sum
meillo@47: # - gnupg
meillo@47: 
meillo@47: if [ $# -ne 1 -o -e "$1" ] ; then
meillo@60: 	echo "usage: gen-dist DEST.tar.gz" 2>&1
meillo@47: 	exit 1
meillo@47: fi
meillo@47: 
meillo@50: dir="${1%/*}"
meillo@50: file="${1##*/}"
meillo@50: 
meillo@104: hg archive -t tgz -X .hg\* "$1"
meillo@50: 
meillo@50: cd "$dir"
meillo@50: md5sum "$file" >"$file.md5sum"
meillo@50: gpg -ab "$file"