Summary: A library of functions for manipulating PNG image format files. Name: libpng Version: 1.2.1 Release: 3 License: IBM_ILA URL: http://www.libpng.org/pub/png/libpng.html Group: System Environment/Libraries Source0: ftp://ftp.uu.net/graphics/png/src/libpng-%{version}.tar.gz Source1: libpng.so.2 Source2: IBM_ILA Patch0: libpng-1.2.0-makefile.patch Prefix: %{_prefix} Buildroot: /var/tmp/libpng-root %define LIBVER 2.%{version} Serial: 1 %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 libpng package contains a library of functions for creating and manipulating PNG (Portable Network Graphics) image format files. PNG is a bit-mapped graphics format similar to the GIF format. PNG was created to replace the GIF format, since GIF uses a patented data compression algorithm. Libpng should be installed if you need to manipulate PNG format image files. %package devel Summary: Development tools for programs to manipulate PNG image format files. Group: Development/Libraries Requires: libpng = %{serial}:%{PACKAGE_VERSION} Serial: 1 %description devel The libpng-devel package contains the header files and static libraries necessary for developing programs using the PNG (Portable Network Graphics) library. If you want to develop programs which will manipulate PNG image format files, you should install libpng-devel. You'll also need to install the libpng package. %prep %setup -q %patch0 -p1 # Add license info cat $RPM_SOURCE_DIR/IBM_ILA > LICENSE.new cat LICENSE >> LICENSE.new mv LICENSE.new LICENSE %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 %{name}-%{version} %patch0 -p1 %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::'` fi if [[ "$CC" = "gcc" ]] then export SHAREDFLAG="-shared" else export SHAREDFLAG="-G" fi export OBJECT_MODE=32 #just to be sure cp scripts/makefile.linux ./makefile make CC="$CC" CFLAGS="$RPM_OPT_FLAGS" SHAREDFLAG=$SHAREDFLAG ZLIBLIB=%{_prefix}/lib ZLIBINC=%{_prefix}/include # We need to add libpng.so.2 for older apps that linked statically with # libpng.a(libpng.so.2) cp %{SOURCE1} . /usr/bin/strip -e libpng.so.2 rm libpng.a # Static library; we'll replace it. ar -crv libpng.a libpng.so.2 # Create a compatibility member to mitigate differences with Bull Freeware # offering COMPATMEMBER=shr.o echo "#!libpng.a(libpng.so.2)" > tmp.exp /usr/bin/dump -Tv libpng.a |/usr/bin/awk 'match($4,"EXP|Exp") { print $NF }' >> tmp.exp ld -L. -bI:tmp.exp -bE:tmp.exp -lpng -bM:SRE -bnoentry -o $COMPATMEMBER /usr/bin/strip -e $COMPATMEMBER # Make shr.o a load-only module ar -r libpng.a $COMPATMEMBER # Add current level shared object to the library /usr/bin/ar -r libpng.a libpng.so.3 %if %{BUILD64} == 1 # Now build again as 64bit ########################### cd 64bit/%{name}-%{version} export OBJECT_MODE=64 cp scripts/makefile.linux ./makefile make CC="$CC" CFLAGS="$RPM_OPT_FLAGS" SHAREDFLAG=$SHAREDFLAG ZLIBLIB=%{prefix64}/lib ZLIBINC=%{prefix64}/include # Go back to 32-bit library and add our 64bit shared object # into same archive cd ../.. /usr/bin/ar -q libpng.a 64bit/%{name}-%{version}/libpng.so.3 %endif #BUILD64 %install rm -rf $RPM_BUILD_ROOT # Potential loop if building 64-bit libraries for IA64 INSTDIR=%{_prefix} for dir in lib include do mkdir -p $RPM_BUILD_ROOT$INSTDIR/$dir done make install prefix=$RPM_BUILD_ROOT$INSTDIR mkdir -p $RPM_BUILD_ROOT$INSTDIR/man/man3 mkdir -p $RPM_BUILD_ROOT$INSTDIR/man/man5 install -c -m 644 *.3 $RPM_BUILD_ROOT$INSTDIR/man/man3 install -c -m 644 *.5 $RPM_BUILD_ROOT$INSTDIR/man/man5 (cd $RPM_BUILD_ROOT mkdir -p usr/lib mkdir -p usr/include cd usr/include ln -sf ../..%{prefix}/include/* . cd - cd usr/lib ln -sf ../..%{prefix}/lib/* . ) %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(-,root,root) %doc *.txt example.c README TODO CHANGES LICENSE %{_prefix}/man/man5/* %{_prefix}/lib/libpng.a /usr/lib/libpng.a %if %{BUILD64} == 1 %dir %{prefix64} %dir %{prefix64}/lib %{prefix64}/lib/libpng.a %endif %files devel %defattr(-,root,root) %doc LICENSE %{_prefix}/include/* %{_prefix}/man/man3/* /usr/include/* %clean rm -rf $RPM_BUILD_ROOT %changelog * Mon Feb 16 2004 David Clissold 1.2.1-3 - Build 64-bit library. * Fri Nov 22 2002 David Clissold - Add IBM ILA license. * Fri Feb 08 2002 Marc Stephenson - New version * Fri Sep 21 2001 David Clissold - Update to level 1.2.0 * Fri Mar 23 2001 David Clissold - %files needs to pick up ia64l32/libpng.so.2 ; using wildcard * Thu Mar 22 2001 Marc Stephenson - Build both 32- and 64-bit libraries * Thu Mar 08 2001 Marc Stephenson - Add logic for default compiler - Rebuild against new shared objects * Fri Feb 16 2001 aixtoolbox - Account for different standard lib location in IA64 32-bit ABI * Fri Feb 11 2000 Nalin Dahyabhai - move buildroot and add URL * Sat Feb 5 2000 Bernhard Rosenkränzer - strip library - rebuild to compress man pages * Sun Nov 21 1999 Bernhard Rosenkränzer - 1.0.5 - some tweaks to spec file to make updating easier - handle RPM_OPT_FLAGS * Mon Sep 20 1999 Matt Wilson - changed requires in libpng-devel to include serial - corrected typo * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 2) * Sun Feb 07 1999 Michael Johnson - rev to 1.0.3 * Thu Dec 17 1998 Cristian Gafton - build for 6.0 * Wed Sep 23 1998 Cristian Gafton - we are Serial: 1 now because we are reverting the 1.0.2 version from 5.2 beta to this prior one - install man pages; set defattr defaults * Thu May 07 1998 Prospector System - translations modified for de, fr, tr * Thu Apr 30 1998 Cristian Gafton - devel subpackage moved to Development/Libraries * Wed Apr 08 1998 Cristian Gafton - upgraded to 1.0.1 - added buildroot * Tue Oct 14 1997 Donnie Barnes - updated to new version - spec file cleanups * Thu Jul 10 1997 Erik Troan - built against glibc