Blob Blame History Raw
Name:           assimp
Version:        3.1.1
Release:        2%{?dist}
Summary:        Library to import various 3D model formats into applications

Group:          Development/Libraries
License:        BSD
URL:            http://assimp.sourceforge.net
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}_no_test_models.zip

# Strips bundled irrXML out of build files, and allows project to build
# against system versions of the libraries (not yet submitted upstream) 
Patch0:         %{name}-3.1.1-unbundle.patch
# Change a doxygen setting so CHM help isn't generated. Fedora-only
Patch1:         %{name}-3.1.1-docfix.patch
# Add /usr/lib64 to library lookup paths for python modules
Patch4:         %{name}-3.1.1-pythonpath.patch
# Fix build on big-endian architectures
#https://github.com/assimp/assimp/issues/613
Patch5:         %{name}-3.1.1-bigendian.patch
# Fix library and include paths in assimp-config.cmake
# Fixes rhbz#1263698, not submitted upstream
Patch6:         %{name}-3.1.1-cmakefix.patch

BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  irrlicht-devel
BuildRequires:  irrXML-devel
BuildRequires:  zlib-devel
BuildRequires:  doxygen
BuildRequires:  minizip-devel
BuildRequires:  poly2tri-devel
BuildRequires:  python2-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 -n python2-%{name}
Summary: Python bindings for assimp
Group: Development/Libraries
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: python2
Provides: %{name}-python = %{version}-%{release}
Obsoletes: %{name}-python < 3.1.1

%description -n python2-%{name}
This package contains the PyAssimp python bindings

%prep
%setup -q 
# Get rid of bundled libs so we can't accidently build against them
rm -f code/fast_atof.h
rm -rf contrib/cppunit-1.12.1
rm -rf contrib/irrXML
rm -rf contrib/zlib
rm -rf contrib/unzip
rm -rf contrib/poly2tri
%patch0 -p1 -b .unbundle
%patch1 -p1 -b .docfix
%patch4 -p1 -b .pythonpath
%patch5 -p1 -b .bigendian
%patch6 -p0 -b .cmakefix

%build
mkdir build
pushd build
%cmake .. \
 -DASSIMP_LIB_INSTALL_DIR=%{_libdir} \
 -DASSIMP_INCLUDE_INSTALL_DIR=%{_includedir} \
 -DIRRXML_LIB_PATH=%{_libdir} \
 -DIRRXML_INCLUDE_PATH=%{_includedir}/irrlicht/ \
 -DPOLY2TRI_INCLUDE_PATH=%{_includedir}/poly2tri \
 -DCLIPPER_INCLUDE_PATH=%{_includedir}/clipper \
 -DUSE_EXTERNAL_LIBS=ON  \
 -DASSIMP_ENABLE_BOOST_WORKAROUND=OFF
popd
make %{?_smp_mflags} -C build

# Generate docs, copy assimp logo image and stylesheet into generated docs
pushd doc
doxygen Doxyfile
cp AssimpDoc_Html/dragonsplash.png html/dragonsplash.png
popd

# Fix file encoding
dos2unix README LICENSE CREDITS port/PyAssimp/README.md
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}%{python2_sitelib}/pyassimp/
install -m0644 port/PyAssimp/pyassimp/*.py %{buildroot}%{python2_sitelib}/pyassimp/

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%license LICENSE
%doc README CREDITS
%{_bindir}/assimp
%{_libdir}/*.so.*

%files devel
%doc doc/html
%{_includedir}/assimp
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/cmake/%{name}-3.1

%files -n python2-%{name}
%doc port/PyAssimp/README.md
%{python_sitelib}/pyassimp

%changelog
* Thu Sep 17 2015 Rich Mattes <richmattes@gmail.com> - 3.1.1-2
- Fix assimp-config paths (rhbz#1263698)
- Build against system boost instead of using included workaround

* Fri Jul 03 2015 Rich Mattes <richmattes@gmail.com> - 3.1.1-1
- Update to release 3.1.1 (rhbz#1206371)
- Remove upstreamed patches
- Correct python package names
- Use license macro

* Sun Mar 02 2014 Scott K Logan <logans@cottsay.net> - 2.0.863-11.20110824svn
- Added missing python-devel build dep which resulted in pyassimp installing to /
- Added README for assimp-python

* Fri Jul 05 2013 Rich Mattes <richmattes@gmail.com> - 2.0.863-10.20110824svn
- Update project version in pkgconfig to reflect SVN snapshot version (rhbz#972536)

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.863-9.20110824svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Oct 25 2012 Rich Mattes <richmattes@gmail.com> - 2.0.863-8.20110824svn
- Install python bindings

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.863-7.20110824svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Jul  3 2012 Tom Callaway <spot@fedoraproject.org> - 2.0.863-6.20110824svn
- rebuild against new irrlicht/irrxml

* 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