Name: libmng Version: 2.0.2 Release: 1 URL: http://www.libmng.com/ Summary: Library for Multiple-image Network Graphics support License: BSD-like Source0: http://dl.sf.net/libmng/%{name}-%{version}.tar.gz Source1: libmng.so.1-aix32 Source2: libmng.so.1-aix64 Patch0: %{name}-%{version}-aix.patch Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: lcms-devel >= 1.19-1 BuildRequires: libjpeg-devel >= 9b-2 BuildRequires: zlib-devel >= 1.2.3-7 Requires: lcms >= 1.19-1 Requires: libjpeg >= 9b-2 Requires: zlib >= 1.2.3-7 %define _libdir64 %{_prefix}/lib64 %description LibMNG is a library for accessing graphics in MNG (Multi-image Network Graphics) and JNG (JPEG Network Graphics) formats. MNG graphics are basically animated PNGs. JNG graphics are basically JPEG streams integrated into a PNG chunk. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for the Multiple-image Network Graphics library Group: Development/Libraries Requires: %{name} = %{version} Requires: lcms-devel Requires: libjpeg-devel Requires: zlib-devel %description devel LibMNG is a library for accessing MNG and JNG format graphics. The libmng-devel package contains files needed for developing or compiling applications which use MNG graphics. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc_r -q64" or "gcc -maix64". %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --with-zlib=%{_prefix} \ --with-jpeg=%{_prefix} \ --with-lcms=%{_prefix} make %{?_smp_mflags} cd ../32bit # now build the 32-bit export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --with-zlib=%{_prefix} \ --with-jpeg=%{_prefix} \ --with-lcms=%{_prefix} 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 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so* # Add the older 1.0.10 shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') cp %{SOURCE1} libmng.so.1 /usr/bin/strip -X32 -e libmng.so.1 /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a libmng.so.1 cp %{SOURCE2} libmng.so.1 /usr/bin/strip -X64 -e libmng.so.1 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a libmng.so.1 ( cd $RPM_BUILD_ROOT for dir in lib lib64 include 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,-) %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* %{_includedir}/* %{_mandir}/man3/* %{_mandir}/man5/* /usr/lib/*.la /usr/lib64/*.la /usr/include/* %changelog * Wed Dec 14 2016 Michael Perzl - 2.0.2-1 - updated to version 2.0.2 * Tue Mar 18 2008 Michael Perzl - 1.0.10-1 - first version for AIX V5.1 and higher