File ogre.spec of Package ogre
%define name ogre
%define major 1
%define minor 7
%define micro 1
%define version %{major}.%{minor}.%{micro}
%define release 1
Summary: Ogre 3D: an open source graphics engine
Name: libOgreMain-%{major}_%{minor}_%{micro}
Url: http://www.ogre3d.org/
Version: %{version}
Release: %{release}
License: LGPL v2.1
Group: Development/Libraries
Source: ogre_src_v%{major}-%{minor}-%{micro}.tar.bz2
#Patch0: sled11-cmake-fix.patch
Patch1: plugin_dir.patch
BuildRequires: cmake DevIL-devel libfreeimage-devel zziplib-devel xorg-x11-Mesa-devel gcc-c++ pkg-config libcegui-devel >= 0.5 cg-devel libOIS-devel libpng-devel boost-devel doxygen grep fdupes
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
%package -n libOgreMain-devel
Summary: Ogre 3D: an open source graphics engine
Group: Development/Libraries
Requires: %{name} = %{version}
Requires: libcegui-devel
# _includedir/OGRE/Threading/OgreThreadHeadersBoost.h includes headers from boost
Requires: boost-devel
# libogre-devel was last used in openSUSE 11.1
Provides: libogre-devel = 1.7.0
%description -n libOgreMain-devel
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains the development headers.
%package -n ogre-demos
Summary: Ogre 3D: an open source graphics engine
Group: Development
Requires: %{name} = %{version}
%description -n ogre-demos
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains demo applications.
%package -n ogre-demos-devel
Summary: Ogre 3D: an open source graphics engine
Group: Development
Requires: %{name} = %{version}
%description -n ogre-demos-devel
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains the source of the demo applications.
%package -n ogre-tools
Summary: Ogre 3D: an open source graphics engine
Group: Development
Requires: %{name} = %{version}
%description -n ogre-tools
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains various tools that make working with ogre easier.
%package -n libOgreMain-doc
Summary: Ogre 3D: an open source graphics engine
Group: Development
Requires: %{name} = %{version}
# libogre-doc was last used in openSUSE 11.1
Provides: libogre-doc = 1.7.0
%description -n libOgreMain-doc
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains documentation for OGRE.
%package plugin-Cg
Summary: Ogre 3D: an open source graphics engine
Group: Development
Requires: %{name} = %{version}
%description plugin-Cg
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible
3D engine written in C++ designed to make it easier and more intuitive for
developers to produce applications utilising hardware-accelerated 3D graphics.
The class library abstracts all the details of using the underlying system
libraries like Direct3D and OpenGL and provides an interface based on world
objects and other intuitive classes.
This package contains the Cg plugin
%prep
%setup -q -n ogre_src_v%{major}-%{minor}-%{micro}
#%%patch0 -p1
%patch1
%build
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DOGRE_LIB_DIRECTORY=%{_lib} \
-DOGRE_BUILD_SAMPLES=ON \
-DOGRE_INSTALL_SAMPLES=ON \
-DOGRE_INSTALL_SAMPLES_SOURCE=ON \
-DOGRE_INSTALL_DOCS=ON \
-DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
-DCMAKE_C_FLAGS:STRING="$RPM_OPT_FLAGS"
%if 0%{?suse_version} <= 1010
export LDFLAGS="$LDFLAGS -L/usr/X11R6/%{_lib}"
%endif
VERBOSE=1 make %{?_smp_mflags}
%install
cd build
make DESTDIR=%buildroot install
# correct some execute permissions
find %buildroot%{_datadir}/OGRE/Samples \
-name "*.cpp" -o -name "*.h" -exec chmod -x {} \;
# remove and link duplicate files
%if 0%{?suse_version}
%fdupes %buildroot%{_datadir}/OGRE
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/libOgreMain.so.%{version}
%{_libdir}/libOgrePaging.so.%{version}
%{_libdir}/libOgreProperty.so.%{version}
%{_libdir}/libOgreRTShaderSystem.so.%{version}
%{_libdir}/libOgreTerrain.so.%{version}
%dir %{_libdir}/OGRE
%{_libdir}/OGRE/RenderSystem_GL.so
%{_libdir}/OGRE/Plugin_OctreeSceneManager.so
%{_libdir}/OGRE/Plugin_ParticleFX.so
%{_libdir}/OGRE/Plugin_BSPSceneManager.so
%{_libdir}/OGRE/Plugin_OctreeZone.so
%{_libdir}/OGRE/Plugin_PCZSceneManager.so
%dir %{_datadir}/OGRE
%{_datadir}/OGRE/plugins.cfg
%files -n libOgreMain-devel
%defattr(-,root,root)
%{_libdir}/OGRE/cmake
%{_includedir}/OGRE
%{_libdir}/libOgre*.so
%{_libdir}/pkgconfig/*.pc
%files -n ogre-demos
%defattr(-,root,root)
%{_libdir}/OGRE/Samples
%{_bindir}/SampleBrowser
%{_datadir}/OGRE/media
%{_datadir}/OGRE/samples.cfg
%{_datadir}/OGRE/resources.cfg
%{_datadir}/OGRE/quakemap.cfg
%files -n ogre-demos-devel
%defattr(-,root,root)
%{_datadir}/OGRE/Samples
%{_datadir}/OGRE/CMakeLists.txt
%files -n ogre-tools
%defattr(-,root,root)
%{_bindir}/OgreMeshUpgrader
%{_bindir}/OgreXMLConverter
%files -n libOgreMain-doc
%defattr(-,root,root)
%doc AUTHORS BUGS README COPYING
%doc %{_datadir}/OGRE/docs
%files plugin-Cg
%defattr(-,root,root)
%dir %{_libdir}/OGRE
%{_libdir}/OGRE/Plugin_CgProgramManager.so
%changelog