2003-06-28 05:01:18 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2003-06-29 01:35:17 +08:00
|
|
|
VERSION=`make -s version`
|
2003-06-28 05:01:18 +08:00
|
|
|
|
|
|
|
print_header()
|
|
|
|
{
|
|
|
|
cat <<- EOF
|
|
|
|
[Setup]
|
|
|
|
AppName=Open Scene Graph
|
2003-06-29 01:35:17 +08:00
|
|
|
AppVerName=Open Scene Graph $VERSION
|
2003-06-28 05:01:18 +08:00
|
|
|
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
|
2003-06-29 01:35:17 +08:00
|
|
|
LicenseFile=LICENSE.txt
|
2003-06-28 05:01:18 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
# Usage:
|
2003-06-28 05:41:00 +08:00
|
|
|
# do_dir $DIR
|
2003-06-28 05:01:18 +08:00
|
|
|
#
|
2003-06-29 01:35:17 +08:00
|
|
|
|
|
|
|
print_file_entry()
|
|
|
|
{
|
|
|
|
DIR=$1
|
|
|
|
FILE=$2
|
|
|
|
printf "Source: \"%s\\\%s\"; DestDir: \"{app}\\\%s\\\"; Flags: ignoreversion\n"\
|
|
|
|
$DIR $FILE $DIR
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-06-28 05:01:18 +08:00
|
|
|
do_dir()
|
|
|
|
{
|
2003-06-28 05:41:00 +08:00
|
|
|
DIR=$1
|
2003-06-29 01:35:17 +08:00
|
|
|
shift;
|
|
|
|
|
2003-06-28 05:01:18 +08:00
|
|
|
DOS_DIR=`echo $DIR | sed 's/\\//\\\/g'`
|
|
|
|
|
2003-06-29 01:35:17 +08:00
|
|
|
if [ $# -gt 0 ]
|
|
|
|
then
|
|
|
|
while [ $# -gt 0 ]
|
|
|
|
do
|
|
|
|
match=$1
|
|
|
|
shift;
|
|
|
|
for f in `find $DIR -type f | \
|
|
|
|
grep -v CVS | \
|
|
|
|
grep osg |
|
|
|
|
grep "$match"`
|
|
|
|
do
|
|
|
|
print_file_entry $DOS_DIR `basename $f`
|
|
|
|
done
|
|
|
|
done
|
|
|
|
else
|
|
|
|
for f in `find $DIR -type f | grep -v CVS | grep osg`
|
|
|
|
do
|
|
|
|
print_file_entry $DOS_DIR `basename $f`
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
2003-06-28 05:01:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
print_files()
|
|
|
|
{
|
|
|
|
echo "[Files]"
|
|
|
|
|
2003-06-29 01:35:17 +08:00
|
|
|
do_dir lib .lib
|
|
|
|
do_dir bin .exe .dll
|
|
|
|
for dir in `ls -1 include | grep osg | grep -v CVS`
|
2003-06-28 05:01:18 +08:00
|
|
|
do
|
2003-06-29 01:35:17 +08:00
|
|
|
do_dir include/"$dir"
|
2003-06-28 05:01:18 +08:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2003-06-29 01:35:17 +08:00
|
|
|
print_script()
|
|
|
|
{
|
|
|
|
print_header
|
|
|
|
print_files
|
|
|
|
}
|
2003-06-28 05:01:18 +08:00
|
|
|
|
2003-06-28 05:41:00 +08:00
|
|
|
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
|
|
|
|
;;
|
|
|
|
|
2003-06-29 01:35:17 +08:00
|
|
|
-d )
|
|
|
|
BUILD_ISS=0
|
|
|
|
BUILD_DISTRIBUTION=1
|
|
|
|
CLEAN_UP=0
|
|
|
|
;;
|
|
|
|
|
|
|
|
-n )
|
|
|
|
CLEAN_UP=0
|
|
|
|
;;
|
|
|
|
|
2003-06-28 05:41:00 +08:00
|
|
|
-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
|
2003-06-29 01:35:17 +08:00
|
|
|
|
|
|
|
print_script | awk '{ printf "%s\r\n", $0 }' > osg.iss
|
2003-06-28 05:41:00 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $BUILD_DISTRIBUTION = 1 ]
|
|
|
|
then
|
|
|
|
echo Building distribution ...
|
|
|
|
OS=`uname | cut -b1-6`
|
2003-06-29 01:35:17 +08:00
|
|
|
|
|
|
|
if [ "$OS" = "CYGWIN" ]
|
2003-06-28 05:41:00 +08:00
|
|
|
then
|
|
|
|
C:/Program\ Files/Inno\ Setup\ 3/iscc.exe osg.iss
|
|
|
|
[ -d dist/Win32 ] || mkdir -p dist/Win32
|
2003-06-29 01:35:17 +08:00
|
|
|
mv Output/setup.exe dist/Win32/OpenSceneGraph_"$VERSION"_setup.exe
|
2003-06-28 05:41:00 +08:00
|
|
|
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
|
2003-06-28 05:01:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|