Summary: Abraction/convenience libraries 
Name:	 ilmbase 
Version: 2.2.0
Release: 2%{?_dist_release}

Group:	 System Environment/Libraries
License: BSD
URL:	 http://www.openexr.com/

Source0: http://download.savannah.nongnu.org/releases/openexr/ilmbase-%{version}.tar.gz
## upstreamable patches
# explicitly add $(PTHREAD_LIBS) to libIlmThread linkage (helps PTHREAD_LIBS workaround in %%build)
Patch51: ilmbase-2.2.0-no_undefined.patch
# add Requires.private: gl glu to IlmBase.pc
Patch53:  ilmbase-1.0.3-pkgconfig.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: pkgconfig
# silly rpm, won't pick up rpm dependencies for items not in it's buildroot
# see http://bugzilla.redhat.com/866302
BuildRequires: libGL-devel
BuildRequires: libGLU-devel

Vendor: Project Vine
Distribution: Vine Linux

%description
Half is a class that encapsulates the ilm 16-bit floating-point format.

IlmThread is a thread abstraction library for use with OpenEXR
and other software packages.

Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices, quaternions
and other useful 2D and 3D math functions.

Iex is an exception-handling library.

%package devel
Summary: Headers and libraries for building apps that use %{name} 
Summary(ja): %{name} を使うアプリケーションをビルドするためのヘッダファイル及びライブラリ
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig

%description devel
%{summary}.


%prep
%setup -q
%patch51 -p1 -b .no_undefined
%patch53 -p1 -b .pkgconfig

%build
%configure --disable-static

# manually set PTHREAD_LIBS to include -lpthread until libtool bogosity is fixed,
# https://bugzilla.redhat.com/show_bug.cgi?id=661333
make %{?_smp_mflags} PTHREAD_LIBS="-pthread -lpthread"


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"

rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.la


%check
export PKG_CONFIG_PATH=$RPM_BUILD_ROOT%{_datadir}/pkgconfig:$RPM_BUILD_ROOT%{_libdir}/pkgconfig
test "$(pkg-config --modversion IlmBase)" = "%{version}"
%ifarch %{ix86}
make check ||:
%else
make check
%endif


%clean
rm -rf $RPM_BUILD_ROOT


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_libdir}/lib*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/OpenEXR/
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*


%changelog
* Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.0-2
- rebuild with gcc-5.4.0

* Wed Dec 17 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.2.0-1
- update to 2.2.0
- added Patch51 and 53 from Fedora

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.1.0-1
- update to 2.1.0
- remove Patch50

* Tue Sep 21 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.2-1
- updated to 1.0.2
- rebuilt with rpm-4.8.1

* Mon Oct 06 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.1-1
- initial build for Vine Linux

* Fri Feb 08 2008 Rex Dieter <rdieter@fedoraproject.org> 1.0.1-2
- respin (gcc43)

* Mon Jan 07 2008 Rex Dieter <rdieter[AT]fedoraproject.org> 1.0.1-1
- ilmbase-1.0.1

* Fri Oct 12 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.0.0-3
- include *.tar.sig in sources

* Mon Oct 08 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.0.0-2
- update %%summary
- -devel: +Requires: libGL-devel libGLU-devel
- make install ... INSTALL="install -p" to preserve timestamps


* Thu Aug 09 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.0.0-1
- ilmbase-1.0.0 (first try)

