- Rewrote script to be more clear about the used locations.
This commit is contained in:
parent
c90ac432a5
commit
e1d0e0f273
75
dist/gitdist.sh
vendored
75
dist/gitdist.sh
vendored
@ -24,38 +24,45 @@ echo $CURDIR
|
|||||||
ARCH="w32"
|
ARCH="w32"
|
||||||
TAG="test"
|
TAG="test"
|
||||||
|
|
||||||
DOCDIR=doc/manual
|
# Note without extension, this will added later
|
||||||
MANUAL=scyther-manual.pdf
|
|
||||||
|
|
||||||
DNAM="scyther-$TAG"
|
|
||||||
TMPDIR="/tmp"
|
|
||||||
RESDIR="$TMPDIR/$DNAM"
|
|
||||||
rm -rf $RESDIR
|
|
||||||
|
|
||||||
DESTDIR=$CURDIR
|
|
||||||
|
|
||||||
# Where is it going to? Note without extension, this will added later
|
|
||||||
ARCHNAME=scyther-$ARCH-$TAG
|
ARCHNAME=scyther-$ARCH-$TAG
|
||||||
|
|
||||||
|
# Directory locations
|
||||||
|
DESTDIR=$CURDIR
|
||||||
|
TMPDIR="/tmp"
|
||||||
|
SRCNAME=$ARCHNAME-src
|
||||||
|
|
||||||
|
# Hard coded connections, do not change this (hardcoded in git-archive
|
||||||
|
# usage and archive creation)
|
||||||
|
SRCDIR=$TMPDIR/$SRCNAME
|
||||||
|
BUILDDIR=$TMPDIR/$ARCHNAME
|
||||||
|
|
||||||
|
# Archive destination file without extension
|
||||||
DESTFILE=$DESTDIR/$ARCHNAME
|
DESTFILE=$DESTDIR/$ARCHNAME
|
||||||
|
|
||||||
|
# Internal locations
|
||||||
|
DOCDIR=$SRCDIR/doc/manual
|
||||||
|
MANUAL=scyther-manual.pdf
|
||||||
|
|
||||||
cd .. && git-archive --format=tar --prefix=$DNAM/ $TAG | (cd $TMPDIR && tar xf -)
|
rm -rf $SRCDIR
|
||||||
|
rm -rf $BUILDDIR
|
||||||
|
|
||||||
ls $RESDIR
|
# Change into the lower directory (main archive dir)
|
||||||
|
cd .. && git-archive --format=tar --prefix=$SRCNAME/ $TAG | (cd $TMPDIR && tar xf -)
|
||||||
|
|
||||||
# Windows binary
|
# Base of the package is the gui directory
|
||||||
cd $RESDIR/src
|
mv $SRCDIR/gui $BUILDDIR
|
||||||
|
|
||||||
# Where is stuff going to
|
|
||||||
DESTDIR=$RESDIR/gui
|
|
||||||
|
|
||||||
# Prepare version.h with the correct flag (tag)
|
# Prepare version.h with the correct flag (tag)
|
||||||
echo "#define SVNVERSION \"Unknown\"" >$RESDIR/src/version.h
|
echo "#define SVNVERSION \"Unknown\"" >$SRCDIR/src/version.h
|
||||||
echo "#define TAGVERSION \"$TAG\"" >>$RESDIR/src/version.h
|
echo "#define TAGVERSION \"$TAG\"" >>$SRCDIR/src/version.h
|
||||||
echo "" >>$RESDIR/src/version.h
|
echo "" >>$SRCDIR/src/version.h
|
||||||
|
|
||||||
# Manual
|
# Manual
|
||||||
cp $RESDIR/$DOCDIR/$MANUAL $DESTDIR
|
cp $DOCDIR/$MANUAL $BUILDDIR
|
||||||
|
|
||||||
|
# Change into sources directory
|
||||||
|
cd $SRCDIR/src
|
||||||
|
|
||||||
# Default flags
|
# Default flags
|
||||||
CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release"
|
CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release"
|
||||||
@ -81,33 +88,29 @@ else
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BINDIR=$RESDIR/gui/Scyther/Bin
|
# Copy the resulting binary to the correct location
|
||||||
|
BINDIR=$BUILDDIR/Scyther/Bin
|
||||||
mkdir $BINDIR
|
mkdir $BINDIR
|
||||||
cp $BIN $BINDIR
|
cp $BIN $BINDIR
|
||||||
|
|
||||||
# Prepare tag for gui version
|
# Prepare tag for gui version
|
||||||
echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$DESTDIR/Gui/Version.py
|
echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$BUILDDIR/Gui/Version.py
|
||||||
|
|
||||||
# Make archive out of the result
|
# Compress the whole thing into an archive
|
||||||
WORKNAME="scyther-$TAG"
|
cd $TMPDIR
|
||||||
cd $RESDIR
|
|
||||||
mv gui $WORKNAME
|
|
||||||
|
|
||||||
# Compress the result into an archive
|
|
||||||
if [ $ARCH = "w32" ]
|
if [ $ARCH = "w32" ]
|
||||||
then
|
then
|
||||||
DESTARCH=$DESTFILE.zip
|
DESTARCH=$DESTFILE.zip
|
||||||
rm -f $DESTARCH
|
rm -f $DESTARCH
|
||||||
zip -r $DESTARCH $WORKNAME
|
zip -r $DESTARCH $ARCHNAME
|
||||||
|
else
|
||||||
elif [ $ARCH = "linux" || $ARCH = "mac" ]
|
|
||||||
then
|
|
||||||
DESTARCH=$DESTFILE.tgz
|
DESTARCH=$DESTFILE.tgz
|
||||||
rm -f $DESTARCH
|
rm -f $DESTARCH
|
||||||
tar zcvf $DESTARCH $WORKNAME
|
tar zcvf $DESTARCH $ARCHNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove the temporary working directory
|
# Remove the temporary working directory
|
||||||
rm -rf $RESDIR
|
rm -rf $BUILDDIR
|
||||||
|
rm -rf $SRCDIR
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user