contrib/wesnoth/pre-install

46 lines
1.4 KiB
Plaintext
Raw Normal View History

2008-04-06 08:44:42 +02:00
#!/usr/bin/env sh
. /etc/pkgmk.conf
. Pkgfile
2008-05-08 10:56:51 +02:00
OLD_VERSION='1.4.1'
2008-04-06 08:44:42 +02:00
[ -z "$PKGMK_WORK_DIR" ] && PKGMK_WORK_DIR="$PWD/work"
[ -z "$PKGMK_SOURCE_DIR" ] && PKGMK_SOURCE_DIR="$PWD"
2008-05-08 10:56:51 +02:00
if [ -e "$PKGMK_SOURCE_DIR/wesnoth-$version.tar.bz2" ]; then
2008-04-06 08:44:42 +02:00
echo 'you have the lateist source file'
exit 0
fi
2008-05-08 10:56:51 +02:00
if [ -n "`pkginfo -i | egrep '^xdelta '`" ]; then
if [ -e "$PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar.bz2" ]; then
2008-04-06 08:44:42 +02:00
2008-05-08 10:56:51 +02:00
if [ ! -e "$PKGMK_WORK_DIR" ]; then
mkdir -p "$PKGMK_WORK_DIR"
fi
cd "$PKGMK_WORK_DIR"
2008-04-06 08:44:42 +02:00
2008-05-08 10:56:51 +02:00
if [ ! -e "$PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta" ]; then
wget http://optusnet.dl.sourceforge.net/sourceforge/wesnoth/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta --directory-prefix=$PKGMK_SOURCE_DIR
fi
2008-04-06 08:44:42 +02:00
2008-05-08 10:56:51 +02:00
cp $PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar.bz2 .
cp $PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta .
bzip2 -d wesnoth-$OLD_VERSION.tar.bz2
2008-04-06 08:44:42 +02:00
echo 'patching, this may take some time'
2008-05-08 10:56:51 +02:00
xdelta patch wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta
rm wesnoth-$OLD_VERSION.tar
mv wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta $PKGMK_SOURCE_DIR/
2008-04-06 08:44:42 +02:00
echo 'recompressing patched source'
2008-05-08 10:56:51 +02:00
bzip2 -9 wesnoth-$version.tar
mv wesnoth-$version.tar.bz2 $PKGMK_SOURCE_DIR/
2008-04-06 08:44:42 +02:00
else
2008-05-08 10:56:51 +02:00
echo "wesnoth-$OLD_VERSION.tar.bz2 not found proceed to run Pkgfile."
2008-04-06 08:44:42 +02:00
exit 0
fi
else
echo 'No xdelta installed can not do a incremental update'
fi
# End of file