From: Frédéric Marchal Date: Tue, 1 Nov 2011 07:57:37 +0000 (+0000) Subject: Add a script to prepare the archive to distribute X-Git-Tag: v2.3.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6937c365d6ed0ec69af0a4f15eeb4511ea8e5235;p=thirdparty%2Fsarg.git Add a script to prepare the archive to distribute The shell script builds a list of the files to include in the archive, build the archive and compute the checksums. --- diff --git a/distribute.sh b/distribute.sh new file mode 100755 index 0000000..b9cecee --- /dev/null +++ b/distribute.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +Sources="." +Target=".." + +Version=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p') +if [ -z "$Version" ] ; then + echo "No version found" + exit 1 +fi +Revision=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p') +if [ -z "$Revision" ] ; then + echo "No revision found" + exit 1 +fi +Version="$Version.$Revision" + +VersionCheck=$(cat "$Sources/configure.in" | sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p') +if [ "x$Version" != "x$VersionCheck" ] ; then + echo "CMakeLists and configure doesn't refer to the same version" + exit 1 +fi + +SargList="$Target/sarglist.txt.unsort" +SortList="$Target/sarglist.txt" +ExcludeList="$Target/sargexclude.txt" +CompressFile="$Target/sarg-$Version.tar.gz" + +SedSources=$(echo "$Sources" | sed -e 's/\./\\./') +ls $Sources/*.c | sed -e "s/^$SedSources\///" > $SargList +ls $Sources/include/*.h | sed -e "s/^$SedSources\///" >> $SargList +ls $Sources/po/*.{po,gmo,pot} | sed -e "s/^$SedSources\///" >> $SargList + +echo " +config.h +aclocal.m4 +BETA-TESTERS +ChangeLog +CMakeLists.txt +configure +configure.in +CONTRIBUTORS +COPYING +css.tpl +DONATIONS +Doxyfile +exclude_codes +htaccess +LICENSE +Makefile.in +README +README_cmake +sarg.1 +sarg.conf +user_limit_block +cfgaux +documentation +fonts +images +include/config.h.in +sarg-php +po/remove-potcdate.sin +po/Makefile.in.in +po/POTFILES.in +po/quot.sed +po/Rules-quot +po/insert-header.sin +po/ChangeLog +po/LINGUAS +po/en@quot.header +po/en@boldquot.header +po/boldquot.sed +po/Makevars +sorttable/sorttable.js +" >> $SargList + +sort $SargList > $SortList +rm $SargList + +echo " +*/.svn +*/.git +*~ +*.o +.gitignore +" > "$ExcludeList" + +tar zcf "$CompressFile" -C "$Sources" --files-from="$SortList" --exclude-from="$ExcludeList" --transform="s,^,sarg-$Version/," --owner root --group root --mode 644 + +md5sum $CompressFile > "$Target/sarg-$Version.md5sum" +echo "md5sum:" +cat "$Target/sarg-$Version.md5sum" + +sha1sum $CompressFile > "$Target/sarg-$Version.sha1sum" +echo "sha1sum:" +cat "$Target/sarg-$Version.sha1sum" + +sha256sum $CompressFile > "$Target/sarg-$Version.sha256sum" +echo "sha256sum:" +cat "$Target/sarg-$Version.sha256sum"