From 8b34992d2b7b6f274e03e243d928c7ad599e2daf Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 12 Feb 2007 16:16:05 +0000 Subject: [PATCH] Update to libpng 1.2.16, respond to Fedora merge review comments. --- .cvsignore | 2 +- libpng-multilib.patch | 20 ++++++++++++ libpng-pngconf.patch | 53 +++++++++++++++++++++++++++++++ libpng.spec | 73 +++++++++++++++++++++++++++---------------- sources | 2 +- 5 files changed, 121 insertions(+), 29 deletions(-) create mode 100644 libpng-multilib.patch create mode 100644 libpng-pngconf.patch diff --git a/.cvsignore b/.cvsignore index 3ce69ab..aaaefd7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -libpng-1.2.10.tar.bz2 +libpng-1.2.16.tar.bz2 diff --git a/libpng-multilib.patch b/libpng-multilib.patch new file mode 100644 index 0000000..fba135e --- /dev/null +++ b/libpng-multilib.patch @@ -0,0 +1,20 @@ +diff -Naur libpng-1.2.16.orig/scripts/libpng-config.in libpng-1.2.16/scripts/libpng-config.in +--- libpng-1.2.16.orig/scripts/libpng-config.in 2007-01-04 14:00:25.000000000 -0500 ++++ libpng-1.2.16/scripts/libpng-config.in 2007-02-12 10:25:43.000000000 -0500 +@@ -8,11 +8,11 @@ + + # Modeled after libxml-config. + +-version="@PNGLIB_VERSION@" +-prefix="@prefix@" +-exec_prefix="@exec_prefix@" +-libdir="@libdir@" +-includedir="@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@" ++version=`pkg-config --modversion libpng` ++prefix=`pkg-config --variable prefix libpng` ++exec_prefix=`pkg-config --variable exec_prefix libpng` ++libdir=`pkg-config --variable libdir libpng` ++includedir=`pkg-config --variable includedir libpng` + libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@" + all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ -lz -lm" + I_opts="-I${includedir}" diff --git a/libpng-pngconf.patch b/libpng-pngconf.patch new file mode 100644 index 0000000..427f319 --- /dev/null +++ b/libpng-pngconf.patch @@ -0,0 +1,53 @@ +diff -Naur libpng-1.2.16.orig/configure libpng-1.2.16/configure +--- libpng-1.2.16.orig/configure 2007-01-31 08:22:51.000000000 -0500 ++++ libpng-1.2.16/configure 2007-02-12 10:29:04.000000000 -0500 +@@ -20558,6 +20558,7 @@ + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ ++#define PNG_CONFIGURE_LIBPNG + #include "pnggccrd.c" + int + main () +diff -Naur libpng-1.2.16.orig/configure.ac libpng-1.2.16/configure.ac +--- libpng-1.2.16.orig/configure.ac 2007-01-31 08:22:41.000000000 -0500 ++++ libpng-1.2.16/configure.ac 2007-02-12 10:29:04.000000000 -0500 +@@ -62,7 +62,8 @@ + AC_MSG_CHECKING( + [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE]) + AC_TRY_COMPILE( +- [#include "pnggccrd.c"], ++ [#define PNG_CONFIGURE_LIBPNG ++ #include "pnggccrd.c"], + [return 0;], + AC_MSG_RESULT(yes) + LIBPNG_NO_MMX="", +diff -Naur libpng-1.2.16.orig/pngconf.h libpng-1.2.16/pngconf.h +--- libpng-1.2.16.orig/pngconf.h 2007-01-31 08:22:33.000000000 -0500 ++++ libpng-1.2.16/pngconf.h 2007-02-12 10:31:39.000000000 -0500 +@@ -35,6 +35,25 @@ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif ++#else ++/* pngconf.h is part of the exported API. When a libpng-using application ++ includes us, PNG_CONFIGURE_LIBPNG is of course not defined as we do not have ++ libpng's config.h available in this case. This means that we do not have the ++ defines added to config.h and the commandline by libpng's ./configure . ++ ++ For all defines from config.h not having them set is not a problem, however ++ ./configure also adds -DPNG_NO_ASSEMBLER_CODE to the CFLAGS when compiling ++ on a platform on which the MMX and SSE asm code in libpng is not supported. ++ ++ We do need this define as this define is used to determine whether or not ++ to define PNG_ASSEMBLER_CODE_SUPPORTED and other assembler related defines ++ and prototypes. PNG_ASSEMBLER_CODE_SUPPORTED in turn is used by applications ++ (ImageMagick for example) to determine whether or not they can use the asm ++ functions. Thus we need to define PNG_NO_ASSEMBLER_CODE here on platforms ++ on which the MMX and SSE asm code in libpng is not supported: */ ++#ifndef __i386__ /* change this if MMX/SSE become supported on x86_64! */ ++#define PNG_NO_ASSEMBLER_CODE ++#endif + #endif + + /* diff --git a/libpng.spec b/libpng.spec index 0511d59..e7fddaa 100644 --- a/libpng.spec +++ b/libpng.spec @@ -1,18 +1,18 @@ Summary: A library of functions for manipulating PNG image format files Name: libpng -Version: 1.2.10 -Release: 7 -License: OSI certified -Group: System Environment/Libraries -Source: ftp://swrinde.nde.swri.edu/pub/png/src/libpng-%{version}.tar.bz2 -Patch0: libpng-1.2.10-multilib.patch -Patch1: libpng-1.2.10-pngconf.patch -Buildroot: %{_tmppath}/%{name}-%{version}-root -BuildPrereq: zlib-devel -Provides: libpng.so.3 -URL: http://www.libpng.org/pub/png/ -%define LIBVER 3.%{version} Epoch: 2 +Version: 1.2.16 +Release: 1%{?dist} +License: BSD +Group: System Environment/Libraries +URL: http://www.libpng.org/pub/png/ + +Source: ftp://ftp.simplesystems.org/pub/png/src/libpng-%{version}.tar.bz2 +Patch0: libpng-multilib.patch +Patch1: libpng-pngconf.patch + +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: zlib-devel Conflicts: qt < 0:2.2.2 %description @@ -26,33 +26,42 @@ 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. +Summary: Development tools for programs to manipulate PNG image format files Group: Development/Libraries -Requires: libpng = %{epoch}:%{version}-%{release}, zlib-devel, pkgconfig +Requires: libpng = %{epoch}:%{version}-%{release} zlib-devel pkgconfig %description devel -The libpng-devel package contains the header files and static -libraries necessary for developing programs using the PNG (Portable -Network Graphics) library. +The libpng-devel package contains header files and documentation 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. +%package static +Summary: Static PNG image format file library +Group: Development/Libraries +Requires: libpng-devel = %{epoch}:%{version}-%{release} + +%description static +The libpng-static package contains the statically linkable version of libpng. +Linking to static libraries is discouraged for most applications, but it is +necessary for some boot packages. + %prep %setup -q -%patch0 -p1 -b .multilib -%patch1 -p1 -b .pngconf + +%patch0 -p1 +%patch1 -p1 %build %configure -make +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT %makeinstall -# we keep the static libraries in the -devel package, since some -# graphical boot packages need to link statically against libpng +# We don't ship .la files. rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng.la rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng12.la @@ -71,14 +80,24 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng12.la %{_bindir}/* %{_includedir}/* %{_libdir}/libpng*.so -%{_libdir}/libpng*.a %{_libdir}/pkgconfig/* %{_mandir}/man3/* +%files static +%defattr(-,root,root) +%{_libdir}/libpng*.a + %clean rm -rf $RPM_BUILD_ROOT %changelog +* Mon Feb 12 2007 Tom Lane 2:1.2.16-1 +- Update to libpng 1.2.16 +Resolves: #211705, #216706, #227334 +- Separate libpng.a into a -static subpackage +- Other minor packaging fixes per Fedora merge review +Resolves: #226038 + * Mon Oct 02 2006 Jesse Keating - 2:1.2.10-7 - Require pkgconfig in the -devel subpackage as it gets called by /usr/bin/libpng-config @@ -217,7 +236,7 @@ rm -rf $RPM_BUILD_ROOT - automated rebuild * Tue May 7 2002 Bernhard Rosenkraenzer 1.2.2-4 -- Don't own %{_libdir}/pkgconfig +- Don't own {_libdir}/pkgconfig - Don't strip library, that's up to rpm * Tue May 7 2002 Bernhard Rosenkraenzer 1.2.2-3 @@ -239,7 +258,7 @@ rm -rf $RPM_BUILD_ROOT * Wed Sep 19 2001 Bernhard Rosenkraenzer 1.2.0-1 - 1.2.0 -* Mon Jul 16 2001 Trond Eivind Glomsrød +* Mon Jul 16 2001 Trond Eivind Glomsrd - s/Copyright/License/ - fix weird versioning system (epoch was set to "2" in the main package, serial to "1" in the devel package. Huh?) @@ -295,11 +314,11 @@ rm -rf $RPM_BUILD_ROOT * Fri Feb 11 2000 Nalin Dahyabhai - move buildroot and add URL -* Sat Feb 5 2000 Bernhard Rosenkränzer +* Sat Feb 5 2000 Bernhard Rosenkraenzer - strip library - rebuild to compress man pages -* Sun Nov 21 1999 Bernhard Rosenkränzer +* Sun Nov 21 1999 Bernhard Rosenkraenzer - 1.0.5 - some tweaks to spec file to make updating easier - handle RPM_OPT_FLAGS diff --git a/sources b/sources index 442a103..ef602e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4f23eebd59ddd01a8f91ff8c823dd7d6 libpng-1.2.10.tar.bz2 +7a1ca4f49bcffdec60d50f48460642bd libpng-1.2.16.tar.bz2