new make-src-archive. old one was old.

This commit is contained in:
Devin J. Pohly
2012-08-12 19:05:28 -04:00
parent fbada6f17f
commit 92f2a16557
+70 -59
View File
@@ -1,69 +1,80 @@
#!/bin/bash #!/bin/sh
set -e
test -e ProductInfo.h && cd .. LINUX= MAC= WIN=
if ! test -d src; then
echo Run this script from the top directory. # Parse options
while :; do
case "$1" in
-m) MAC=1; shift;;
-w) WIN=1; shift;;
*) break;;
esac
done
# Usage message
if [ -z "$1" ]; then
echo "\
Usage: $0 [-m] [-w] REV
Generates a source tarball at \`dist/stepmania-TAG.tar.bz2'.
-m Include Mac-specific build components
-w Include Windows-specific build components\
REV can be a Mercurial revision or tag
" 1>&2
exit 1 exit 1
fi fi
source Utils/GetProductVer.sh src/ProductInfo.h # Get confirmation
PRODUCTVER="$PRODUCTVER-src" echo "WARNING! This will do a clean update of the current repository." 1>&2
echo "If you have any uncommitted changes or extra files in this repository," 1>&2
if test -e $PRODUCTVER; then echo "they will be LOST!" 1>&2
echo "\"$PRODUCTVER\" already exists." echo
read -sn1 -p "Do you want to continue [y/N]? " ISOK
if [ "$ISOK" != y -a "$ISOK" != Y ]; then
echo n
exit 1 exit 1
fi fi
echo Copying... echo y
mkdir $PRODUCTVER # Clean the source tree
cp -dpR autoconf $PRODUCTVER/ hg update -C "$1"
#cp -dpR Utils $PRODUCTVER/ hg clean --all
cp -dpR src $PRODUCTVER/
cp Docs/Copying.MAD Docs/Licenses.txt Docs/Changelog_sm5.txt \ # This replaces autogen.sh. Run now so our users don't have
Docs/Changelog_sm-ssc.txt Docs/Changelog_SSCformat.txt \ # to have autoconf and friends installed.
Docs/credits.txt Docs/KnownIssues.txt \ autoreconf -i
Docs/license-ext/readme Docs/license-ext/Scoring-jp.txt \
Docs/license-ext/theme_lang-ja.txt Docs/vlgothic/Changelog \
Docs/license-ext/vlgothic/LICENSE Docs/license-ext/vlgothic/LICENSE.en\
Docs/license-ext/vlgothic/LICENSE_E.mplus Docs/license-ext/vlgothic/LICENSE_J.mplus \
Docs/license-ext/vlgothic/README Docs/license-ext/vlgothic/README.sazanami \
Docs/license-ext/vlgothic/README_J.mplus \
Makefile.am aclocal.m4 configure Makefile.in configure.ac \
$PRODUCTVER
echo Pruning... # Tarball will be placed here
cd $PRODUCTVER/src mkdir dist
# Incomplete:
rm -rf Texture Font Generator
# Unused:
rm -rf smlobby
# Windows-only stuff. Let's leave some in the archive to make the GPL happy.
# I don't want to spend an extra half hour to upload separate Windows and
# *nix source archives.
#rm -rf mad-0.15.0b
rm -rf lua-5.1
rm -rf vorbis
rm -rf BaseClasses
rm -rf ddk
rm -rf smpackage
cd ..
find . -type d -name 'CVS' | xargs rm -rf
find . -type d -name '.svn' | xargs rm -rf
find . -type f -name '*.lib' | xargs rm -rf
find . -type f -name '*.exe' | xargs rm -rf
find . -type f -name '*.a' | xargs rm -rf
find . -type f -name '*.o' | xargs rm -rf
find . -type f -name '.hg*' | xargs rm -rf
cd ..
#rm -rf Utils/Font\ generation/
echo Archiving...
tar zchvf "$PRODUCTVER".tar.gz $PRODUCTVER/
# List excludes for tar's -X flag
{
echo './dist'
echo '*/.hg*'
echo './autoconf/m4'
echo './autogen.sh'
echo './aclocal.m4'
echo '*/*.a[mc]'
echo './_assets'
echo './Utils/Font generation'
# OSX
if [ -z "$MAC" ]; then
echo './Xcode'
fi
# Windows/misc
if [ -z "$WIN" ]; then
echo './Program'
echo './Installer'
echo './sm-ssc.nsi'
echo './Utils/doxygen'
echo './Utils/Graphviz'
echo './Utils/NSIS'
echo './src/BaseClasses'
echo './src/Texture Font Generator'
echo './src/smpackage*'
echo '*.[ao]'
echo '*.lib'
echo '*.dll'
echo '*.exe'
fi
} | tar cvjf "dist/StepMania-$1.tar.bz2" -X- . --transform "s,^\.,stepmania-$1,"