44f8eb1
#
44f8eb1
# Copyright (c) 2010-2015 Ralf Corsepius, Ulm, Germany.
44f8eb1
# This file and all modifications and additions to the pristine
44f8eb1
# package are under the same license as the package itself.
44f8eb1
#
44f8eb1
44f8eb1
%global coin_includedir %{_includedir}/Coin3
44f8eb1
%global coin_htmldir %{_datadir}/Coin3
44f8eb1
44f8eb1
%global libopenal_SONAME libopenal.so.1
44f8eb1
%global libsimage_SONAME libsimage.so.20
44f8eb1
44f8eb1
Summary: High-level 3D visualization library
44f8eb1
Name: Coin3
44f8eb1
Version: 3.1.3
346517d
Release: 12%{?dist}
44f8eb1
44f8eb1
# https://bitbucket.org/Coin3D/coin/wiki/Home tells BSD,
44f8eb1
# but the tarball is GPLv2
44f8eb1
License: GPLv2
44f8eb1
Group: System Environment/Libraries
44f8eb1
44f8eb1
# Note: Upstream moved
44f8eb1
# Original upstream site was URL: http://www.coin3d.org
44f8eb1
URL: https://bitbucket.org/Coin3D/coin/wiki/Home
44f8eb1
44f8eb1
# Original coin3d.org tarball:
44f8eb1
# Source0: ftp://ftp.coin3d.org/pub/coin/src/all/Coin-3.1.3.tar.gz
44f8eb1
# Meanwhile, the coin3d.org-tarball moved to
44f8eb1
Source0: https://bitbucket.org/Coin3D/coin/downloads/Coin-%{version}.tar.gz
44f8eb1
44f8eb1
Patch1: 0001-simage-soname.patch
44f8eb1
Patch2: 0002-openal-soname.patch
44f8eb1
Patch3: 0003-man3.patch
44f8eb1
Patch4: 0004-doxygen.patch
44f8eb1
Patch5: 0005-gcc-4.7.patch
44f8eb1
Patch6: 0006-inttypes.patch
44f8eb1
Patch7: 0007-Convert-to-utf-8.patch
44f8eb1
Patch8: 0008-Convert-to-utf-8.patch
44f8eb1
Patch9: 0009-Convert-to-utf-8.patch
44f8eb1
Patch10: 0010-GCC-4.8.0-fixes.patch
44f8eb1
Patch11: 0011-Fix-SoCamera-manpage.patch
44f8eb1
44f8eb1
BuildRequires: libGLU-devel
44f8eb1
BuildRequires: libXext-devel
44f8eb1
44f8eb1
BuildRequires: zlib-devel
44f8eb1
BuildRequires: bzip2-devel
44f8eb1
BuildRequires: fontconfig-devel
44f8eb1
BuildRequires: freetype-devel
44f8eb1
BuildRequires: doxygen
44f8eb1
BuildRequires: /usr/bin/rename
44f8eb1
BuildRequires: boost-devel
44f8eb1
44f8eb1
Requires(post): /sbin/ldconfig
44f8eb1
Requires(postun): /sbin/ldconfig
44f8eb1
44f8eb1
%description
44f8eb1
Coin is a 3D graphics library with an Application Programming Interface
44f8eb1
based on the Open Inventor 2.1 API.
44f8eb1
44f8eb1
%package devel
44f8eb1
Summary: Development files for Coin
44f8eb1
Group: Development/Libraries
44f8eb1
Requires: %{name}%{?_isa} = %{version}-%{release}
44f8eb1
Requires: zlib-devel bzip2-devel
44f8eb1
Requires: fontconfig-devel
44f8eb1
Requires: freetype-devel
44f8eb1
Requires: libGLU-devel
44f8eb1
Requires: pkgconfig
44f8eb1
Requires(post): /usr/sbin/alternatives
44f8eb1
Requires(preun): /usr/sbin/alternatives
44f8eb1
Provides: pkgconfig(Coin)
44f8eb1
44f8eb1
%description devel
44f8eb1
Development package for Coin3
44f8eb1
44f8eb1
%prep
44f8eb1
%setup -q -n Coin-%{version}
44f8eb1
%patch1 -p1
44f8eb1
%patch2 -p1
44f8eb1
%patch3 -p1
44f8eb1
%patch4 -p1
44f8eb1
%patch5 -p1
44f8eb1
%patch6 -p1
44f8eb1
%patch7 -p1
44f8eb1
%patch8 -p1
44f8eb1
%patch9 -p1
44f8eb1
%patch10 -p1
44f8eb1
%patch11 -p1
44f8eb1
44f8eb1
%if 0%{?fedora} > 20
44f8eb1
# Incompatibility: 
44f8eb1
# Fedora > 20 has /usr/include/freetype2/
44f8eb1
# Fedora <= 20 has /usr/include/freetype2/freetype
44f8eb1
sed -i -e 's,freetype/,freetype2/,' src/glue/freetype.{h,cpp}
44f8eb1
%endif
44f8eb1
44f8eb1
# Update doxygen configuration
44f8eb1
doxygen -u docs/coin.doxygen.in
44f8eb1
44f8eb1
find -name 'Makefile.*' -exec sed -i -e 's,\$(datadir)/Coin,$(datadir)/Coin3,' {} \;
44f8eb1
44f8eb1
# bogus permissions
44f8eb1
find . \( -name '*.h' -o -name '*.cpp' -o -name '*.c' \) -a -executable -exec chmod -x {} \;
44f8eb1
44f8eb1
# convert sources to utf-8
44f8eb1
for a in $(find . -type f -exec file -i {} \; | grep -i iso | sed -e 's,:.*,,'); do \
44f8eb1
  /usr/bin/iconv -f ISO-8859-1 -t utf-8 $a > $a~; \
