2011-01-08 06:38:39 +08:00
|
|
|
#!/bin/sh
|
2011-01-10 06:49:52 +08:00
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
if [ "$WORKSPACE" == "" ]; then
|
|
|
|
echo "ERROR: Missing WORKSPACE environment variable."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-02-09 18:34:26 +08:00
|
|
|
VERSION=`cat flightgear/version`
|
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2012-01-18 07:32:16 +08:00
|
|
|
# remove old and create fresh build directories
|
2015-03-15 05:43:18 +08:00
|
|
|
cd $WORKSPACE
|
2012-01-18 07:32:16 +08:00
|
|
|
mkdir -p sgBuild
|
|
|
|
mkdir -p fgBuild
|
|
|
|
mkdir -p output
|
|
|
|
rm -rf output/*
|
2015-03-15 05:43:18 +08:00
|
|
|
rm -rf dist/*
|
2012-01-18 07:32:16 +08:00
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2012-01-18 07:32:16 +08:00
|
|
|
echo "Starting on SimGear"
|
|
|
|
cd sgBuild
|
2012-01-19 03:45:21 +08:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" ../simgear
|
2012-01-18 07:32:16 +08:00
|
|
|
|
|
|
|
# compile
|
2011-01-10 06:49:52 +08:00
|
|
|
make
|
|
|
|
|
|
|
|
if [ $? -ne '0' ]; then
|
|
|
|
echo "make simgear failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
make install
|
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# build source package and copy to output
|
|
|
|
make package_source
|
|
|
|
cp simgear-*.tar.bz2 ../output/.
|
|
|
|
|
2012-01-19 03:45:21 +08:00
|
|
|
#####################################################################################
|
2011-01-10 06:49:52 +08:00
|
|
|
echo "Starting on FlightGear"
|
2012-01-18 07:32:16 +08:00
|
|
|
cd ../fgBuild
|
2012-01-19 03:45:21 +08:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" ../flightgear
|
2012-01-18 06:43:12 +08:00
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# compile
|
2011-01-10 06:49:52 +08:00
|
|
|
make
|
|
|
|
|
|
|
|
if [ $? -ne '0' ]; then
|
|
|
|
echo "make flightgear failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
make install
|
2012-01-18 06:43:12 +08:00
|
|
|
|
2012-01-18 07:32:16 +08:00
|
|
|
# build source package and copy to output
|
|
|
|
make package_source
|
2012-01-18 08:08:33 +08:00
|
|
|
cp flightgear-*.tar.bz2 ../output/.
|
2012-01-18 07:32:16 +08:00
|
|
|
|
2015-01-19 07:37:19 +08:00
|
|
|
#####################################################################################
|
|
|
|
|
|
|
|
echo "Assembling base package"
|
|
|
|
cd $WORKSPACE
|
|
|
|
|
2015-08-31 23:22:08 +08:00
|
|
|
rm -rf base_package
|
|
|
|
|
|
|
|
# a: archive mode
|
|
|
|
# z: compress
|
|
|
|
# delete: 'delete extraneous files from dest dirs'; avoid bug 1344
|
|
|
|
# filter: use the rules in our rules file
|
|
|
|
|
|
|
|
echo "Copying FGData files"
|
|
|
|
rsync -a --delete \
|
|
|
|
--filter 'merge base-package.rules' \
|
|
|
|
fgdata base_package
|
2015-01-19 07:37:19 +08:00
|
|
|
|
2015-08-31 23:22:08 +08:00
|
|
|
echo "Syncing aircraft data"
|
|
|
|
rsync -a --delete --filter 'merge aircraft.rules' /home/jenkins/fgaddon-3.6.0/ extended-data
|
|
|
|
|
|
|
|
echo "Copying aircraft data"
|
|
|
|
rsync -a extended-data/ base_package/fgdata
|
|
|
|
|
|
|
|
echo "Creating tar archive"
|
|
|
|
pushd base_package
|
|
|
|
tar cjf output/FlightGear-$VERSION-data.tar.bz2 fgdata/
|
|
|
|
popd
|