package_script revision 74be0dc554ad7689e619289dcdbe2665b249884a
#!/bin/sh -e
#
# Auto building script
# for the Hets repository
#
# c.prodescu@jacobs-university.de
#
# Dependencies: hets-core dependencies, devscripts, ant
#
# VARIABLES
HETS_VERSION=0.96
HETS_REPO=https://svn-agbkb.informatik.uni-bremen.de/Hets/trunk
HETS_LIB_REPO=https://svn-agbkb.informatik.uni-bremen.de/Hets-lib/trunk
if [ -d $PWD/debian ]; then
echo Starting Hets debianize script
else
echo No \"debian\" folder found.
echo Bye.
exit
fi
#getting revision number
HETS_REVISION=`svn info $HETS_REPO | tail -n6 | head -n1 | awk '{ print $2 }'`
echo ::Revision detected: $HETS_REVISION
#setting full version
HETS_FULL_VERSION="$HETS_VERSION"r"$HETS_REVISION"
#setting folder name
HETS_FOLDER=$PWD/hets-$HETS_FULL_VERSION
echo ::Using folder $HETS_FOLDER
#checking out latest Hets version
if [ -e .svn_clean ]; then
rm .svn_clean
rm -rf $HETS_FOLDER
fi
echo ::Checking out $HETS_REPO ...
svn -q co $HETS_REPO $HETS_FOLDER
echo ::Done
#checking out latest Hets-lib
echo ::Checking out $HETS_LIB_REPO ...
svn -q co $HETS_LIB_REPO $HETS_FOLDER/hets-lib
echo ::Done
#checking out Hets-owl-tools and compiling jar files
HETS_OWL_TOOLS_FOLDER=$HETS_FOLDER/hets-owl-tools
echo ::Compiling Hets OWL Tools
cd $HETS_FOLDER && export JAVA_HOME=/usr/lib/jvm/java-6-sun
make initialize_java
cd ..
mkdir -p $HETS_FOLDER/hets-owl-tools
cd $HETS_FOLDER/OWL
cp -r tests OWL2ATerm.jar OWLFact.jar OWLFactProver.jar OWLLocality.jar owl_locality owl_parser $HETS_FOLDER/hets-owl-tools
cd ../..
mkdir -p $HETS_FOLDER/hets-owl-tools/lib
cp $HETS_FOLDER/OWL/lib/*.jar $HETS_FOLDER/hets-owl-tools/lib
echo ::Done
#copying OntoDMU and AProVE to hets-owl-tools
cp $HETS_FOLDER/CASL/Termination/AProVE.jar $HETS_FOLDER/hets-owl-tools
cp $HETS_FOLDER/DMU/OntoDMU.jar $HETS_FOLDER/hets-owl-tools
#cleaning the svn/cvs folders
echo ::Clearing svn/cvs folders
cd $HETS_FOLDER
find . -name .svn -print0 | xargs -0 rm -rf
make distclean
rm OWL/java -rf
rm programatica
cd ..
touch .svn_clean
echo ::Done
#creating orig.tar.gz
echo ::Creating orig.tar.gz archive
tar -czf hets_$HETS_FULL_VERSION.orig.tar.gz hets-$HETS_FULL_VERSION
echo ::Done
#copying debian folder
echo ::Creating debian folder
cp -rf debian $HETS_FOLDER
#modifying the changelog
echo "hets ($HETS_FULL_VERSION-1) lucid; urgency=low" > .changelog
echo >> .changelog
echo " * Initial release, automatically generated." >> .changelog
echo >> .changelog
echo " -- `cat changelog_name` <`cat changelog_email`> `date -R`" >> .changelog
#merging changelogs
mv .changelog $HETS_FOLDER/debian/changelog
echo ::Done
#building
echo ::Starting package building
cd $HETS_FOLDER
debuild -us -uc
cd ..
echo ::Done
ls