[libpng12] Initial commit

Tom Lane tgl at fedoraproject.org
Wed Aug 1 20:28:51 UTC 2012


commit 87260590ff254a9a835e010978ae25a00089ffaa
Author: Tom Lane <tgl at redhat.com>
Date:   Wed Aug 1 16:26:57 2012 -0400

    Initial commit

 .gitignore              |    1 +
 libpng12-multilib.patch |   35 ++++++++++++++++++++++
 libpng12-pngconf.patch  |   42 ++++++++++++++++++++++++++
 libpng12.spec           |   74 +++++++++++++++++++++++++++++++++++++++++++++++
 sources                 |    1 +
 5 files changed, 153 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6bf6e9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/libpng-1.2.49.tar.bz2
diff --git a/libpng12-multilib.patch b/libpng12-multilib.patch
new file mode 100644
index 0000000..be079f7
--- /dev/null
+++ b/libpng12-multilib.patch
@@ -0,0 +1,35 @@
+Use pkg-config to report libpng12 version and installation directories.
+
+
+diff -Naur libpng-1.2.49.orig/scripts/libpng-config.in libpng-1.2.49/scripts/libpng-config.in
+--- libpng-1.2.49.orig/scripts/libpng-config.in	2012-03-29 00:46:55.000000000 -0400
++++ libpng-1.2.49/scripts/libpng-config.in	2012-08-01 15:03:50.564507346 -0400
+@@ -11,11 +11,11 @@
+ 
+ # Modeled after libxml-config.
+ 
+-version="@PNGLIB_VERSION@"
+-prefix="@prefix@"
+-exec_prefix="@exec_prefix@"
+-libdir="@libdir@"
+-includedir="@includedir@/libpng at PNGLIB_MAJOR@@PNGLIB_MINOR@"
++version=`pkg-config --modversion libpng12`
++prefix=`pkg-config --variable prefix libpng12`
++exec_prefix=`pkg-config --variable exec_prefix libpng12`
++libdir=`pkg-config --variable libdir libpng12`
++includedir=`pkg-config --variable includedir libpng12`
+ libs="-lpng at PNGLIB_MAJOR@@PNGLIB_MINOR@"
+ all_libs="-lpng at PNGLIB_MAJOR@@PNGLIB_MINOR@ @LIBS@"
+ I_opts="-I${includedir}"
+diff -Naur libpng-1.2.49.orig/scripts/libpng.pc-configure.in libpng-1.2.49/scripts/libpng.pc-configure.in
+--- libpng-1.2.49.orig/scripts/libpng.pc-configure.in	2012-03-29 00:46:55.000000000 -0400
++++ libpng-1.2.49/scripts/libpng.pc-configure.in	2012-08-01 15:04:37.817786337 -0400
+@@ -3,7 +3,7 @@
+ libdir=@libdir@
+ includedir=@includedir@/libpng at PNGLIB_MAJOR@@PNGLIB_MINOR@
+ 
+-Name: libpng
++Name: libpng12
+ Description: Loads and saves PNG files
+ Version: @PNGLIB_VERSION@
+ Libs: -L${libdir} -lpng at PNGLIB_MAJOR@@PNGLIB_MINOR@
diff --git a/libpng12-pngconf.patch b/libpng12-pngconf.patch
new file mode 100644
index 0000000..dbaadcb
--- /dev/null
+++ b/libpng12-pngconf.patch
@@ -0,0 +1,42 @@
+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/libpng12.spec b/libpng12.spec
new file mode 100644
index 0000000..561fbc1
--- /dev/null
+++ b/libpng12.spec
@@ -0,0 +1,74 @@
+Summary: Old version of libpng, needed to run old binaries
+Name: libpng12
+Version: 1.2.49
+Release: 1%{?dist}
+License: zlib
+Group: System Environment/Libraries
+URL: http://www.libpng.org/pub/png/
+
+# 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
+
+Patch0: libpng12-multilib.patch
+Patch1: libpng12-pngconf.patch
+
+BuildRequires: zlib-devel, pkgconfig
+
+%description
+The libpng12 package provides libpng 1.2, an older version of the libpng
+library for manipulating PNG (Portable Network Graphics) image format files.
+This version should be used only if you are unable to use the current
+version of libpng.
+
+%package devel
+Summary: Development files for libpng 1.2
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
+Requires: zlib-devel%{?_isa} pkgconfig%{?_isa}
+Conflicts: libpng-devel
+
+%description devel
+The libpng12-devel package contains header files and documentation necessary
+for developing programs using libpng12.
+
+%prep
+%setup -q -n libpng-%{version}
+
+%patch0 -p1
+%patch1 -p1
+
+%build
+%configure
+make %{?_smp_mflags}
+
+%install
+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
+# We're not providing any static libraries, either.
+rm -rf $RPM_BUILD_ROOT%{_libdir}/*.a
+# Also drop man5 files, because these are in the base libpng package,
+# which we don't want to conflict with.
+rm -rf $RPM_BUILD_ROOT%{_mandir}/man5/*
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%doc *.txt example.c README TODO CHANGES LICENSE 
+%{_libdir}/libpng*.so.*
+
+%files devel
+%{_bindir}/*
+%{_includedir}/*
+%{_libdir}/libpng*.so
+%{_libdir}/pkgconfig/*
+%{_mandir}/man3/*
+
+%changelog
+* Wed Aug  1 2012 Tom Lane <tgl at redhat.com> 1.2.49-1
+- Created from libpng
diff --git a/sources b/sources
index e69de29..d0666b8 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+d5106b70b4f8b464a7da66bffe4565fb  libpng-1.2.49.tar.bz2


More information about the scm-commits mailing list