#!/bin/sh # Select or add appropriate values for the tools and options in this section # tools # gpg/pgp GPG_CMD=gpg GPG_OPTS="--armor --detach-sign" # find FIND=find #FIND=c:/cygwin/bin/find # md5 # Use this line for linux MD5_CMD=md5sum # Use these two lines for http://www.fourmilab.ch/md5/ #MD5_CMD=md5 #MD5_OPTS="-l -n" # Verify that there is a directory parameter if [ $# -eq 0 ] then echo Missing parameter. echo Usage: \"sign-directory directory-name\" exit 1 fi if [ -d $1 ] then echo Signing files in directory \"$1\". else echo \"$1\" is not a directory. echo Usage: \"sign-directory directory-name\" exit 1 fi # Iterate the directory looking for instances of .pom, .jar, .gz, and .zip poms=`$FIND $1 -name "*.pom"` echo Found .poms $poms jars=`$FIND $1 -name "*.jar"` echo Found .jars $jars gzs=`$FIND $1 -name "*.gz"` echo Found .gzs $gzs zips=`$FIND $1 -name "*.zip"` echo Found .zips $zips echo echo `echo $gzs $poms $jars $zips | wc -w` files to sign echo # For each such file, sign it and attach an md5 for f in $gzs $poms $jars $zips do echo Signing file $f ${GPG_CMD} ${GPG_OPTS} $f ${MD5_CMD} ${MD5_OPTS} $f > $f.md5 done