2013-01-11 01:47:49 +00:00
|
|
|
#! /bin/bash
|
2007-03-07 14:28:51 +00:00
|
|
|
|
|
|
|
. ~/.bash_profile
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PATH=/usr/local/bin:$PATH
|
2010-12-24 00:51:07 +00:00
|
|
|
RELEASE=~/release
|
2010-12-24 01:41:09 +00:00
|
|
|
export QFSMP=${QFSMP--j4}
|
2007-03-07 14:28:51 +00:00
|
|
|
|
2007-03-08 13:54:56 +00:00
|
|
|
pref=`dirname $0`
|
2007-03-07 14:28:51 +00:00
|
|
|
if test $# -lt 1; then
|
2007-03-08 13:54:56 +00:00
|
|
|
echo 'Usage: $0 <version> [targets]'
|
2007-03-07 14:28:51 +00:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2013-01-11 01:47:49 +00:00
|
|
|
tag_name="$1"
|
2010-12-24 00:51:07 +00:00
|
|
|
shift
|
2013-01-11 01:47:49 +00:00
|
|
|
if test "$tag_name" = "current"; then
|
2010-12-24 00:51:07 +00:00
|
|
|
tag_name=master
|
2007-03-08 13:54:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
do_rpm=0
|
|
|
|
do_deb=0
|
|
|
|
do_win32=0
|
|
|
|
no_rm=0
|
2007-03-07 14:28:51 +00:00
|
|
|
|
|
|
|
if test $# -ne 0; then
|
|
|
|
while test $# -ne 0; do
|
|
|
|
case $1 in
|
|
|
|
rpm)
|
|
|
|
do_rpm=1
|
|
|
|
;;
|
|
|
|
deb)
|
|
|
|
do_deb=1
|
|
|
|
;;
|
|
|
|
win32)
|
|
|
|
do_win32=1
|
|
|
|
;;
|
2007-03-08 13:54:56 +00:00
|
|
|
norm)
|
|
|
|
no_rm=1
|
|
|
|
;;
|
2007-03-07 14:28:51 +00:00
|
|
|
*)
|
|
|
|
echo 'Unknown target'
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
else
|
|
|
|
do_rpm=1
|
|
|
|
do_deb=1
|
|
|
|
do_win32=1
|
|
|
|
fi
|
|
|
|
|
2010-12-24 00:51:07 +00:00
|
|
|
git_url=${git_url:-git://git.quakeforge.net/gitroot/quake/quakeforge}
|
2007-03-08 13:54:56 +00:00
|
|
|
|
2010-12-24 00:51:07 +00:00
|
|
|
mkdir -p $RELEASE
|
|
|
|
cd $RELEASE
|
2007-03-08 13:54:56 +00:00
|
|
|
if test $no_rm -ne 1; then
|
2012-07-17 08:21:56 +00:00
|
|
|
rm -rf NEWS io_mesh_qfmdl-* quakeforge-* qfcc-* quakeforge_* qfcc_*
|
2007-03-08 13:54:56 +00:00
|
|
|
fi
|
2010-12-24 00:51:07 +00:00
|
|
|
git clone $git_url || true
|
2013-01-11 01:47:49 +00:00
|
|
|
ver=`(cd quakeforge; config.d/git-version-gen --prefix '' .tarball-version)`
|
2010-12-24 00:51:07 +00:00
|
|
|
mv quakeforge quakeforge-$ver
|
2007-03-07 14:28:51 +00:00
|
|
|
cd quakeforge-$ver
|
2010-12-24 00:51:07 +00:00
|
|
|
git checkout $tag_name
|
|
|
|
cp NEWS $RELEASE
|
2012-07-17 08:30:16 +00:00
|
|
|
cd tools
|
|
|
|
zip -r ../../io_mesh_qfmdl-$ver.zip io_mesh_qfmdl
|
|
|
|
tar zcvf ../../io_mesh_qfmdl-$ver.tar.gz io_mesh_qfmdl
|
|
|
|
tar jcvf ../../io_mesh_qfmdl-$ver.tar.bz2 io_mesh_qfmdl
|
|
|
|
cd ..
|
2007-03-08 13:54:56 +00:00
|
|
|
mkdir -p linux.o qf-win32.o
|
2007-03-07 14:28:51 +00:00
|
|
|
./bootstrap
|
|
|
|
#begin linux
|
|
|
|
cd linux.o
|
|
|
|
../configure -C --without-clients --with-servers=master
|
|
|
|
make dist-all-local
|
|
|
|
if test $do_rpm -eq 1; then
|
|
|
|
cd RPM
|
|
|
|
make rpm
|
2010-12-24 00:51:07 +00:00
|
|
|
mv *.rpm $RELEASE
|
2007-03-07 14:28:51 +00:00
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
if test $do_deb -eq 1; then
|
|
|
|
DIR=`basename quakeforge-*.tar.gz .tar.gz`
|
|
|
|
cd debian
|
|
|
|
rm -rf $DIR
|
|
|
|
tar zxvf ../${DIR}.tar.gz
|
|
|
|
cd $DIR
|
2010-12-24 01:41:09 +00:00
|
|
|
dpkg-buildpackage -rfakeroot -us -uc
|
2007-03-07 14:28:51 +00:00
|
|
|
rm -rf $DIR
|
|
|
|
cd ..
|
2010-12-24 00:51:07 +00:00
|
|
|
mv q*.[a-z]* $RELEASE
|
2007-03-07 14:28:51 +00:00
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
#make dist-all-local
|
2010-12-24 00:51:07 +00:00
|
|
|
mv *.tar.gz *.tar.bz2 *.zip $RELEASE
|
2007-03-07 14:28:51 +00:00
|
|
|
cd ..
|
|
|
|
# end linux
|
|
|
|
if test $do_win32 -eq 1; then
|
|
|
|
cd qf-win32.o
|
|
|
|
qf_win32="quakeforge-$ver-win32"
|
|
|
|
qf_win32_dir=`pwd`"/$qf_win32"
|
2013-01-23 02:59:54 +00:00
|
|
|
qf_win64="quakeforge-$ver-win64"
|
|
|
|
qf_win64_dir=`pwd`"/$qf_win64"
|
2007-03-07 14:28:51 +00:00
|
|
|
rm -rf $qf_win32_dir *.zip
|
2013-01-23 02:59:54 +00:00
|
|
|
rm -rf $qf_win64_dir *.zip
|
2012-11-29 02:39:58 +00:00
|
|
|
../tools/cross/mingw/cross-configure.sh \
|
|
|
|
--disable-debug \
|
2007-03-08 13:54:56 +00:00
|
|
|
--program-prefix=
|
2013-01-23 02:59:54 +00:00
|
|
|
../tools/cross/mingw64/cross-configure.sh \
|
|
|
|
--disable-debug \
|
|
|
|
--program-prefix=
|
2012-02-08 12:06:39 +00:00
|
|
|
../tools/cross/mingw/cross-make.sh $QFSMP \
|
2007-03-08 13:54:56 +00:00
|
|
|
prefix=${qf_win32_dir} \
|
|
|
|
exec_prefix=${qf_win32_dir} \
|
2011-09-11 08:13:20 +00:00
|
|
|
pkgdatadir=${qf_win32_dir}/QF \
|
2010-12-24 01:41:09 +00:00
|
|
|
man1dir=${qf_win32_dir} \
|
2010-12-24 00:51:07 +00:00
|
|
|
install
|
2013-01-23 02:59:54 +00:00
|
|
|
../tools/cross/mingw64/cross-make.sh $QFSMP \
|
|
|
|
prefix=${qf_win64_dir} \
|
|
|
|
exec_prefix=${qf_win64_dir} \
|
|
|
|
pkgdatadir=${qf_win64_dir}/QF \
|
|
|
|
man1dir=${qf_win64_dir} \
|
|
|
|
install
|
|
|
|
mkdir -p ${qf_win32_dir}/pkgconfig ${qf_win64_dir}/pkgconfig
|
2012-07-13 09:14:50 +00:00
|
|
|
mv ${qf_win32_dir}/QF/*.pc ${qf_win32_dir}/pkgconfig
|
2013-01-23 02:59:54 +00:00
|
|
|
mv ${qf_win64_dir}/QF/*.pc ${qf_win64_dir}/pkgconfig
|
2013-01-23 13:09:54 +00:00
|
|
|
eval `grep MINGW= ../tools/cross/mingw/cross-configure.sh`
|
|
|
|
$MINGW/usr/bin/i686-pc-mingw32-strip --strip-unneeded "$qf_win32"/bin/*.exe
|
|
|
|
$MINGW/usr/bin/x86_64-w64-mingw32-strip --strip-unneeded "$qf_win64"/bin/*.exe
|
2010-12-24 00:51:07 +00:00
|
|
|
../tools/build_scripts/qf-win32.py "$ver-win32" quakeforge "$qf_win32"
|
2013-01-23 02:59:54 +00:00
|
|
|
../tools/build_scripts/qf-win32.py "$ver-win64" quakeforge "$qf_win64"
|
2010-12-24 00:51:07 +00:00
|
|
|
mv *.zip $RELEASE
|
2007-03-07 14:28:51 +00:00
|
|
|
cd ..
|
|
|
|
fi
|