2002-04-05 02:01:44 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
die()
|
|
|
|
{
|
|
|
|
echo $1
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s_install()
|
|
|
|
{
|
|
|
|
src_DIR=$1
|
|
|
|
mode=$2
|
|
|
|
dst_DIR=$RPM_BUILD_DIR/`echo $3 | sed 's/\///'`
|
|
|
|
|
|
|
|
[ -d $dst_DIR ] || mkdir -p $dst_DIR
|
|
|
|
|
|
|
|
THISDIR=`pwd`
|
|
|
|
cd $src_DIR
|
|
|
|
for f in `ls -1`
|
|
|
|
do
|
|
|
|
if [ -f $f ]
|
|
|
|
then
|
|
|
|
install -m $mode $f $dst_DIR/$f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd $THISDIR
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print_attr()
|
|
|
|
{
|
|
|
|
dst_DIR=$1
|
|
|
|
mode=$2
|
|
|
|
t_dir=$RPM_BUILD_DIR/$dst_DIR
|
|
|
|
|
|
|
|
THISDIR=`pwd`
|
|
|
|
cd $t_dir
|
|
|
|
for f in `ls -1`
|
|
|
|
do
|
|
|
|
[ -f $f ] && echo "%attr($mode, root, root) $dst_DIR/$f"
|
|
|
|
done
|
|
|
|
cd $THISDIR
|
|
|
|
}
|
|
|
|
|
|
|
|
make_targz()
|
|
|
|
{
|
|
|
|
THISDIR=`pwd`
|
|
|
|
src_dir=$1
|
|
|
|
cd $RPM_BUILD_DIR/..
|
|
|
|
tar cvf - $src_dir |\
|
|
|
|
gzip > /usr/src/redhat/SOURCES/$src_dir.tar.gz
|
|
|
|
cd $THISDIR
|
|
|
|
}
|
|
|
|
|
|
|
|
make_spec()
|
|
|
|
{
|
|
|
|
name=$1
|
|
|
|
cat <<-LEOF > $TOPDIR/dist/RPM/$name.spec
|
|
|
|
|
|
|
|
Summary: A C++ scene graph API on OpenGL for real time graphics
|
|
|
|
Name: $name
|
|
|
|
Version: $REV
|
|
|
|
Release: $REL
|
|
|
|
Copyright: LGPL
|
|
|
|
Group: Graphics
|
|
|
|
Source: $name-$REV.tar.gz
|
|
|
|
URL: http://www.openscenegraph.org
|
|
|
|
Packager: `awk -f - /etc/passwd <<-EOF
|
|
|
|
BEGIN { FS=":"}
|
|
|
|
{
|
|
|
|
if( \\$1 == "$LOGNAME" )
|
|
|
|
print \\$5
|
|
|
|
}
|
|
|
|
EOF`
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
|
|
The Open Scene Graph is a cross-platform C++/OpenGL library for the real-time
|
|
|
|
visualization. Uses range from visual simulation, scientific modeling, virtual
|
|
|
|
reality through to games. Open Scene Graph employs good practices in software
|
|
|
|
engineering through the use of standard C++, STL and generic programming, and
|
|
|
|
design patterns. Open Scene Graph strives for high performance and quality in
|
|
|
|
graphics rendering, protability, and extensibility
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
|
|
%setup
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
|
|
cd $RPM_BUILD_DIR
|
|
|
|
tar cvf - . | tar xvfC - /
|
|
|
|
|
|
|
|
# ---------------------
|
|
|
|
# FILES Sections
|
|
|
|
%files
|
|
|
|
|
|
|
|
LEOF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
make_osg()
|
|
|
|
{
|
|
|
|
RPM_BUILD_DIR=/usr/src/redhat/BUILD/OpenSceneGraph-$REV
|
|
|
|
rm -rf $RPM_BUILD_DIR
|
|
|
|
mkdir $RPM_BUILD_DIR
|
|
|
|
|
|
|
|
s_install $TOPDIR/lib 755 $INST_LIBS
|
2002-04-16 13:29:39 +08:00
|
|
|
s_install $TOPDIR/lib/osgPlugins 755 $INST_PLUGINS
|
2003-03-28 02:56:23 +08:00
|
|
|
s_install $TOPDIR/bin 755 $INST_EXAMPLES
|
2002-04-05 02:01:44 +08:00
|
|
|
|
|
|
|
make_targz OpenSceneGraph-$REV
|
|
|
|
make_spec OpenSceneGraph
|
|
|
|
|
|
|
|
print_attr $INST_LIBS 755 >> $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
|
|
|
print_attr $INST_PLUGINS 755 >> $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
2003-03-28 02:56:23 +08:00
|
|
|
print_attr $INST_EXAMPLES 755 >> $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
2002-04-05 02:01:44 +08:00
|
|
|
|
2002-11-25 05:36:05 +08:00
|
|
|
rpmbuild -bb --clean $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
2002-04-05 02:01:44 +08:00
|
|
|
|
|
|
|
mv /usr/src/redhat/RPMS/i386/OpenSceneGraph-$REV-$REL.i386.rpm dist/RPM
|
|
|
|
}
|
|
|
|
|
|
|
|
make_osg_dev()
|
|
|
|
{
|
|
|
|
RPM_BUILD_DIR=/usr/src/redhat/BUILD/OpenSceneGraph_dev-$REV
|
|
|
|
rm -rf $RPM_BUILD_DIR
|
|
|
|
mkdir $RPM_BUILD_DIR
|
|
|
|
|
|
|
|
for d in `ls $TOPDIR/include | grep -v CVS`
|
|
|
|
do
|
|
|
|
[ -d $TOPDIR/include/$d ] && \
|
2002-04-16 13:29:39 +08:00
|
|
|
s_install $TOPDIR/include/$d 644 $INST_INCLUDE/$d
|
2002-04-05 02:01:44 +08:00
|
|
|
done
|
|
|
|
|
2002-04-16 13:29:39 +08:00
|
|
|
|
2003-03-28 02:56:23 +08:00
|
|
|
for d in `ls -1 $INST_EXAMPLE_SRC`
|
2002-04-05 02:01:44 +08:00
|
|
|
do
|
2003-03-28 02:56:23 +08:00
|
|
|
if [ -d $INST_EXAMPLE_SRC/$d ]
|
2002-04-16 13:29:39 +08:00
|
|
|
then
|
2003-03-28 02:56:23 +08:00
|
|
|
s_install $INST_EXAMPLE_SRC/$d 644 $INST_EXAMPLE_SRC/$d
|
2002-04-16 13:29:39 +08:00
|
|
|
fi
|
|
|
|
cd $THISDIR
|
2002-04-05 02:01:44 +08:00
|
|
|
done
|
|
|
|
|
2002-04-16 13:29:39 +08:00
|
|
|
s_install $INST_SRC/Make 644 $INST_SRC/Make
|
|
|
|
|
|
|
|
|
2002-04-05 02:01:44 +08:00
|
|
|
make_targz OpenSceneGraph_dev-$REV
|
|
|
|
make_spec OpenSceneGraph_dev
|
|
|
|
|
|
|
|
for d in `ls -1 $RPM_BUILD_DIR/$INST_INCLUDE`
|
|
|
|
do
|
|
|
|
print_attr $INST_INCLUDE/$d 755 >> $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
|
|
|
done
|
|
|
|
|
2003-03-28 02:56:23 +08:00
|
|
|
for d in `ls -1 $RPM_BUILD_DIR/$INST_EXAMPLE_SRC`
|
2002-04-05 02:01:44 +08:00
|
|
|
do
|
2003-03-28 02:56:23 +08:00
|
|
|
print_attr $INST_EXAMPLE_SRC/$d 755 >> $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
2002-04-05 02:01:44 +08:00
|
|
|
done
|
|
|
|
|
2002-04-16 13:29:39 +08:00
|
|
|
print_attr $INST_SRC/Make 755 >> $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
|
|
|
|
2002-04-05 02:01:44 +08:00
|
|
|
rpm -bb --clean $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
|
|
|
|
|
|
|
mv /usr/src/redhat/RPMS/i386/OpenSceneGraph_dev-$REV-$REL.i386.rpm dist/RPM
|
|
|
|
}
|
|
|
|
|
2004-12-05 08:03:43 +08:00
|
|
|
echo "The current $0 script is broken and needs to be updated."
|
|
|
|
exit 1
|
|
|
|
|
2002-04-05 02:01:44 +08:00
|
|
|
if [ "`whoami`" != "root" ]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo " === makerpm : You must be root do make the RPM distribution."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-04-16 13:29:39 +08:00
|
|
|
if [ $# -ne 10 ]
|
2002-04-05 02:01:44 +08:00
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo makerpm : Internal Error - Bad Usage
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
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-05 02:01:44 +08:00
|
|
|
|
2004-12-05 08:03:43 +08:00
|
|
|
REV="`make -s version`"
|
2002-04-05 02:01:44 +08:00
|
|
|
[ -z "$REV" ] && die "makerpm: requires a functional $TOPDIR/bin/osgversion"
|
|
|
|
|
|
|
|
REL=1
|
|
|
|
|
|
|
|
|
|
|
|
make_osg
|
|
|
|
|
|
|
|
make_osg_dev
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exit 0
|