44f8eb1
  mv $a~ $a; \
44f8eb1
done
44f8eb1
44f8eb1
sed -i -e 's,@LIBSIMAGE_SONAME@,"%{libsimage_SONAME}",' \
44f8eb1
  src/glue/simage_wrapper.cpp
44f8eb1
sed -i -e 's,@LIBOPENAL_SONAME@,"%{libopenal_SONAME}",' \
44f8eb1
  src/glue/openal_wrapper.cpp
44f8eb1
44f8eb1
# get rid of bundled boost headers
44f8eb1
rm -rf include/boost
44f8eb1
44f8eb1
%build
44f8eb1
%configure \
44f8eb1
	--includedir=%{coin_includedir} \
44f8eb1
	--disable-dependency-tracking \
44f8eb1
	--enable-shared \
44f8eb1
	--disable-dl-libbzip2 \
44f8eb1
	--disable-dl-glu \
44f8eb1
	--disable-dl-zlib \
44f8eb1
	--disable-dl-freetype \
44f8eb1
	--disable-dl-fontconfig \
44f8eb1
	--disable-spidermonkey \
44f8eb1
	--enable-man \
44f8eb1
	--enable-html \
44f8eb1
	--enable-3ds-import \
44f8eb1
	htmldir=%{coin_htmldir}/Coin \
44f8eb1
	CPPFLAGS="$(pkg-config --cflags freetype2)"
