#!/bin/sh umask 002 tmpdir=`pwd`/tmp/rulesdir.$$ rm -rf $tmpdir; mkdir -p $tmpdir || exit $? PERL=${PERL:-perl} RELDIR=$HOME/public_html/devel mkdir -p $RELDIR DISTNAME=Mail-SpamAssassin-rules make version.env || exit $? . ./version.env # "3.1.0-pre2-r202405" should appear as "3.1.0-pre2" after this! VERSION=`echo $FULL_VERSION | perl -pe 's/-r\d+$//'` DISTVNAME=$DISTNAME-$VERSION # remove the rules files for rules we won't be shipping rm -f rules/70_*.cf # remove new features, unsupported in existing code in the field # (TODO: need a better way to exclude files that require new features # like this; judicious use of "ifplugin" helps) # rm rules/60_somerandomfeature.cf # and ensure the ruleset lints! ./spamassassin --lint || exit $? ##make install || exit $? rulesdir=rules ( cd $rulesdir # Use this to include plugin .pm files: # tar cvf - *.cf *.pm || exit $? # or this, to ban code from the updates: tar cvf - [0-9]*.cf || exit $? ) | gzip -9 > $tmpdir/update.tgz || exit $? # ensure non-empty [ -s $tmpdir/update.tgz ] || exit 3 linttmp=$tmpdir/lintdir rm -rf $linttmp mkdir $linttmp ( cd $linttmp # check validity of tarball; also extract gunzip -cd < $tmpdir/update.tgz | tar xf - || exit $? ) # now, ensure the ruleset (entirely as distributed) lints, also. # use "-p /dev/null" so any user_prefs data is ignored. ./spamassassin --debug -x --configpath=$linttmp -p /dev/null --lint \ || exit $? # sign and get sums rm -f $tmpdir/update.*.asc if [ -d $HOME/sabuildtools/sasigningkey ]; then $HOME/sabuildtools/bin/gpg --homedir $HOME/sabuildtools/sasigningkey \ -bsa $tmpdir/update.tgz || exit $? fi $PERL build/md5sum.pl $tmpdir/update.tgz > $tmpdir/update.tgz.md5 || exit $? $PERL build/sha1sum.pl $tmpdir/update.tgz > $tmpdir/update.tgz.sha1 || exit $? for ext in tgz tgz.md5 tgz.sha1 tgz.asc ; do rm -f $RELDIR/$DISTVNAME.$ext if [ -f $tmpdir/update.$ext ] ; then mv $tmpdir/update.$ext $RELDIR/$DISTVNAME.$ext ls -l $RELDIR/$DISTVNAME.$ext fi done rm -rf $tmpdir