%define _libdir64 %{_prefix}/lib64 Name: ilmbase Version: 1.0.2 Release: 1 Summary: Abstraction/convenience libraries Group: System Environment/Libraries License: BSD URL: http://www.openexr.com/ Source0: http://download.savannah.nongnu.org/releases/openexr/%{name}-%{version}.tar.gz Source1: http://download.savannah.nongnu.org/releases/openexr/%{name}-%{version}.tar.gz.sig Patch0: %{name}-%{version}-aix.patch Patch1: %{name}-%{version}-aix51.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: pkg-config, patch %ifos aix5.1 Requires: AIX-rpm >= 5.1.0.0 Requires: AIX-rpm < 5.2.0.0 %endif %ifos aix5.2 | %ifos aix5.3 | %ifos aix6.1 | %ifos aix7.1 Requires: AIX-rpm >= 5.2.0.0 %endif ## upstreamable patches # missing #include Patch2: ilmbase-1.0.2-cstring.patch %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} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel %{summary}. %prep %setup -q %patch0 %ifos aix5.1 %patch1 %endif export PATH=/opt/freeware/bin:$PATH %patch2 -p1 -b .cstring mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" export CXX="xlC_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-shared --disable-static make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for i in Half Iex IlmThread Imath ; do /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib${i}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib${i}.so* done ( cd ${RPM_BUILD_ROOT} for dir in include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/ChangeLog 32bit/COPYING 32bit/NEWS 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc /usr/lib/*.la /usr/lib64/*.la %changelog * Tue Jan 11 2011 Michael Perzl - 1.0.2-1 - first version for AIX V5.1 and higher