%define prefix /opt/freeware %define _defaultdocdir %{_prefix}/doc Summary: A library of functions for manipulating TIFF format image files. Name: libtiff Version: 3.8.2 Release: 1 License: distributable Group: System Environment/Libraries Source0: http://www.libtiff.org/tiff-%{version}.tar.gz Patch0: tiff-3.8.2-aix.patch URL: http://www.libtiff.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: zlib-devel zlib libjpeg-devel libjpeg %define DEFCC cc # Use --define 'no64 1' on the command line to disable 64bit build %{!?no64:%define BUILD64 1} %{?no64:%define BUILD64 0} %define prefix64 %{_prefix}/64 %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. %package devel Summary: Development tools for programs which will use the libtiff library. Group: Development/Libraries Requires: libtiff %description devel This package contains the header files and static libraries for developing programs which will manipulate TIFF format image files using the libtiff library. This package also requires the libtiff package. %prep %setup -q -n tiff-%{version} if test x$PATCH = x ; then PATCH=patch ; fi $PATCH -p3 -s < %{_sourcedir}/tiff-3.8.2-aix.patch %if %{BUILD64} == 1 # Prep 64-bit build in 64bit subdirectory ########################################## # Test whether we can run a 64bit command so we don't waste our time /usr/bin/locale64 >/dev/null 2>&1 mkdir 64bit cd 64bit gzip -dc %{SOURCE0} |tar -xf - cd tiff-%{version} $PATCH -p3 -s < %{_sourcedir}/tiff-3.8.2-aix.patch %endif %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} else export CC=gcc fi fi if [[ "$CC" != "gcc" ]] then # export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` export CFLAGS="$RPM_OPT_FLAGS -qcpluscmt " fi INSTDIR=%{_prefix} export OBJECT_MODE=32 #./configure --prefix=%{prefix} --with-GCOPTS="-s $CFLAGS" << EOF export CFLAGS="-qcpluscmt -O2" chmod +x ./configure ./configure --prefix=%{prefix} << EOF no $RPM_BUILD_ROOT/%{prefix}/bin $RPM_BUILD_ROOT/%{prefix}/lib $RPM_BUILD_ROOT/%{prefix}/include $RPM_BUILD_ROOT/%{prefix}/man $RPM_BUILD_ROOT/var/local/httpd/htdocs/tiff bsd-source-cat yes EOF make cd ./libtiff make AIXdso32 %if %{BUILD64} == 1 # Now build again as 64bit ########################### cd ../64bit/tiff-%{version} export OBJECT_MODE=64 export CFLAGS="-qcpluscmt -O2" chmod +x ./configure export LDFLAGS="-q64" ./configure --prefix=%{prefix} make cd ./libtiff make AIXdso64 # Go back to 32-bit library and add our 64bit shared object # into same archive cd ../../.. /usr/bin/ar -q libtiff/.libs/libtiff.a ./64bit/tiff-%{version}/libtiff/shr.o /usr/bin/ar -q libtiff/.libs/libtiff.a ./64bit/tiff-%{version}/libtiff/.libs/libtiff.so.3 %endif #BUILD64 %install if test "%{buildroot}" != "/"; then rm -rf %{buildroot} fi export OBJECT_MODE=32 INSTDIR=%{_prefix} for dir in usr/lib usr/include usr/bin \ .$INSTDIR/lib .$INSTDIR/include .$INSTDIR/bin .$INSTDIR/man/man1 do mkdir -p $RPM_BUILD_ROOT/$dir done #export OBJECT_MODE=32 chmod +x ./config/install-sh make DESTDIR=$RPM_BUILD_ROOT install cd libtiff/.libs install -M644 -f $RPM_BUILD_ROOT$INSTDIR/lib libtiff.a strip $RPM_BUILD_ROOT%{prefix}/bin/* || : ( cd $RPM_BUILD_ROOT for dir in bin include lib do mkdir -p usr/$dir cd usr/$dir ln -sf ../..%{prefix}/$dir/* . cd - done ) %if %{BUILD64} == 1 #Add links for 64-bit library members ( mkdir -p $RPM_BUILD_ROOT/%{prefix64}/lib cd $RPM_BUILD_ROOT/%{prefix64}/lib ln -s ../../lib/*.a . ) %endif %files %defattr(0755,root,system) %{_bindir}/* /usr/bin/* %{_libdir}/libtiff.a /usr/lib/libtiff.a %{_prefix}/64/lib/libtiff.a %if %{BUILD64} == 1 %attr(755,bin,bin) %dir /%{prefix64} %attr(755,bin,bin) %dir /%{prefix64}/lib %endif %files devel %defattr(-,root,system) %doc COPYRIGHT README TODO VERSION html/* %{_includedir}/* /usr/include/* %{_mandir}/* %changelog * Mon Jan 19 2009 IBM - Release 1 - New version version: 3.8.2 * Wed Nov 15 2006 BULL - Release 7 - gnome 2.16.1 * Mon Sep 18 2006 BULL - Release 6 - support 64 bits * Thu Feb 09 2006 BULL - Release 5 - New version version: 3.6.1 - Added support 64 bits * Fri Dec 23 2005 BULL - Release 4 - Prototype gtk 64 bit * Wed Nov 16 2005 BULL - Release 3 * Mon May 30 2005 BULL - Release 2 - .o removed from lib * Mon May 25 2005 BULL - Release 1 - New version version: 3.6.1