%global svnrev 1071
Name: assimp
Version: 2.0.863
Release: 6.20110824svn%{?dist}
Summary: Library to import various 3D model formats into applications
Group: Development/Libraries
License: BSD
URL: http://assimp.sourceforge.net
# Used 'assimp_generate_tarball svnrev' to generate source
Source0: %{name}-%{svnrev}.tar.bz2
Source1: assimp_generate_tarball.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Strips bundled irrXML out of build files, and allows project to build
# against system versions of the libraries (not yet submitted upstream)
Patch0: %{name}-2.0.863.unbundleirrxml.patch
# Change a doxygen setting so CHM help isn't generated
Patch1: %{name}-1.1.700.docfix.patch
Patch2: %{name}-2.0.863.pkgconfig.patch
Patch3: %{name}-1071-gcc47.patch
Patch4: %{name}-pythonpath.patch
BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: dos2unix
BuildRequires: irrlicht-devel
BuildRequires: irrXML-devel
BuildRequires: zlib-devel
BuildRequires: doxygen
BuildRequires: minizip-devel
%description
Assimp, the Open Asset Import Library, is a free library to import
various well-known 3D model formats into applications. Assimp aims
to provide a full asset conversion pipeline for use in game
engines and real-time rendering systems, but is not limited
to these applications.
%package devel
Summary: Header files and libraries for assimp
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains the header files and libraries
for assimp. If you would like to develop programs using assimp,
you will need to install assimp-devel.
%package python
Summary: Python bindings for assimp
Group: Development/Libraries
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: python
%description python
This package contains the PyAssimp python bindings
%prep
%setup -q -n %{name}
# Get rid of bundled libs so we can't accidently build against them
rm -rf contrib/irrXML
rm -rf contrib/zlib
rm -rf contrib/unzip
rm -rf code/fast_atof.h
%patch0 -p0
%patch1 -p1
%patch2 -p1
%patch3 -p0
%patch4 -p0
%build
mkdir build
pushd build
%cmake -DLIB_INSTALL_DIR=%{_libdir} -DINCLUDE_INSTALL_DIR=%{_includedir} -DBIN_INSTALL_DIR=%{_bindir} -DIRRXML_LIB_PATH=${_libdir} -DIRRXML_INCLUDE_PATH=%{_includedir}/irrlicht/ -DUSE_EXTERNAL_LIBS=ON ..
popd
make %{?_smp_mflags} -C build
# Generate docs, copy assimp logo image and stylesheet into generated docs
pushd doc
doxygen Doxyfile
dos2unix style.css
cp style.css html/style.css
cp AssimpDoc_Html/dragonsplash.png html/dragonsplash.png
popd
# Fix file encoding
dos2unix README LICENSE CREDITS
iconv -f iso8859-1 -t utf-8 CREDITS > CREDITS.conv && mv -f CREDITS.conv CREDITS
%install
rm -rf %{buildroot}
make -C build install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{python_sitelib}/pyassimp/
install -p port/PyAssimp/pyassimp/*.py %{buildroot}%{python_sitelib}/pyassimp/
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc README LICENSE CREDITS
%{_bindir}/assimp
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%doc doc/html
%{_includedir}/assimp
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%files python
%{python_sitelib}/pyassimp
%changelog
* Thu Oct 25 2012 Rich Mattes <richmattes@gmail.com> - 2.0.863-6.20110824svn
- Install python bindings
* Wed Apr 11 2012 Rich Mattes <richmattes@gmail.com> - 2.0.863-5.20110824svn
- Changed spec to use buildroot macro
* Sat Dec 17 2011 Rich Mattes <richmattes@gmail.com> - 2.0.863-4.20110824svn
- Fixed pkgconfig paths
* Wed Aug 24 2011 Rich Mattes <richmattes@gmail.com> - 2.0.863-3.20110824svn
- Upgrade to latest svn snapshot
- Port changes to link against system irrXML
- Removed upstreamed zlib/unzip unbundling patches
* Thu Mar 24 2011 Rich Mattes <richmattes@gmail.com> - 2.0.863-2.20110324svn
- Upgrade to latest svn snapshot
- Port changes to link against libIrrXML
* Sat Dec 18 2010 Rich Mattes <richmattes@gmail.com> - 2.0.863-1
- Upgrade to release 2.0
* Mon Sep 20 2010 Rich Mattes <richmattes@gmail.com> - 1.1.700-3
- Remove extra buildrequires
- Generate doxygen docs manually
* Mon Sep 20 2010 Rich Mattes <richmattes@gmail.com> - 1.1.700-2
- Included doxygen-generated docs
- Using original .zip file from project download page
* Sun Sep 19 2010 Rich Mattes <richmattes@gmail.com> - 1.1.700-1
- First build