Files
OpenSceneGraph/Make/makeinnosetup
2003-06-27 21:41:00 +00:00

109 lines
1.8 KiB
Bash

#!/bin/sh
print_header()
{
cat <<- EOF
[Setup]
AppName=Open Scene Graph
AppVerName=Open Scene Graph `make -s version`
AppPublisher=OpenSceneGraph
AppPublisherURL=http://www.openscenegraph.com
AppSupportURL=http://www.openscenegraph.com
AppUpdatesURL=http://www.openscenegraph.com
DefaultDirName={pf}\OpenSceneGraph
DisableDirPage=yes
DefaultGroupName=OpenSceneGraph
DisableProgramGroupPage=yes
LicenseFile=COPYING.txt
EOF
}
# Usage:
# do_dir $DIR
#
do_dir()
{
DIR=$1
DOS_DIR=`echo $DIR | sed 's/\\//\\\/g'`
for f in `find $DIR -type f -print | grep -v CVS`
do
FILE=`basename $f`
printf "Source: \"%s\\\%s\"; DestDir: \"{app}\\\%s\\\"; CopyMode: alwaysoverwrite\n"\
$DOS_DIR $FILE $DOS_DIR
done
}
print_files()
{
echo "[Files]"
do_dir lib
do_dir bin
for dir in `ls -1 include| grep -v CVS`
do
do_dir "include/$dir"
done
}
BUILD_ISS=1
BUILD_DISTRIBUTION=1
CLEAN_UP=1
while [ $# -gt 0 ]
do
case $1 in
-c )
BUILD_ISS=0
BUILD_DISTRIBUTION=0
CLEAN_UP=1
;;
-s )
BUILD_ISS=1
BUILD_DISTRIBUTION=0
CLEAN_UP=0
;;
esac
shift;
done
if [ $BUILD_ISS = 1 ]
then
echo Building Inno Setup script ....
rm -f osg.iss
print_header >> osg.iss
print_files >> osg.iss
fi
if [ $BUILD_DISTRIBUTION = 1 ]
then
echo Building distribution ...
OS=`uname | cut -b1-6`
if [ "$OS" = "Cygwin" ]
then
C:/Program\ Files/Inno\ Setup\ 3/iscc.exe osg.iss
[ -d dist/Win32 ] || mkdir -p dist/Win32
mv Output/setup.exe dist/Win32/OpenSceneGraph_setup.exe
rm -rf Output
else
echo " Distribution may only be built under Cygwin with Inno Setup"
fi
fi
if [ $CLEAN_UP = 1 ]
then
echo Cleaning up...
rm -f osg.iss
fi