Added Norman Vine's changes for CYGWIN builds
Added distrules and makerpms for building RPM distributions Removed old RedHatRPM distribution build directory Added new dist/RPM directory and placed temporary .spec files (these are generated by Make/makerpms and are not intended for stand-alone use, but they keep the directory warm and CVS happy)
This commit is contained in:
11
Make/distrules
Normal file
11
Make/distrules
Normal file
@@ -0,0 +1,11 @@
|
||||
distribution :
|
||||
@$(MAKEDIST) $(TOPDIR)\
|
||||
$(INST_LIBS)\
|
||||
$(INST_PLUGINS)\
|
||||
$(INST_INCLUDE)\
|
||||
$(INST_DEMOS)\
|
||||
$(INST_DEMO_SRC)\
|
||||
$(INST_DOC)\
|
||||
$(INST_DATA)
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@ ifeq ($(findstring IRIX,$(OS)),IRIX)
|
||||
OS := IRIX
|
||||
endif
|
||||
|
||||
## Make CYGWIN_XXXX CYGWIN so it's "Windows cross platform" :)
|
||||
ifeq ($(findstring CYGWIN,$(OS)),CYGWIN)
|
||||
OS := CYGWIN
|
||||
endif
|
||||
|
||||
|
||||
# TOPDIR needs to be redefined for every Makefile
|
||||
TOPDIR ?= ../
|
||||
THISDIR = .
|
||||
@@ -49,6 +55,7 @@ LIB_EXT = so
|
||||
PLUGIN_PREFIX = osgdb_
|
||||
PLUGIN_EXT = so
|
||||
|
||||
MAKEDIST = echo " === Distribution build is not implemented yet for $(OS)"; printf "\n"
|
||||
|
||||
ALL_TARGETS = \
|
||||
opt\
|
||||
@@ -149,6 +156,8 @@ ifeq ($(OS),Linux)
|
||||
X_LIBS = -lXmu -lX11
|
||||
SOCKET_LIBS =
|
||||
OTHER_LIBS =
|
||||
|
||||
MAKEDIST = $(TOPDIR)/Make/makerpms
|
||||
endif
|
||||
|
||||
#### FreeBSD specific definitions
|
||||
@@ -204,7 +213,7 @@ ifeq ($(OS),Darwin)
|
||||
endif
|
||||
|
||||
#### Cygwin/Mingw specific definitions
|
||||
ifeq ($(OS),CYGWIN_NT-5.0)
|
||||
ifeq ($(OS),CYGWIN)
|
||||
C++ = c++
|
||||
DEPARG = -M
|
||||
INC +=
|
||||
@@ -213,8 +222,8 @@ ifeq ($(OS),CYGWIN_NT-5.0)
|
||||
DBGF = -g
|
||||
SHARED = -shared\
|
||||
-Wl,--export-all-symbols \
|
||||
-Wl,--output-def,$(LIB_PREFIX)$(TARGET_BASENAME).def \
|
||||
-Wl,--out-implib,$(TOPDIR)/lib/$(LIB_PREFIX)$(TARGET_BASENAME).a \
|
||||
-Wl,--output-def,lib$(TARGET_BASENAME).def \
|
||||
-Wl,--out-implib,$(TOPDIR)/lib/lib$(TARGET_BASENAME).dll.a \
|
||||
|
||||
ARCHARGS =
|
||||
LINKARGS = -W -Wall
|
||||
@@ -242,10 +251,16 @@ ifeq ($(OS),CYGWIN_NT-5.0)
|
||||
-losgdb_zip
|
||||
SOCKET_LIBS =
|
||||
OTHER_LIBS = $(GL_LIBS)
|
||||
PNG_LIBS = -lpng -lz
|
||||
JPEG_LIBS = -ljpeg
|
||||
GIF_LIBS = -lungif
|
||||
TIFF_LIB = -ltiff -lz -ljpeg
|
||||
FREETYPE_LIB = -lfreetype2
|
||||
|
||||
|
||||
LIB_PREFIX = cyg
|
||||
LIB_EXT = dll
|
||||
PLUGIN_PREFIX = osgdb_
|
||||
PLUGIN_PREFIX = cygosgdb_
|
||||
PLUGIN_EXT = dll
|
||||
|
||||
LINK = cp -f
|
||||
|
||||
200
Make/makerpms
Normal file
200
Make/makerpms
Normal file
@@ -0,0 +1,200 @@
|
||||
#!/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
|
||||
s_install $TOPDIR/lib/osgPlugins 744 $INST_PLUGINS
|
||||
s_install $TOPDIR/bin 755 $INST_DEMOS
|
||||
|
||||
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
|
||||
print_attr $INST_DEMOS 755 >> $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
||||
|
||||
rpm -bb --clean $TOPDIR/dist/RPM/OpenSceneGraph.spec
|
||||
|
||||
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 ] && \
|
||||
s_install $TOPDIR/include/$d 644 $INST_INCLUDE/$d
|
||||
done
|
||||
|
||||
for d in `ls $TOPDIR/src/Demos | grep -v CVS`
|
||||
do
|
||||
[ -d $TOPDIR/src/Demos/$d ] && \
|
||||
s_install $TOPDIR/src/Demos/$d 644 $INST_DEMO_SRC/$d
|
||||
done
|
||||
|
||||
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
|
||||
|
||||
for d in `ls -1 $RPM_BUILD_DIR/$INST_DEMO_SRC`
|
||||
do
|
||||
print_attr $INST_DEMO_SRC/$d 755 >> $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
||||
done
|
||||
|
||||
rpm -bb --clean $TOPDIR/dist/RPM/OpenSceneGraph_dev.spec
|
||||
|
||||
mv /usr/src/redhat/RPMS/i386/OpenSceneGraph_dev-$REV-$REL.i386.rpm dist/RPM
|
||||
}
|
||||
|
||||
if [ "`whoami`" != "root" ]
|
||||
then
|
||||
echo
|
||||
echo " === makerpm : You must be root do make the RPM distribution."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -ne 8 ]
|
||||
then
|
||||
echo
|
||||
echo makerpm : Internal Error - Bad Usage
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TOPDIR=$1
|
||||
INST_LIBS=$2
|
||||
INST_PLUGINS=$3
|
||||
INST_INCLUDE=$4
|
||||
INST_DEMOS=$5
|
||||
INST_DEMO_SRC=$6
|
||||
INST_DOC=$7
|
||||
INST_DATA=$8
|
||||
|
||||
REV="`$TOPDIR""/bin/osgversion`"
|
||||
[ -z "$REV" ] && die "makerpm: requires a functional $TOPDIR/bin/osgversion"
|
||||
|
||||
REL=1
|
||||
|
||||
|
||||
make_osg
|
||||
|
||||
make_osg_dev
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user