%define LIBVER 62.0.0 Summary: A library for manipulating JPEG image format files. Name: libjpeg Version: 6b Release: 6 License: IBM_ILA URL: http://www.ijg.org Group: System Environment/Libraries Source0: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz Source1: IBM_ILA Patch0: jpeg-6b-aixltconf.patch Prefix: %{_prefix} Buildroot: /var/tmp/libjpeg-root %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 %package devel Summary: Development tools for programs which will use the libjpeg library. Group: Development/Libraries Requires: libjpeg %description The libjpeg package contains a library of functions for manipulating JPEG images, as well as simple client programs for accessing the libjpeg functions. Libjpeg client programs include cjpeg, djpeg, jpegtran, rdjpgcom and wrjpgcom. Cjpeg compresses an image file into JPEG format. Djpeg decompresses a JPEG file into a regular image file. Jpegtran can perform various useful transformations on JPEG files. Rdjpgcom displays any text comments included in a JPEG file. Wrjpgcom inserts text comments into a JPEG file. %description devel The libjpeg-devel package includes the header files and static libraries necessary for developing programs which will manipulate JPEG files using the libjpeg library. If you are going to develop programs which will manipulate JPEG images, you should install libjpeg-devel. You'll also need to have the libjpeg package installed. %prep %setup -q -n jpeg-6b %patch0 -p1 -b .aixlt # Add license info cat $RPM_SOURCE_DIR/IBM_ILA > LICENSE cat README >> 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 jpeg-%{version} %patch0 -p1 -b .aixlt %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 test "X$CC" != "Xgcc" then export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` export CFLAGS="$RPM_OPT_FLAGS" fi export OBJECT_MODE=32 #just to be sure %define optflag "$RPM_OPT_FLAGS" %configure \ --enable-shared --enable-static --prefix=$RPM_BUILD_ROOT%{_prefix} \ --exec_prefix=$RPM_BUILD_ROOT%{_prefix} make ##LIBPATH=$PWD make test %if %{BUILD64} == 1 # Now build again as 64bit ########################### cd 64bit/jpeg-%{version} export OBJECT_MODE=64 %configure \ --enable-shared --enable-static --prefix=$RPM_BUILD_ROOT%{prefix64} \ --exec_prefix=$RPM_BUILD_ROOT%{prefix64} make ##LIBPATH=$PWD make test # Go back to 32-bit library and add our 64bit shared object # into same archive cd ../../.libs /usr/bin/ar -q libjpeg.a ../64bit/jpeg-%{version}/.libs/libjpeg.so.* %endif #BUILD64 %install rm -rf $RPM_BUILD_ROOT for i in lib include bin man/man1 do mkdir -p $RPM_BUILD_ROOT%{_prefix}/$i done make prefix=$RPM_BUILD_ROOT%{_prefix} install /usr/bin/strip $RPM_BUILD_ROOT%{_prefix}/bin/* || : (cd $RPM_BUILD_ROOT for dir in bin include do mkdir -p usr/$dir cd usr/$dir ln -sf ../..%{prefix}/$dir/* . cd - done mkdir -p usr/lib cd usr/lib ln -sf ../..%{prefix}/lib/* . ) ( cd $RPM_BUILD_ROOT/%{prefix}/lib # Create a compatibility member to mitigate differences with Bull Freeware # offering COMPATMEMBER=shr.o for lib in *.a do /usr/bin/dump -Tv $lib |/usr/bin/awk 'match($4,"EXP|Exp") { print $NF }' > tmp.exp libbase=`print $lib | sed -e 's/.a$//' -e 's/^lib//'` ld -L. -bI:tmp.exp -bE:tmp.exp -l$libbase -bM:SRE -bnoentry -o $COMPATMEMBER /usr/bin/strip -e $COMPATMEMBER # Make shr.o a load-only module /usr/bin/ar -r $lib $COMPATMEMBER rm -f $COMPATMEMBER tmp.exp 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 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc usage.doc LICENSE %{_prefix}/bin/* /usr/bin/* %{_prefix}/lib/*.a /usr/lib/*.a %{_prefix}/man/*/* %if %{BUILD64} == 1 %dir %{prefix64} %dir %{prefix64}/lib %{prefix64}/lib/libjpeg.a %endif %files devel %defattr(-,root,root) %doc libjpeg.doc coderules.doc LICENSE %{_prefix}/include/*.h /usr/include/*.h %changelog * Thu Feb 12 2004 David Clissold 6b-6 - Build 64-bit object. * Fri Nov 22 2002 David Clissold - Add IBM ILA license. * Wed Mar 07 2001 Marc Stephenson - Update to libtool 1.3.5a - Add logic for default compiler - Add compatibility member for Bull freeware * Fri Feb 16 2001 aixtoolbox - Account for different standard lib location in IA64 32-bit ABI * Fri Oct 27 2000 pkgmgr - Modify for AIX Freeware distribution * Sat Feb 5 2000 Bernhard Rosenkränzer - rebuild to get compressed man pages - fix description - some minor tweaks to the spec file - add docs - fix build on alpha (alphaev6 stuff) * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 9) * Wed Jan 13 1999 Cristian Gafton - patch to build on arm - build for glibc 2.1 * Mon Oct 12 1998 Cristian Gafton - strip binaries * Mon Aug 3 1998 Jeff Johnson - fix buildroot problem. * Tue Jun 09 1998 Prospector System - translations modified for de * Thu Jun 04 1998 Marc Ewing - up to release 4 - remove patch that set (improper) soname - libjpeg now does it itself * Thu May 07 1998 Prospector System - translations modified for de, fr, tr * Fri May 01 1998 Cristian Gafton - fixed build on manhattan * Wed Apr 08 1998 Cristian Gafton - upgraded to version 6b * Wed Oct 08 1997 Donnie Barnes - new package to remove jpeg stuff from libgr and put in it's own package