%define real_name openjpeg Name: openjpeg2 Version: 2.0.0 Release: 1 Summary: JPEG 2000 command line tools Group: Applications/Multimedia License: BSD URL: http://www.openjpeg.org/ Source0: http://openjpeg.googlecode.com/files/%{real_name}-%{version}.tar.gz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: lcms-devel >= 1.19-1 BuildRequires: libpng-devel >= 1.2.46-1 BuildRequires: libtiff-devel >= 3.9.4-2 Requires: lcms >= 1.19-1 Requires: libpng >= 1.2.46-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 %{real_name}-%{version} %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r -qstrict -D_LARGE_FILES" 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" cmake . -DBUILD_SHARED_LIBS:bool=off -DCMAKE_INSTALL_PREFIX=%{_prefix} make # create AIX-style shared library and relink binaries cd bin CreateExportList -X64 %{name}.exp libopenjp2.a ${CC} -qmkshrobj libopenjp2.a -o shr64.o -bE:%{name}.exp -bernotok -lm /usr/bin/rm -f libopenjp2.a opj_* /usr/bin/ar -X64 -q libopenjp2.a shr64.o cd .. 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" cmake . -DBUILD_SHARED_LIBS:bool=off -DCMAKE_INSTALL_PREFIX=%{_prefix} make # create AIX-style shared library and relink binaries cd bin CreateExportList -X32 %{name}.exp libopenjp2.a ${CC} -qmkshrobj libopenjp2.a -o shr.o -bE:%{name}.exp -bernotok -lm /usr/bin/rm -f libopenjp2.a opj_* /usr/bin/ar -X32 -q libopenjp2.a shr.o cd .. 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 ${RPM_BUILD_ROOT}%{_prefix} mv lib lib64 ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : # 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}/libopenjp2.a ../64bit/bin/shr64.o # copy man pages cd doc mv man ${RPM_BUILD_ROOT}%{_prefix}/ ( 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 /usr/lib/*.a %files devel %defattr(-,root,system,-) %doc 32bit/CHANGES 32bit/LICENSE %{_includedir}/* %{_mandir}/man3/* /usr/include/* %changelog * Mon Jul 28 2014 Michael Perzl - 2.0.0-1 - first version for AIX V5.1 and higher