From d54238fd6f97129386e6fcc256c6d310704bcb68 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 5 Nov 2011 12:47:29 -0400 Subject: [PATCH] Update to new major release series 1.5.x --- .gitignore | 1 + libpng-multilib.patch | 8 ++--- libpng-pngconf.patch | 42 ----------------------- libpng.spec | 77 +++++++++++++++++++++++++++++++++++-------- sources | 1 + 5 files changed, 70 insertions(+), 59 deletions(-) delete mode 100644 libpng-pngconf.patch diff --git a/.gitignore b/.gitignore index 985ee42..3c3e3b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +/libpng-1.5.6.tar.bz2 /libpng-1.2.46.tar.bz2 diff --git a/libpng-multilib.patch b/libpng-multilib.patch index 8b10eb9..c99c765 100644 --- a/libpng-multilib.patch +++ b/libpng-multilib.patch @@ -1,10 +1,10 @@ Use pkg-config to report libpng version and installation directories. -diff -Naur libpng-1.2.31.orig/scripts/libpng-config.in libpng-1.2.31/scripts/libpng-config.in ---- libpng-1.2.31.orig/scripts/libpng-config.in 2008-05-29 13:37:58.000000000 -0400 -+++ libpng-1.2.31/scripts/libpng-config.in 2008-08-23 16:57:20.000000000 -0400 -@@ -8,11 +8,11 @@ +diff -Naur libpng-1.5.5.orig/libpng-config.in libpng-1.5.5/libpng-config.in +--- libpng-1.5.5.orig/libpng-config.in 2011-09-22 09:40:23.000000000 -0400 ++++ libpng-1.5.5/libpng-config.in 2011-10-05 01:03:32.335435187 -0400 +@@ -11,11 +11,11 @@ # Modeled after libxml-config. diff --git a/libpng-pngconf.patch b/libpng-pngconf.patch deleted file mode 100644 index dbaadcb..0000000 --- a/libpng-pngconf.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -Naur libpng-1.2.29.orig/configure.ac libpng-1.2.29/configure.ac ---- libpng-1.2.29.orig/configure.ac 2008-05-08 07:58:11.000000000 -0400 -+++ libpng-1.2.29/configure.ac 2008-05-31 20:21:12.000000000 -0400 -@@ -63,7 +63,8 @@ - AC_MSG_CHECKING( - [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE]) - AC_TRY_COMPILE( -- [#include "$srcdir/pnggccrd.c"], -+ [#define PNG_CONFIGURE_LIBPNG -+ #include "$srcdir/pnggccrd.c"], - [return 0;], - AC_MSG_RESULT(yes) - LIBPNG_NO_MMX="", -diff -Naur libpng-1.2.29.orig/pngconf.h libpng-1.2.29/pngconf.h ---- libpng-1.2.29.orig/pngconf.h 2008-05-08 07:58:03.000000000 -0400 -+++ libpng-1.2.29/pngconf.h 2008-05-31 20:21:12.000000000 -0400 -@@ -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 5887609..585ac1a 100644 --- a/libpng.spec +++ b/libpng.spec @@ -1,22 +1,29 @@ Summary: A library of functions for manipulating PNG image format files Name: libpng Epoch: 2 -Version: 1.2.46 +Version: 1.5.6 Release: 1%{?dist} License: zlib Group: System Environment/Libraries URL: http://www.libpng.org/pub/png/ +# This SRPM includes a copy of libpng 1.2.x, which is provided as a stopgap +# measure to satisfy dependencies on libpng.so.3 until all applications can +# be recompiled. The compatibility library is placed in a separate +# sub-RPM, libpng-compat. There is no support for recompiling source code +# against the old version. +%global prevversion 1.2.46 + # Note: non-current tarballs get moved to the history/ subdirectory, # so look there if you fail to retrieve the version you want -Source: ftp://ftp.simplesystems.org/pub/png/src/libpng-%{version}.tar.bz2 +Source0: ftp://ftp.simplesystems.org/pub/png/src/libpng-%{version}.tar.bz2 + +Source1: ftp://ftp.simplesystems.org/pub/png/src/libpng-%{prevversion}.tar.bz2 Patch0: libpng-multilib.patch -Patch1: libpng-pngconf.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: zlib-devel, pkgconfig -Conflicts: qt < 0:2.2.2 %description The libpng package contains a library of functions for creating and @@ -31,7 +38,8 @@ files. %package devel Summary: Development tools for programs to manipulate PNG image format files Group: Development/Libraries -Requires: libpng = %{epoch}:%{version}-%{release} zlib-devel pkgconfig +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: zlib-devel pkgconfig %description devel The libpng-devel package contains header files and documentation necessary @@ -44,38 +52,68 @@ the libpng package. %package static Summary: Static PNG image format file library Group: Development/Libraries -Requires: libpng-devel = %{epoch}:%{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{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. +%package compat +Summary: Temporary backwards-compatibility copy of old libpng +Group: Development/Libraries + +%description compat +This package contains shared libraries (only) for libpng 1.2.x. + %prep %setup -q %patch0 -p1 -%patch1 -p1 + +tar xfj %{SOURCE1} %build %configure make %{?_smp_mflags} +# this is for the compat package: + pushd libpng-%{prevversion} + %configure + make %{?_smp_mflags} + popd + %install rm -rf $RPM_BUILD_ROOT -%makeinstall + +# install compat package first, then remove unwanted files + pushd libpng-%{prevversion} + make DESTDIR=$RPM_BUILD_ROOT install + rm -rf $RPM_BUILD_ROOT%{_bindir} + rm -rf $RPM_BUILD_ROOT%{_includedir} + rm -rf $RPM_BUILD_ROOT%{_mandir} + rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libpng.pc + rm -f $RPM_BUILD_ROOT%{_libdir}/libpng*.so + rm -f $RPM_BUILD_ROOT%{_libdir}/libpng*.a + rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + popd + +make DESTDIR=$RPM_BUILD_ROOT install + # We don't ship .la files. -rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng.la -rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng12.la +rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la %post -p /sbin/ldconfig %postun -p /sbin/ldconfig +%post compat -p /sbin/ldconfig +%postun compat -p /sbin/ldconfig + %files %defattr(-,root,root) -%doc *.txt example.c README TODO CHANGES LICENSE -%{_libdir}/libpng*.so.* +%doc libpng-manual.txt example.c README TODO CHANGES LICENSE +%{_libdir}/libpng15.so.* %{_mandir}/man5/* %files devel @@ -83,17 +121,30 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/libpng12.la %{_bindir}/* %{_includedir}/* %{_libdir}/libpng*.so -%{_libdir}/pkgconfig/* +%{_libdir}/pkgconfig/libpng.pc +%{_libdir}/pkgconfig/libpng15.pc %{_mandir}/man3/* %files static %defattr(-,root,root) %{_libdir}/libpng*.a +%files compat +%defattr(-,root,root) +%{_libdir}/libpng.so.3* +%{_libdir}/libpng12.so.* +%{_libdir}/pkgconfig/libpng12.pc + %clean rm -rf $RPM_BUILD_ROOT %changelog +* Sat Nov 5 2011 Tom Lane 2:1.5.6-1 +- Update to new major release series 1.5.x; includes source-code-incompatible + API changes and a soname version bump +- Temporarily package 1.2.46 shared library (only) in libpng-compat subpackage + so that dependent packages won't be broken while rebuilding proceeds + * Thu Jul 14 2011 Tom Lane 2:1.2.46-1 - Update to libpng 1.2.46, includes fixes for CVE-2011-2501, CVE-2011-2690, CVE-2011-2691, CVE-2011-2692 diff --git a/sources b/sources index 8596699..5d38bce 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ +2107095191b0e8bd9a0f4f930c1948c3 libpng-1.5.6.tar.bz2 e8b43dc78ef95b3949af7f961d76874b libpng-1.2.46.tar.bz2