Blob Blame History Raw
#
# Copyright (c) 2005 Ralf Corsepius, Ulm, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

%define apivers 0.9.9

Name:           OpenSceneGraph
Version:        0.9.9
Release:        5%{?dist}
Summary:        High performance real-time graphics toolkit

Group:          Applications/Multimedia
License:        OSGPL
URL:            http://www.openscenegraph.org/
Source0:        http://www.openscenegraph.org/downloads/snapshots/OSG_OP_OT-%{version}.zip

Patch0:		OpenSceneGraph-0.9.9.diff

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	flex bison
BuildRequires:  libGL-devel
BuildRequires: 	libGLU-devel
BuildRequires:	libXmu-devel
BuildRequires:	libX11-devel
BuildRequires: 	Inventor-devel
BuildRequires:	freeglut-devel
BuildRequires:	libjpeg-devel
BuildRequires:	libungif-devel
BuildRequires:	libtiff-devel
BuildRequires:	libpng-devel
BuildRequires:	doxygen

%{?_with_gdal:BuildRequires:	gdal-devel}
%{?_with_demeter:BuildRequires:	demeter-devel}

%description
The OpenSceneGraph is an OpenSource, cross platform graphics toolkit for the 
development of high performance graphics applications such as flight 
simulators, games, virtual reality and scientific visualization. 
Based around the concept of a SceneGraph, it provides an object oriented 
framework on top of OpenGL freeing the developer from implementing and 
optimizing low level graphics calls, and provides many additional utilities 
for rapid development of graphics applications.

%prep
%setup -q -n OSG_OP_OT-%{version}
%patch0 -p1

# backup, we hack this file later
cp OpenSceneGraph/Make/dependencies \
  OpenSceneGraph/Make/dependencies.bak

