2002-04-09 22:55:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
die()
|
|
|
|
{
|
|
|
|
echo >& $1
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
x()
|
|
|
|
{
|
|
|
|
echo $*
|
|
|
|
$*
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print_pkginfo()
|
|
|
|
{
|
|
|
|
|
|
|
|
__pstamp=`fgrep $LOGNAME /etc/passwd | cut -f5 -d":"`
|
|
|
|
cat <<- EOF
|
|
|
|
PKG="$1"
|
|
|
|
NAME="$2"
|
|
|
|
`[ "$OS" = "SunOS" ] && echo ARCH=sparc`
|
2003-06-24 23:40:09 +08:00
|
|
|
VERSION=`gmake -s version`
|
2002-04-09 22:55:38 +08:00
|
|
|
CATEGORY="application,graphics,opengl"
|
|
|
|
DESC="$3"
|
|
|
|
BASEDIR="/opt/"
|
|
|
|
VENDOR="OpenSceneGraph"
|
|
|
|
EMAIL="info@openscenegraph.org"
|
|
|
|
PSTAMP=$__pstamp
|
|
|
|
URL="http://openscenegraph.org"
|
|
|
|
MAXINST="1"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
print_prototype()
|
|
|
|
{
|
|
|
|
echo "i pkginfo"
|
|
|
|
[ -f depend ] && echo "i depend"
|
|
|
|
|
|
|
|
for d in $*
|
|
|
|
do
|
|
|
|
d=`echo $d | sed 's/\/opt\///`
|
|
|
|
echo "d none $d ? root sys"
|
|
|
|
done
|
|
|
|
|
|
|
|
for d in $*
|
|
|
|
do
|
|
|
|
for f in `ls -1 $d`
|
|
|
|
do
|
|
|
|
f=$d/$f
|
|
|
|
if [ -f $f ]
|
|
|
|
then
|
|
|
|
[ -x $f ] && MODE=0555 || MODE=0444
|
|
|
|
dest=`echo $f | sed 's/\/opt\///'`
|
|
|
|
echo "f none $dest=$f $MODE root sys"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2002-04-12 14:18:41 +08:00
|
|
|
make_installable()
|
|
|
|
{
|
|
|
|
PKGNAME=$1
|
|
|
|
PKGDIR=$PKGNAME.pkg
|
2003-06-24 23:40:09 +08:00
|
|
|
DISTNAME="$PKGNAME"-"`gmake -s version`"-"$OS".shar
|
2002-04-12 14:18:41 +08:00
|
|
|
|
|
|
|
THISDIR=`pwd`
|
|
|
|
cd $PKGSUBDIR
|
|
|
|
|
|
|
|
cat << INSTALL_EOF > $DISTNAME
|
|
|
|
|
|
|
|
#!/bin/sh
|
|
|
|
cat <<- 'LEOF' | uudecode -p | gzip -d -c | tar xvf -
|
|
|
|
`tar cvf - $PKGDIR | gzip | uuencode .tmpuu`
|
|
|
|
LEOF
|
|
|
|
|
|
|
|
/bin/sh << EOF
|
|
|
|
echo =========== INSTALLING $DISTNAME =================
|
|
|
|
pkgadd -d $PKGNAME.pkg $PKGNAME
|
|
|
|
rm -rf $PKGDIR
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
INSTALL_EOF
|
|
|
|
|
|
|
|
chmod +x $DISTNAME
|
|
|
|
cd $THISDIR
|
|
|
|
}
|
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
make_package()
|
|
|
|
{
|
|
|
|
PKGNAME=$1
|
|
|
|
PKGDIR=$PKGSUBDIR/$PKGNAME.pkg
|
|
|
|
x rm -rf $PKGDIR
|
|
|
|
x mkdir $PKGDIR
|
|
|
|
|
|
|
|
echo Making pkginfo ...
|
|
|
|
print_pkginfo "$1" "$2" "$3" > $PKGDIR/pkginfo
|
|
|
|
|
|
|
|
shift; shift; shift
|
|
|
|
|
|
|
|
echo Making prototype ...
|
|
|
|
|
|
|
|
print_prototype $* > $PKGDIR/prototype
|
|
|
|
|
2002-04-12 14:18:41 +08:00
|
|
|
# DISTNAME="$PKGNAME"-"`$TOPDIR/bin/osgversion`"-"$OS"-"local"
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
THISDIR=`pwd`
|
|
|
|
x cd $PKGDIR
|
|
|
|
x pkgmk -d .
|
|
|
|
x cd $THISDIR
|
2002-04-12 14:18:41 +08:00
|
|
|
# make_installable $PKGNAME $PKGDIR $DISTNAME
|
|
|
|
# x pkgtrans -s $PKGDIR $DISTNAME $PKGNAME
|
|
|
|
# x mv "$PKGDIR"/"$DISTNAME" "$PKGDIR"/..
|
2002-04-09 22:55:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-31 14:04:21 +08:00
|
|
|
intro()
|
|
|
|
{
|
|
|
|
echo; echo;
|
|
|
|
echo "============ Building the $OS Distribution Package ==================="
|
|
|
|
echo ""
|
|
|
|
echo " Please note that this script requires that"
|
|
|
|
echo
|
|
|
|
echo " 'make install' "
|
|
|
|
echo
|
|
|
|
echo " be previously run. Please run "
|
|
|
|
echo
|
|
|
|
echo " 'make distribution' "
|
|
|
|
echo
|
|
|
|
echo " with the same arguments (if any) as 'make install'"
|
|
|
|
echo
|
|
|
|
repeat=1
|
|
|
|
while [ $repeat = 1 ]
|
|
|
|
do
|
|
|
|
printf " Continue? (y/n) [y]: "
|
|
|
|
read resp
|
|
|
|
case $resp in
|
|
|
|
""|Yes|YES|yes|Y|y) repeat=0 ;;
|
|
|
|
n|N|no|NO) return 1; repeat=0;;
|
|
|
|
*) repeat=1;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
intro || exit 0
|
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
OS=$1
|
|
|
|
TOPDIR=$2
|
|
|
|
INST_LIBS=$3
|
|
|
|
INST_PLUGINS=$4
|
|
|
|
INST_INCLUDE=$5
|
2003-03-28 02:56:23 +08:00
|
|
|
INST_EXAMPLES=$6
|
2002-04-16 12:13:30 +08:00
|
|
|
INST_SRC=$7
|
2003-03-28 02:56:23 +08:00
|
|
|
INST_EXAMPLE_SRC=$8
|
2002-04-16 12:13:30 +08:00
|
|
|
shift;shift; shift;shift; shift;shift; shift;shift;
|
|
|
|
INST_DOC=$1
|
|
|
|
INST_DATA=$2
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
PKGSUBDIR=dist/PKG
|
|
|
|
|
|
|
|
make_package\
|
|
|
|
"OpenSceneGraph" \
|
|
|
|
"Open Scene Graph - Run-time environment"\
|
2003-03-28 02:56:23 +08:00
|
|
|
"An OpenGL based scene graph. This installation includes a set of run-time libraries, and example programs"\
|
|
|
|
$INST_LIBS $INST_PLUGINS $INST_EXAMPLES\
|
2002-04-09 22:55:38 +08:00
|
|
|
|
2002-04-12 14:18:41 +08:00
|
|
|
make_installable "OpenSceneGraph"
|
|
|
|
|
2002-04-16 12:13:30 +08:00
|
|
|
#
|
|
|
|
# Capture include directories
|
|
|
|
#
|
2002-04-09 22:55:38 +08:00
|
|
|
SUBDIRS=`ls $TOPDIR/include | grep -v CVS`
|
|
|
|
INSTARG=""
|
|
|
|
for d in $SUBDIRS
|
|
|
|
do
|
|
|
|
dd="$INST_INCLUDE"/"$d"
|
|
|
|
[ -d $dd ] && INSTARG="$INSTARG $dd"
|
|
|
|
done
|
|
|
|
|
2002-04-16 12:13:30 +08:00
|
|
|
#
|
2003-03-28 02:56:23 +08:00
|
|
|
# Capthre examples subdirectories
|
2002-04-16 12:13:30 +08:00
|
|
|
#
|
2003-03-28 02:56:23 +08:00
|
|
|
SUBDIRS=`ls $TOPDIR/src/examples | grep -v CVS`
|
2002-04-09 22:55:38 +08:00
|
|
|
for d in $SUBDIRS
|
|
|
|
do
|
2003-03-28 02:56:23 +08:00
|
|
|
dd="$INST_EXAMPLE_SRC"/"$d"
|
2002-04-09 22:55:38 +08:00
|
|
|
[ -d $dd ] && INSTARG="$INSTARG $dd"
|
|
|
|
done
|
|
|
|
|
2002-04-16 12:13:30 +08:00
|
|
|
#
|
|
|
|
# Capture Make subdirectory
|
|
|
|
#
|
|
|
|
dd="$INST_SRC"/"Make"
|
|
|
|
|
|
|
|
echo dd is $dd
|
|
|
|
ls $dd
|
|
|
|
|
|
|
|
[ -d $dd ] && INSTARG="$INSTARG $dd"
|
|
|
|
|
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
make_package\
|
|
|
|
"OpenSceneGraph-dev"\
|
|
|
|
"Open Scene Graph - Development environment"\
|
2003-03-28 02:56:23 +08:00
|
|
|
"An OpenGL based scene graph. This installation includes header files and example program source files"\
|
2002-04-09 22:55:38 +08:00
|
|
|
$INSTARG
|
2002-04-16 12:13:30 +08:00
|
|
|
|
2002-04-12 14:18:41 +08:00
|
|
|
make_installable "OpenSceneGraph-dev"
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
exit 0
|