wesnoth/utils/slacknoth
2007-02-07 18:10:07 +00:00

52 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
if [ "$3" = "" ]
then
echo "slacknoth v0.2 - Creates a Wesnoth package for Slackware Linux"
echo "- by Skovbaer (Mark Michelsen)"
echo ""
echo "Usage: slacknoth [version tag] [architecture e.g. i386 or athlon]"
echo " [wesnoth root e.g. /usr/games/src/wesnoth]"
echo ""
exit 0;
fi
cd $3
mkdir -p /wesnothpack/wesnoth-$1
echo "Configuring..."
./autogen.sh
./configure --prefix=/usr --enable-server --enable-tools
make clean
echo "Compiling and gathering package contents..."
make DESTDIR=/wesnothpack/wesnoth-$1 CXXFLAGS="-g -O2 -fno-omit-frame-pointer -march=$2" install -i -k
mkdir -p /wesnothpack/wesnoth-$1/usr/doc/wesnoth-$1
cp -Rf changelog COPYING copyright INSTALL MANUAL* README /wesnothpack/wesnoth-$1/usr/doc/wesnoth-$1
echo "Cleaning up source..."
make clean
cd /wesnothpack/wesnoth-$1
echo "Stripping binaries..."
strip usr/bin/*
echo "Adding package info..."
mkdir install
echo wesnoth: Battle for Wesnoth $1 > install/slack-desc
echo wesnoth: Copyright \(C\) 2003-`date +%Y` by David White \<davidnwhite@verizon.net\> >> install/slack-desc
echo wesnoth: http://www.wesnoth.org/ >> install/slack-desc
echo wesnoth: Made with Slacknoth: Mark Michelsen \<skovbaer@femgramskovbaerte.dk\> >> install/slack-desc
echo wesnoth: >> install/slack-desc
echo wesnoth: Battle for Wesnoth is a fantasy turn-based strategy game. >> install/slack-desc
echo wesnoth: Battle for control of villages, using a variety of units which have >> install/slack-desc
echo wesnoth: advantages and disadvantages in different types of terrains and >> install/slack-desc
echo wesnoth: against different types of attacks. Units gain experience and advance >> install/slack-desc
echo wesnoth: levels, and are carried over from one scenario to the next campaign. >> install/slack-desc
echo wesnoth: >> install/slack-desc
echo "Building package..."
tar cf wesnoth-$1-$2-1.tar .
gzip -9 wesnoth-$1-$2-1.tar
mv -f wesnoth-$1-$2-1.tar.gz wesnoth-$1-$2-1.tgz
echo "Moving package to $3 ..."
mv -f wesnoth-$1-$2-1.tgz $3
cd $3
echo "Removing temporary directory..."
rm -Rf /wesnothpack
echo "And that's it, we're done!"
echo "If everything went all right, you should have the package"
echo "$3/wesnoth-$1-$2-1.tgz"