# Propagate RPM_OPT_FLAGS
for file in OpenSceneGraph/src/osgWrappers/*/GNUmakefile; do
  sed -i -e '/^OPTF.*$/d' $file
done

for dir in OpenThreads Producer OpenSceneGraph; do
# Add DESTDIR
# Remove bogus -lstdc++
# Install examples to %%{_bindir}
  sed -i \
    -e 's,^\(INST_LOCATION[ ]*?=\).*$,\1 $(DESTDIR)%{_prefix},g' \
    -e 's,^\(INST_INCLUDE[ ]*=\).*$,\1 $(DESTDIR)%{_includedir},g' \
    -e 's,^\(INST_SHARE[ ]*=\).*$,\1 $(DESTDIR)%{_datadir},g' \
    -e 's,^\(INST_LIBS[ ]*=\).*$,\1 $(DESTDIR)%{_libdir},g' \
    -e 's,^\(INST_EXAMPLES[ ]*=\).*$,\1 $(DESTDIR)%{_bindir},g' \
    -e 's,\(^[ \t]*LIBS[ ]*=.*\) -lstdc++,\1,g' \
    -e 's, -lXi,,g' \
    $dir/Make/makedefs

# Propagate RPM_OPT_FLAGS
  echo "OPTF = $RPM_OPT_FLAGS" >> $dir/Make/makedefs

# Fix quoting bug
  sed -i \
    -e 's, DOF=$(OPTF) , "DOF=$(OPTF)" ,g' \
    $dir/Make/makerules

# Fix libdir
  sed -i \
    -e 's,^prefix=.*$,prefix = %{_prefix},' \
    -e 's,^includedir=.*$,includedir = %{_includedir},' \
    -e 's,^libdir=.*$,libdir = %{_libdir},' \
    -e 's,^Version:.*$,Version: %{apivers},' \
    -e '/^Conflicts:$/d' \
    $dir/Make/$(echo $dir | tr [:upper:] [:lower:]).pc
done

%build
rm -rf $RPM_BUILD_ROOT
%ifarch x86_64
export LD_LIBRARY_PATH="$PWD/Producer/lib/Linux64:$PWD/OpenThreads/lib/Linux64"
%else
export LD_LIBRARY_PATH="$PWD/Producer/lib/Linux32:$PWD/OpenThreads/lib/Linux32"
%endif

# configure
echo "# Fedora custom settings" > OpenSceneGraph/Make/dependencies
echo "COMPILE_EXAMPLES = yes" >> OpenSceneGraph/Make/dependencies
echo "COMPILE_INTROSPECTION = yes" >> OpenSceneGraph/Make/dependencies
echo "INVENTOR_INSTALLED = yes" >> OpenSceneGraph/Make/dependencies
echo "GLUT_INSTALLED = yes" >> OpenSceneGraph/Make/dependencies
%{?_with_gdal:echo "GDAL_INSTALLED = yes" >> OpenSceneGraph/Make/dependencies}
%{?_with_demeter:echo "DEMETER_INSTALLED = yes" >> OpenSceneGraph/Make/dependencies}
echo >> OpenSceneGraph/Make/dependencies
cat OpenSceneGraph/Make/dependencies.bak >> OpenSceneGraph/Make/dependencies

for dir in OpenThreads Producer OpenSceneGraph; do
  make -C $dir \
    COMPILE_OSG_OP_OT_WITH_SONAMES=YES \
    OPENTHREADS_INC_DIR="$PWD/OpenThreads/include" \
    OPENTHREADS_LIB_DIR="$PWD/OpenThreads/lib/\$(OS)\$(ARCH)" \
    PRODUCER_INC_DIR="$PWD/Producer/include" \
    PRODUCER_LIB_DIR="$PWD/Producer/lib/\$(OS)\$(ARCH)" \
    %{?_smp_mflags}
done

  doxygen debian/Doxyfile-openthreads
  doxygen debian/Doxyfile-openscenegraph
  doxygen debian/Doxyfile-producer

%install
rm -rf $RPM_BUILD_ROOT
%ifarch x86_64
export LD_LIBRARY_PATH="$PWD/Producer/lib/Linux64:$PWD/OpenThreads/lib/Linux64"
%else
export LD_LIBRARY_PATH="$PWD/Producer/lib/Linux32:$PWD/OpenThreads/lib/Linux32"
%endif

for dir in OpenThreads Producer OpenSceneGraph; do
  make -C $dir \
    COMPILE_OSG_OP_OT_WITH_SONAMES="YES" \
    OPENTHREADS_INC_DIR="$PWD/OpenThreads/include" \
    OPENTHREADS_LIB_DIR="$PWD/OpenThreads/lib/\$(OS)\$(ARCH)" \
    PRODUCER_INC_DIR="$PWD/Producer/include" \
    PRODUCER_LIB_DIR="$PWD/Producer/lib/\$(OS)\$(ARCH)" \
    install DESTDIR="$RPM_BUILD_ROOT"
done

rm -rf $RPM_BUILD_ROOT%{_datadir}/OpenSceneGraph/src

# fix up shared library symlinks
/sbin/ldconfig -n ${RPM_BUILD_ROOT}%{_libdir}

install -m 644 -D OpenThreads/Make/openthreads.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/openthreads.pc
install -m 644 -D OpenSceneGraph/Make/openscenegraph.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/openscenegraph.pc
install -m 644 -D Producer/Make/producer.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/producer.pc

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc OpenSceneGraph/*.txt
%{_bindir}/osgarchive
%{_bindir}/osgconv
%{_bindir}/osgversion
%{_bindir}/osgviewer
%{?_with_gdal:%{_bindir}/osgdem}
%{_libdir}/osgPlugins
%{_libdir}/libosg*.so.*

%package devel
Summary: 	Devel files for OpenSceneGraph
Group:		Applications/Multimedia
Requires:	%name = %{version}-%{release}
Requires:	Producer-devel = %{version}-%{release}

%description devel
Development files for OpenSceneGraph.

%files devel
%defattr(-,root,root,-)
%doc OpenSceneGraph/html
%{_includedir}/osg*
%{_libdir}/pkgconfig/openscenegraph.pc
%{_libdir}/libosg*.so

# OpenSceneGraph-examples
%package examples
Summary: 	Sample applications for OpenSceneGraph
Group:		Applications/Multimedia

%description examples
Sample applications for OpenSceneGraph

%files examples
%defattr(-,root,root,-)
%{_bindir}/osganimate
%{_bindir}/osgautotransform
%{_bindir}/osgbillboard
%{_bindir}/osgblendequation
%{_bindir}/osgcallback
%{_bindir}/osgcatch
%{_bindir}/osgcameragroup
%{_bindir}/osgclip
%{_bindir}/osgcluster
%{_bindir}/osgcopy
%{_bindir}/osgcubemap
%{_bindir}/osgdepthshadow
%{_bindir}/osgdistortion
%{_bindir}/osgforest
%{_bindir}/osgfxbrowser
%{_bindir}/osggeodemo
%{_bindir}/osggeometry
%{_bindir}/osghangglide
%{_bindir}/osghud
%{_bindir}/osgimpostor
%{_bindir}/osgkeyboard
%{_bindir}/osgkeyboardmouse
%{_bindir}/osglauncher
%{_bindir}/osglight
%{_bindir}/osglightpoint
%{_bindir}/osglogicop
%{_bindir}/osglogo
%{_bindir}/osgmotionblur
%{_bindir}/osgmovie
%{_bindir}/osgmultitexture
%{_bindir}/osgoccluder
%{_bindir}/osgpagedlod
%{_bindir}/osgparticle
%{_bindir}/osgparticleeffects
%{_bindir}/osgpbuffer
%{_bindir}/osgpick
%{_bindir}/osgplanets
%{_bindir}/osgpoints
%{_bindir}/osgpointsprite
%{_bindir}/osgprerender
%{_bindir}/osgprerendercubemap
%{_bindir}/osgreflect
%{_bindir}/osgscalarbar
%{_bindir}/osgscribe
%{_bindir}/osgsequence
%{_bindir}/osgshaders
%{_bindir}/osgshadowtexture
%{_bindir}/osgshape
%{_bindir}/osgsimple
%{_bindir}/osgsimplepager
%{_bindir}/osgsimplifier
%{_bindir}/osgslice
%{_bindir}/osgspacewarp
%{_bindir}/osgspheresegment
%{_bindir}/osgspotlight
%{_bindir}/osgstereoimage
%{_bindir}/osgteapot
%{_bindir}/osgtesselate
%{_bindir}/osgtext
%{_bindir}/osgtexture1D
%{_bindir}/osgtexture2D
%{_bindir}/osgtexture3D
%{_bindir}/osgtexturerectangle
%{_bindir}/osgunittests
%{_bindir}/osgvertexprogram
%{_bindir}/osgvolume
%{_bindir}/osgwindows
%{_bindir}/osgintrospection

%{?_with_gdal:%{_bindir}/osgphotoalbum}
%{?_with_gdal:%{_bindir}/osgbluemarble}
%{?_with_gdal:%{_bindir}/osgsimulation}

%{?_with_demeter:%{_bindir}/osgdemeter}

%{_bindir}/osgGLUTsimple
%{_bindir}/osgGLUTkeyboardmouse

%{_datadir}/OpenSceneGraph

# OpenThreads
%package -n OpenThreads
Summary: 	OpenThreads
Group:		Applications/Multimedia
License:	LGPL

%description -n OpenThreads
OpenThreads is intended to provide a minimal & complete Object-Oriented (OO)
thread interface for C++ programmers.  It is loosely modeled on the Java
thread API, and the POSIX Threads standards.  The architecture of the 
library is designed around "swappable" thread models which are defined at 
compile-time in a shared object library.

%post -n OpenThreads -p /sbin/ldconfig

%postun -n OpenThreads -p /sbin/ldconfig

%files -n OpenThreads
%defattr(-,root,root,-)
%doc OpenThreads/*.txt
%{_libdir}/libOpenThreads.so.*

# OpenThreads-devel
%package -n OpenThreads-devel
Summary: 	Devel files for OpenThreads
Group:		Applications/Multimedia
License:	LGPL
Requires:	OpenThreads = %{version}-%{release}

%description -n OpenThreads-devel
Development files for OpenThreads.

%files -n OpenThreads-devel
%defattr(-,root,root,-)
%doc OpenThreads/html
%{_libdir}/pkgconfig/openthreads.pc
%{_libdir}/libOpenThreads.so
%{_includedir}/OpenThreads


# Producer
%package -n Producer
Summary: 	Producer
License:	OSGPL
Group:		Applications/Multimedia
Provides:	OpenProducer = %{version}-%{release}

%description -n Producer
Open Producer (or simply Producer) is a cross-platform, C++ library for 
managing OpenGL rendering contexts in a windowing system independent manner.
Producer provides a simple, yet powerfully scalable approach for real-time 3D
applications wishing to run within a single window to large, multidisplay 
systems.

%post -n Producer -p /sbin/ldconfig

%postun -n Producer -p /sbin/ldconfig

%files -n Producer
%defattr(-,root,root,-)
%doc Producer/*.txt
%{_libdir}/libProducer.so.*

# Producer-devel
%package -n Producer-devel
Summary: 	Devel files for Producer
Group:		Applications/Multimedia
License:	OSGPL
Requires:	Producer = %{version}-%{release}
Requires:	OpenThreads-devel = %{version}-%{release}
Provides:	OpenProducer-devel = %{version}-%{release}

%description -n Producer-devel
Development files for Producer.

%files -n Producer-devel
%defattr(-,root,root,-)
%doc Producer/html
%{_libdir}/pkgconfig/producer.pc
%{_libdir}/libProducer.so
%{_includedir}/Producer

%changelog
* Wed Dec 07 2005 Ralf Cors├ępius <rc040203@freenet.de> - 0.9.9-5
- Try at getting this package buildable with modular X11.

* Tue Dec 06 2005 Ralf Corsepius <rc040203@freenet.de> - 0.9.9-4%{?dist}.1
- Merge diffs into one file.
- Fix up *.pcs from inside of *.spec.

* Sun Aug 28 2005 Ralf Corsepius <rc040203@freenet.de> - 0.9.9-4
- Propagate %%_libdir to pkgconfig files.
- Fix typo in %%ifarch magic to setup LD_LIBRARY_PATH
- Move configuration to %%build.
- Spec file cosmetics.

* Sat Aug 27 2005 Ralf Corsepius <rc040203@freenet.de> - 0.9.9-3
- Add full URL to Debian patch.
- Add _with_demeter.
- Extend Producer %%description.
- Extend OpenThreads %%description.

* Tue Aug 09 2005 Ralf Corsepius <ralf@links2linux.de> - 0.9.9-2
- Fix license to OSGPL.
- Change permissions on pkgconfig files to 0644.

* Tue Aug 02 2005 Ralf Corsepius <ralf@links2linux.de> - 0.9.9-1
- FE submission.

* Thu Jul 21 2005 Ralf Corsepius <ralf@links2linux.de> - 0.9.9-0
- Initial spec.