Name: openjpeg Version: 1.4 Release: 1 Summary: JPEG 2000 command line tools Group: Applications/Multimedia License: BSD URL: http://www.openjpeg.org/ Source0: http://openjpeg.googlecode.com/files/openjpeg_v1_4_sources_r697.tgz Patch0: %{name}-%{version}-aix.patch ## upstreamable patches # libopenjpeg has undefined references, http://bugzilla.redhat.com/467661 # http://groups.google.com/group/openjpeg/browse_thread/thread/fba9ad2a35b12e6a Patch50: %{name}-%{version}-no_undefined.patch # fix autoconf buildsys (+DESTDIR support mostly) # http://groups.google.com/group/openjpeg/browse_thread/thread/6326363ebb969a99 Patch52: %{name}-%{version}-autoconf.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: automake, libtool, patch BuildRequires: lcms-devel >= 1.19-1 BuildRequires: libpng-devel >= 1.2.44-1 BuildRequires: libtiff-devel >= 3.9.4-2 Requires: lcms >= 1.19-1 Requires: libpng >= 1.2.44-1 Requires: libtiff >= 3.9.4-2 %define _libdir64 %{_prefix}/lib64 %description OpenJPEG is an open-source JPEG 2000 codec written in C. It has been developed in order to promote the use of JPEG 2000, the new still-image compression standard from the Joint Photographic Experts Group (JPEG). %package libs Summary: JPEG 2000 codec runtime library Group: System Environment/Libraries %description libs The %{name}-libs package contains runtime libraries for applications that use OpenJPEG. %package devel Summary: Development files for openjpeg Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use OpenJPEG. %prep %setup -q -n openjpeg_v1_4_sources_r697 # make sure we use system libraries rm -rf libs export PATH=/opt/freeware/bin:$PATH %patch0 %patch50 -p1 -b .no_undefined %patch52 -p1 -b .autoconf autoreconf -i -f # fake a as AIX5L V5.1 and XLC/C++ V7 doesn't have one cat > stdbool.h << EOF #ifndef stdbool_h_wrapper #define stdbool_h_wrapper typedef enum {false = 0, true = 1} bool; #endif EOF mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build export CC="cc -qcpluscmt" export PATH=/opt/freeware/bin:$PATH 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} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-png=yes \ --enable-tiff=yes \ --enable-lcms2=no \ --enable-lcms1=yes \ --enable-jp3d=no # smp build busted make 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} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-png=yes \ --enable-tiff=yes \ --enable-lcms2=no \ --enable-lcms1=yes \ --enable-jp3d=no # smp build busted make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( 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}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.so* # we need uncompressed man pages gunzip ${RPM_BUILD_ROOT}%{_mandir}/man?/*.gz ( cd ${RPM_BUILD_ROOT} for dir in bin 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/CHANGES 32bit/LICENSE %{_bindir}/* %{_mandir}/man1/* /usr/bin/* %files libs %defattr(-,root,system,-) %doc 32bit/CHANGES 32bit/LICENSE %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/CHANGES 32bit/LICENSE %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* %{_mandir}/man3/* /usr/include/* %changelog * Thu Feb 03 2011 Michael Perzl - 1.4-1 - updated to version 1.4 - enabled shared libraries, added 64-bit libraries * Thu May 27 2010 Michael Perzl - 1.3-1 - first version for AIX V5.1 and higher