summaryrefslogtreecommitdiff
path: root/wesnoth/pre-install
blob: ce21f79e94c84897058ea2306024a58297507ccc (plain)
    1 #!/usr/bin/env sh
    2 
    3 . /etc/pkgmk.conf
    4 . Pkgfile
    5 OLD_VERSION='1.4.2'
    6 
    7 [ -z "$PKGMK_WORK_DIR" ] && PKGMK_WORK_DIR="$PWD/work"
    8 [ -z "$PKGMK_SOURCE_DIR" ] && PKGMK_SOURCE_DIR="$PWD"
    9 
   10 if [ -e "$PKGMK_SOURCE_DIR/wesnoth-$version.tar.bz2" ]; then
   11 	echo 'You have the lateist source file.'
   12 	exit 0
   13 fi
   14 
   15 if [ -n "`pkginfo -i | egrep '^xdelta '`" ]; then
   16 	if [ -e "$PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar.bz2" ]; then
   17 
   18 		if [ ! -e "$PKGMK_WORK_DIR" ]; then
   19 			mkdir -p "$PKGMK_WORK_DIR"
   20 		fi
   21 		cd "$PKGMK_WORK_DIR"
   22 
   23 		if [ ! -e "$PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta" ]; then
   24 			wget http://optusnet.dl.sourceforge.net/sourceforge/wesnoth/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta --directory-prefix=$PKGMK_SOURCE_DIR
   25 		fi
   26 
   27 		cp $PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar.bz2 .
   28 		cp $PKGMK_SOURCE_DIR/wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta .
   29 		echo -n '[ 33%] Decompressing source, '
   30 		bzip2 -d wesnoth-$OLD_VERSION.tar.bz2
   31 		echo 'done.'
   32 		echo -n '[ 66%] Patching source, '
   33 		xdelta patch wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta
   34 		rm wesnoth-$OLD_VERSION.tar
   35 		mv wesnoth-$OLD_VERSION.tar-wesnoth-$version.tar.xdelta $PKGMK_SOURCE_DIR/
   36 		echo 'done.'
   37 		echo -n '[100%] Compressing patched source, '
   38 		bzip2 -9 wesnoth-$version.tar
   39 		echo 'done.'
   40 		mv wesnoth-$version.tar.bz2 $PKGMK_SOURCE_DIR/
   41 	else
   42 		echo "'wesnoth-$OLD_VERSION.tar.bz2' not found proceed to run Pkgfile."
   43 		exit
   44 	fi
   45 else
   46 	echo "Warning: 'xdelta' is not installed can not do a incremental update."
   47 fi
   48 
   49 # End of file

Generated by cgit