44f8eb1
make %{?_smp_mflags}
44f8eb1
44f8eb1
# Strip the default libdir
44f8eb1
sed -i -e "s,\-L%{_libdir} ,," coin-default.cfg
44f8eb1
44f8eb1
# coin-config is arch dependent
44f8eb1
sed -i -e "s,/share/Coin/conf/,/%{_lib}/Coin3/conf/,g" bin/coin-config
44f8eb1
f1da765
# HACK: Remove rid of %%optflags and %%__global_ldflags
f1da765
sed -i -e "s|%{optflags}||" Coin.pc coin-default.cfg
f1da765
sed -i -e "s|%{__global_ldflags}||" Coin.pc coin-default.cfg
f1da765
44f8eb1
%install
44f8eb1
make DESTDIR=$RPM_BUILD_ROOT install
44f8eb1
44f8eb1
pushd $RPM_BUILD_ROOT%{_mandir} > /dev/null
44f8eb1
/usr/bin/rename .1 .1coin3 man1/*
44f8eb1
/usr/bin/rename .3 .3coin3 man3/*
44f8eb1
popd > /dev/null
44f8eb1
rm -f ${RPM_BUILD_ROOT}%{_libdir}/lib*.la
44f8eb1
44f8eb1
install -d -m 755 ${RPM_BUILD_ROOT}%{_libdir}/Coin3
44f8eb1
mv ${RPM_BUILD_ROOT}%{_datadir}/Coin3/conf ${RPM_BUILD_ROOT}%{_libdir}/Coin3
44f8eb1
44f8eb1
mv ${RPM_BUILD_ROOT}%{_bindir}/coin-config ${RPM_BUILD_ROOT}%{_libdir}/Coin3/coin-config
44f8eb1
ln -s %{_libdir}/Coin3/coin-config ${RPM_BUILD_ROOT}%{_bindir}/coin-config
44f8eb1
mv ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/Coin.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/Coin3.pc
44f8eb1
ln -s %{_libdir}/pkgconfig/Coin3.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/Coin.pc
44f8eb1
mv ${RPM_BUILD_ROOT}%{_datadir}/aclocal/coin.m4 ${RPM_BUILD_ROOT}%{_datadir}/aclocal/coin3.m4
44f8eb1
ln -s %{_datadir}/aclocal/coin3.m4 ${RPM_BUILD_ROOT}%{_datadir}/aclocal/coin.m4
44f8eb1
44f8eb1
44f8eb1
%post -p /sbin/ldconfig
44f8eb1
44f8eb1
%postun -p /sbin/ldconfig
44f8eb1
44f8eb1
%post devel
44f8eb1
link=$(readlink -e "%{_bindir}/coin-config")
44f8eb1
if [ "$link" = "%{_bindir}/coin-config" ]; then
44f8eb1
  rm -f %{_bindir}/coin-config
44f8eb1
fi
44f8eb1
if [ "$link" = "%{_libdir}/Coin3/coin-config" ]; then
44f8eb1
  rm -f %{_bindir}/coin-config
44f8eb1
fi
44f8eb1
44f8eb1
/usr/sbin/alternatives --install "%{_bindir}/coin-config" coin-config \
44f8eb1
  "%{_libdir}/Coin3/coin-config" 60 \
44f8eb1
  --slave %{_libdir}/pkgconfig/Coin.pc Coin.pc %{_libdir}/pkgconfig/Coin3.pc \
44f8eb1
  --slave %{_datadir}/aclocal/coin.m4 coin.m4 %{_datadir}/aclocal/coin3.m4 \
44f8eb1
  --slave %{_libdir}/libCoin.so libCoin.so %{_libdir}/libCoin.so.60
44f8eb1
44f8eb1
%preun devel
44f8eb1
if [ $1 = 0 ]; then
44f8eb1
  /usr/sbin/alternatives --remove coin-config "%{_libdir}/Coin3/coin-config"
44f8eb1
fi
44f8eb1
44f8eb1
%files
44f8eb1
%doc AUTHORS COPYING README THANKS FAQ*
44f8eb1
%license LICENSE.GPL
44f8eb1
%dir %{_datadir}/Coin3
44f8eb1
%{_datadir}/Coin3/scxml
44f8eb1
%{_libdir}/libCoin.so.*
44f8eb1
44f8eb1
%files devel
44f8eb1
%ghost %{_bindir}/coin-config
44f8eb1
%{coin_includedir}
44f8eb1
%ghost %{_libdir}/libCoin.so
44f8eb1
%{_datadir}/aclocal/coin3.m4
44f8eb1
%ghost %{_datadir}/aclocal/coin.m4
44f8eb1
%dir %{_datadir}/Coin3
44f8eb1
%{_datadir}/Coin3/draggerDefaults
44f8eb1
%{_datadir}/Coin3/shaders
44f8eb1
%{_libdir}/Coin3
44f8eb1
%{_mandir}/man?/*
44f8eb1
%doc %{coin_htmldir}/Coin
44f8eb1
%{_libdir}/pkgconfig/Coin3.pc
44f8eb1
%ghost %{_libdir}/pkgconfig/Coin.pc
44f8eb1
44f8eb1
%changelog
346517d
* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 3.1.3-12
346517d
- Rebuilt for Boost 1.59
346517d
26aa27d
* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.3-11
26aa27d
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159
26aa27d
c29825c
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 3.1.3-10
c29825c
- rebuild for Boost 1.58
c29825c
f5fb682
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.3-9
f5fb682
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f5fb682
3cd993b
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.1.3-8
3cd993b
- Rebuilt for GCC 5 C++11 ABI change
3cd993b
f1da765
* Wed Feb 25 2015 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-7
f1da765
- Remove %%optflags and %%__global_ld_flags from *.pc and *.cfg.
f1da765
44f8eb1
* Sun Feb 22 2015 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-6
44f8eb1
- Don't use bundled boost-headers.
44f8eb1
- Add %%license.
44f8eb1
44f8eb1
* Fri Feb 20 2015 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-5
44f8eb1
- Fix SoCamera manpage (Add 0011-Fix-SoCamera-manpage.patch).
44f8eb1
- Reflect Fedora > 20 freetype2 header location having changed.
44f8eb1
- More minor spec changes.
44f8eb1
44f8eb1
* Tue Aug 20 2013 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-4
44f8eb1
- Minor spec update.
44f8eb1
44f8eb1
* Fri Apr 19 2013 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-3.20130419.0
44f8eb1
- Rebase patches.
44f8eb1
- Move utf-8 changes into patches.
44f8eb1
- Fix GCC-4.8.0 FTBFS.
44f8eb1
44f8eb1
* Mon Jan 09 2012 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-3
44f8eb1
- Add Coin-3.1.3-gcc-4.7.patch (Address gcc-4.7.0 FTBS).
44f8eb1
- Update spec file copyright/licence.
44f8eb1
- Reflect package being licensed GPLv2.
44f8eb1
- Add Coin-3.1.3-inttypes.patch (Make *-devel multilib compliant;
44f8eb1
  Fix autoconf clashes).
44f8eb1
44f8eb1
* Mon Nov 07 2011 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-2
44f8eb1
- Modernize spec.
44f8eb1
- Don't use bash's "==" in alternatives' scriptlets.
44f8eb1
- Don't ship README.*.
44f8eb1
- Don't add build-time to doxygen generated docs.
44f8eb1
- Eliminate warnings from doxygen-generated manpages.
44f8eb1
44f8eb1
* Sun Dec 26 2010 Ralf Corsépius <corsepiu@fedoraproject.org> - 3.1.3-1
44f8eb1
- Fedora submission.