%{!?dotests:%define DO_TESTS 1} %{?dotests:%define DO_TESTS 0} %define _libdir64 %{_libdir}64 Summary: Library of functions for manipulating TIFF format image files Name: libtiff Version: 4.3.0 Release: 1 License: BSD Group: System Environment/Libraries URL: http://www.libtiff.org/ Source0: http://download.osgeo.org/libtiff/tiff-%{version}.tar.gz Source1: tiffconf.h Source2: %{name}.so.3-aix32 Source3: %{name}.so.3-aix64 Source4: %{name}-shr.o-aix32 Source5: %{name}-shr.o-aix64 Patch0: tiff-4.2.0-aix.patch #patch to use /opt/freeware/bin/diff where required since /usr/bin/diff causes these testcases to fail Patch1: libtiff-4.2.0-proper_diff_for_testcases.patch BuildRequires: make >= 4.2.1, libjpeg-devel >= 9d, zlib-devel >= 1.2.11, jbigkit-devel >= 2.1 #needed for some of the testcases to run BuildRequires: diffutils >= 3.7 Requires: libjpeg >= 9d, zlib >= 1.2.11, jbigkit-libs >= 2.1, libgcc >= 8.3.0, xz-libs >= 5.2.5, libstdc++ >= 8.3.0, libwebp >= 1.0.2 %description The libtiff package contains a library of functions for manipulating TIFF (Tagged Image File Format) image format files. TIFF is a widely used file format for bitmapped images. TIFF files usually end in the .tif extension and they are often quite large. The libtiff package should be installed if you need to manipulate TIFF format image files. The library is available as 32-bit and 64-bit. %package devel Summary: Development tools for programs which will use the libtiff library Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: jbigkit-devel >= 2.1 %description devel This package contains the header files and documentation necessary for developing programs which will manipulate TIFF format image files using the libtiff library. If you need to develop programs which will manipulate TIFF format image files, you should install this package. You'll also need to install the libtiff package. 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 -q64" or "gcc -maix64". %prep echo "DO_TESTS=%{DO_TESTS}" %setup -q -n tiff-%{version} find . -name "PaxHeaders.*" -exec rm -r {} \; || true %patch0 -p1 -b .aix %patch1 -p0 # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit mkdir /tmp/%{name}-%{version}-32bit mv * /tmp/%{name}-%{version}-32bit mkdir 32bit mv /tmp/%{name}-%{version}-32bit/* 32bit rm -rf /tmp/%{name}-%{version}-32bit mkdir 64bit cp -rp 32bit/* 64bit/ %build export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:. export LIBPATH= export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIG_ENV_ARGS=/opt/freeware/bin/bash export RM="/usr/bin/rm -f" export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" export CC32="/opt/freeware/bin/gcc -maix32 -O2 -D_LARGE_FILES" export CC64="/opt/freeware/bin/gcc -maix64 -O2" export CXX32="/opt/freeware/bin/g++ -maix32 -O2 -D_LARGE_FILES" export CXX64="/opt/freeware/bin/g++ -maix64 -O2" # first build the 64-bit version cd 64bit export CC=$CC64 export CXX=$CXX64 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" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --libdir=%{_libdir64} \ --enable-shared --enable-static gmake %{?_smp_mflags} if [ "%{DO_TESTS}" == 1 ] then ( gmake -k check || true ) /usr/sbin/slibclean fi cp libtiff/tiffconf.h ../tiffconf-ppc64.h cd .. # now build the 32-bit version cd 32bit export CC=$CC32 export CXX=$CXX32 export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-bmaxdata:0x80000000 -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --enable-static gmake %{?_smp_mflags} if [ "%{DO_TESTS}" == 1 ] then ( gmake -k check || true ) /usr/sbin/slibclean fi cp libtiff/tiffconf.h ../tiffconf-ppc32.h cd .. %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT export RM="/usr/bin/rm -f" # setup environment for 32-bit and 64-bit builds export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" # install 64-bit version export OBJECT_MODE=64 cd 64bit gmake DESTDIR=$RPM_BUILD_ROOT install cd .. # Extract the 64 bit object from the lib cd ${RPM_BUILD_ROOT}%{_libdir64} /usr/bin/ar -X64 xv %{name}.a %{name}.so.5 /usr/bin/ar -X64 xv %{name}xx.a %{name}xx.so.5 cd - # Rename executables ( cd ${RPM_BUILD_ROOT}%{_bindir}/ for f in $(ls -1| grep -v -e _32 -e _64) do mv $f "$f"_64 done ) # install 32-bit version export OBJECT_MODE=32 cd 32bit gmake DESTDIR=$RPM_BUILD_ROOT install cd .. # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objectsand extract the 32 bit shared objets cd ${RPM_BUILD_ROOT}%{_libdir} /usr/bin/ar -q -X64 %{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so.5 /usr/bin/ar -q -X64 %{name}xx.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}xx.so.5 /usr/bin/ar -X32 -xv %{name}.a %{name}.so.5 /usr/bin/ar -X32 -xv %{name}xx.a %{name}xx.so.5 cd - # Rename executables ( cd ${RPM_BUILD_ROOT}%{_bindir}/ for f in $(ls -1| grep -v -e _32 -e _64) do mv $f "$f"_32 ln -sf "$f"_64 $f done ) # Add the older version 3 shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') for SOURCE in %{SOURCE2} %{SOURCE3}; do BITS=`echo $SOURCE | sed -e "s/.*-aix\([0-9]*\)\$/\1/"` SO_NAME=`basename $SOURCE | sed -e "s/-aix\([0-9]*\)\$//"` ARCHIVE_NAME=`echo $SO_NAME | sed -e "s/so.[0-9]*\$/a/"` cp ${SOURCE} ${SO_NAME} /usr/bin/strip -X${BITS} -e ${SO_NAME} if [ ${BITS} == "64" ]; then /usr/bin/ar -X${BITS} -q ${RPM_BUILD_ROOT}%{_libdir64}/${ARCHIVE_NAME} ${SO_NAME} /usr/bin/ar -X${BITS} -q ${RPM_BUILD_ROOT}%{_libdir}/${ARCHIVE_NAME} ${SO_NAME} cp ${SO_NAME} ${RPM_BUILD_ROOT}%{_libdir64} cp ${SO_NAME} ${RPM_BUILD_ROOT}%{_libdir} else /usr/bin/ar -X${BITS} -q ${RPM_BUILD_ROOT}%{_libdir}/${ARCHIVE_NAME} ${SO_NAME} cp ${SO_NAME} ${RPM_BUILD_ROOT}%{_libdir} fi done ( cp %{SOURCE4} shr.o /usr/bin/strip -X32 -e shr.o /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/libtiff.a shr.o ) ( cp %{SOURCE5} shr.o /usr/bin/strip -X64 -e shr.o /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir64}/libtiff.a shr.o /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libtiff.a shr.o ) # add AIX Toolbox compatibility members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') for LIB in %{name} %{name}xx; do for BITS in 32 64; do cd ${RPM_BUILD_ROOT}%{_libdir}`echo ${BITS} | grep 64` cp ${LIB}.so.5 shr.o /usr/bin/strip -X${BITS} -e shr.o if [ ${BITS} == "64" ]; then /usr/bin/ar -q -X${BITS} ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a shr.o /usr/bin/ar -q -X${BITS} ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.a shr.o else /usr/bin/ar -q -X${BITS} ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a shr.o fi cd - done done cp tiffconf-ppc??.h $RPM_BUILD_ROOT%{_includedir}/ cp %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/ chmod 644 $RPM_BUILD_ROOT%{_includedir}/*.h /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || : # Create some symbolic links cd ${RPM_BUILD_ROOT} mkdir -p usr/bin mkdir usr/lib mkdir usr/include LINKS=`cd ${RPM_BUILD_ROOT}/opt/freeware ; ls -1 bin/* lib/*.a lib/*.la include/*.h` for LINK in $LINKS; do if [ ! -e /usr/$LINK ] || [ x`ls -l /usr/$LINK | grep -v "/opt/freeware/$LINK"` == "x" ]; then ln -sf /opt/freeware/$LINK ${RPM_BUILD_ROOT}/usr/$LINK else echo "Warning: /usr/$LINK already exists and is not a link to /opt/freeware/$LINK" fi done %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/COPYRIGHT 32bit/README.md 32bit/RELEASE-DATE 32bit/VERSION %{_bindir}/* %{_libdir}/*.a %{_libdir64}/*.a %{_mandir}/man1/* %files devel %defattr(-,root,system,-) %doc 32bit/TODO 32bit/ChangeLog 32bit/html %{_includedir}/* %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %{_mandir}/man3/* %changelog * Wed Apr 13 2022 Sangeetha Bando - 4.3.0-1 - Updated to fix CVE-2022-0561 & CVE-2022-0562 - Not shipping files in /usr directory any longer * Thu Apr 08 2021 Rishita Saha - 4.2.0-1 - Updated to fix CVE-2020-35522 and CVE-2020-35523 - Not shipping files in /usr directory any longer * Fri May 29 2020 Baanu Tumma - 4.1.0-1 - Updated to latest version for AIX machine * Thu Jun 9 2016 Matthieu Sarter - 4.0.6-2 - Added the .so files * Tue Apr 26 2016 Matthieu Sarter - 4.0.6-1 - Update to version 4.0.6 * Thu Jun 21 2012 Gerard Visiedo - 4.0.1 - Update to version 4.0.1 * Thu Feb 02 2012 Gerard Visiedo - 3.9.5-1 - Initial port on Aix6.1 * Fri Oct 14 2011 Gerard Visiedo - 3.9.5-2 - rebuild for compatibility with new libiconv.a 1.13.1-2 * Mon Sep 12 2011 Gerard Visiedo - 3.9.5-1 - Initial port on Aix5.3