2007-05-19 16:36:50 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Make a new distribution archive. Command line specification of the tag
|
|
|
|
#
|
|
|
|
# For now, just windows. Others will follow.
|
|
|
|
#
|
2007-05-19 16:42:58 +01:00
|
|
|
# Usage will be:
|
|
|
|
#
|
|
|
|
# gitdist ARCH TAG
|
|
|
|
#
|
2007-05-20 12:15:27 +01:00
|
|
|
# ARCH is any of
|
|
|
|
#
|
|
|
|
# linux
|
|
|
|
# w32
|
|
|
|
# mac
|
|
|
|
#
|
|
|
|
# The tag is checked out of the current repository (so it should exist)
|
|
|
|
# and this is used to construct a archive with the binary of the
|
|
|
|
# selected architecture.
|
|
|
|
|
|
|
|
CURDIR=`pwd`
|
|
|
|
echo $CURDIR
|
|
|
|
|
|
|
|
ARCH="w32"
|
|
|
|
TAG="test"
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Note without extension, this will added later
|
|
|
|
ARCHNAME=scyther-$ARCH-$TAG
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Directory locations
|
|
|
|
DESTDIR=$CURDIR
|
2007-05-19 16:36:50 +01:00
|
|
|
TMPDIR="/tmp"
|
2007-05-20 12:43:11 +01:00
|
|
|
SRCNAME=$ARCHNAME-src
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Hard coded connections, do not change this (hardcoded in git-archive
|
|
|
|
# usage and archive creation)
|
|
|
|
SRCDIR=$TMPDIR/$SRCNAME
|
|
|
|
BUILDDIR=$TMPDIR/$ARCHNAME
|
2007-05-20 12:15:27 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Archive destination file without extension
|
2007-05-20 12:15:27 +01:00
|
|
|
DESTFILE=$DESTDIR/$ARCHNAME
|
2007-05-19 17:01:02 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Internal locations
|
|
|
|
DOCDIR=$SRCDIR/doc/manual
|
|
|
|
MANUAL=scyther-manual.pdf
|
2007-05-19 17:01:02 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
rm -rf $SRCDIR
|
|
|
|
rm -rf $BUILDDIR
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Change into the lower directory (main archive dir)
|
|
|
|
cd .. && git-archive --format=tar --prefix=$SRCNAME/ $TAG | (cd $TMPDIR && tar xf -)
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Base of the package is the gui directory
|
|
|
|
mv $SRCDIR/gui $BUILDDIR
|
2007-05-19 16:36:50 +01:00
|
|
|
|
|
|
|
# Prepare version.h with the correct flag (tag)
|
2007-05-20 12:43:11 +01:00
|
|
|
echo "#define SVNVERSION \"Unknown\"" >$SRCDIR/src/version.h
|
|
|
|
echo "#define TAGVERSION \"$TAG\"" >>$SRCDIR/src/version.h
|
|
|
|
echo "" >>$SRCDIR/src/version.h
|
2007-05-19 16:36:50 +01:00
|
|
|
|
|
|
|
# Manual
|
2007-05-20 12:43:11 +01:00
|
|
|
cp $DOCDIR/$MANUAL $BUILDDIR
|
|
|
|
|
|
|
|
# Change into sources directory
|
|
|
|
cd $SRCDIR/src
|
2007-05-19 16:36:50 +01:00
|
|
|
|
|
|
|
# Default flags
|
|
|
|
CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release"
|
2007-05-20 12:15:27 +01:00
|
|
|
if [ $ARCH = "w32" ]
|
|
|
|
then
|
|
|
|
BIN="scyther-w32.exe"
|
|
|
|
cmake $CMFLAGS -D TARGETOS=Win32 . && make
|
|
|
|
|
|
|
|
elif [ $ARCH = "linux" ]
|
|
|
|
then
|
|
|
|
BIN="scyther-linux"
|
|
|
|
cmake $CMFLAGS . && make
|
|
|
|
|
|
|
|
elif [ $ARCH = "mac" ]
|
|
|
|
then
|
|
|
|
# Make for ppc and intel, and combine into universal binary
|
|
|
|
BIN="scyther-mac"
|
|
|
|
cmake $CMFLAGS -D TARGETOS=MacPPC . && make
|
|
|
|
cmake $CMFLAGS -D TARGETOS=MacIntel . && make
|
|
|
|
cmake $CMFLAGS . && make scyther-mac
|
|
|
|
else
|
|
|
|
echo "Don't know this architecture $ARCH"
|
|
|
|
exit
|
|
|
|
fi
|
2007-05-19 16:36:50 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Copy the resulting binary to the correct location
|
|
|
|
BINDIR=$BUILDDIR/Scyther/Bin
|
2007-05-19 17:01:02 +01:00
|
|
|
mkdir $BINDIR
|
2007-05-20 12:15:27 +01:00
|
|
|
cp $BIN $BINDIR
|
2007-05-19 16:36:50 +01:00
|
|
|
|
|
|
|
# Prepare tag for gui version
|
2007-05-20 12:43:11 +01:00
|
|
|
echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$BUILDDIR/Gui/Version.py
|
2007-05-19 16:42:58 +01:00
|
|
|
|
2007-05-20 12:43:11 +01:00
|
|
|
# Compress the whole thing into an archive
|
|
|
|
cd $TMPDIR
|
2007-05-20 12:15:27 +01:00
|
|
|
if [ $ARCH = "w32" ]
|
|
|
|
then
|
|
|
|
DESTARCH=$DESTFILE.zip
|
|
|
|
rm -f $DESTARCH
|
2007-05-20 12:43:11 +01:00
|
|
|
zip -r $DESTARCH $ARCHNAME
|
|
|
|
else
|
2007-05-20 12:15:27 +01:00
|
|
|
DESTARCH=$DESTFILE.tgz
|
|
|
|
rm -f $DESTARCH
|
2007-05-20 12:43:11 +01:00
|
|
|
tar zcvf $DESTARCH $ARCHNAME
|
2007-05-20 12:15:27 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove the temporary working directory
|
2007-05-20 12:43:11 +01:00
|
|
|
rm -rf $BUILDDIR
|
|
|
|
rm -rf $SRCDIR
|
2007-05-19 16:42:58 +01:00
|
|
|
|
2007-05-19 16:36:50 +01:00
|
|
|
|