+# NOTE: try to switch to ac/am/lt build on 1.2.x->1.4.x upgrade
Summary: PNG library
-Summary(de): PNG-Library
-Summary(fr): Librarie PNG.
-Summary(pl): Biblioteki PNG
-Summary(tr): PNG kitaplýðý
+Summary(de.UTF-8): PNG-Library
+Summary(es.UTF-8): Biblioteca PNG
+Summary(fr.UTF-8): Librarie PNG
+Summary(pl.UTF-8): Biblioteka PNG
+Summary(pt_BR.UTF-8): Biblioteca PNG
+Summary(tr.UTF-8): PNG kitaplığı
Name: libpng
-Version: 1.0.3
-Release: 4
-Copyright: distributable
+Version: 1.2.27
+Release: 1
+Epoch: 2
+License: distributable
Group: Libraries
-Group(pl): Biblioteki
-Source: ftp://ftp.uu.net/graphics/png/src/%{name}-%{version}.tar.gz
-Patch: libpng-opt.patch
-Buildroot: /tmp/%{name}-%{version}-root
-Conflicts: glibc <= 2.0.7
+Source0: http://dl.sourceforge.net/libpng/%{name}-%{version}.tar.lzma
+# Source0-md5: 2867168631ac82892a7f8eb9aa4d181a
+Patch0: %{name}-pngminus.patch
+Patch1: %{name}-opt.patch
+Patch2: %{name}-norpath.patch
+Patch3: %{name}-export_old.patch
+Patch4: %{name}-revert.patch
+# http://littlesvr.ca/apng/
+Patch5: %{name}-apng.patch
+URL: http://www.libpng.org/pub/png/libpng.html
+BuildRequires: lzma >= 1:4.42
+BuildRequires: rpmbuild(macros) >= 1.213
+BuildRequires: zlib-devel
+%ifarch %{x8664} ia64 ppc64 s390x sparc64
+Provides: libpng.so.3()(64bit)
+%else
+Provides: libpng.so.3
+%endif
+Provides: libpng(APNG) = 0.10
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-The PNG library is a collection of routines used to crate and manipulate
-PNG format graphics files. The PNG format was designed as a replacement
-for GIF, with many improvements and extensions.
+The PNG library is a collection of routines used to create and
+manipulate PNG format graphics files. The PNG format was designed as a
+replacement for GIF, with many improvements and extensions.
+
+%description -l de.UTF-8
+Die PNG-Library ist eine Sammlung von Routinen zum Erstellen und
+Bearbeiten von Grafiken im PNG-Format. Das PNG-Format wurde als Ersatz
+für GIF entwickelt und enthält viele Verbesserungen und Erweiterungen.
+
+%description -l es.UTF-8
+Esta biblioteca es una colección de rutinas para crear y manipular
+archivos gráficos en el formato PNG. Este formato fue proyectado para
+substituir el
+
+%description -l fr.UTF-8
+La librairie PNG est un ensemble de routines utilisées pour créer et
+manipuler des fichiers graphiques au format PNG. Le format PNG a été
+élaboré pour remplacer le GIF, avec de nombreuses améliorations et
+extensions.
+
+%description -l pl.UTF-8
+Biblioteki PNG są kolekcją form używanych do tworzenia i manipulowania
+plikami w formacie graficznym PNG. Format ten został stworzony jako
+zamiennik dla formatu GIF, z wieloma rozszerzeniami i nowościami.
+
+%description -l pt_BR.UTF-8
+Esta biblioteca é uma coleção de rotinas para criar e manipular
+arquivos gráficos no formato PNG. Este formato foi projetado para
+substituir o formato GIF, com extensões e melhorias.
-%description -l pl
-Biblioteki PNG s± kolekcj± form u¿ywanych do tworzenia i manipulowania
-plikami w formatacie graficznym PNG. format ten zosta³ stworzony jako
-zamiennik dla formatu GIF, z wieloma rozszerzeniami i nowo¶ciami.
+%description -l tr.UTF-8
+PNG kitaplığı, PNG formatındaki resim dosyalarını işlemeye yönelik
+yordamları içerir. PNG, GIF formatının yerini almak üzere tasarlanmış
+bir resim formatıdır.
%package devel
-Summary: headers
-Summary(de): Headers und statische Libraries
-Summary(fr): en-têtes et bibliothèques statiques
-Summary(pl): Pliki nag³ówkowe
-Summary(tr): baþlýk dosyalarý ve statik kitaplýklar
+Summary: Header files for libpng
+Summary(de.UTF-8): libpng Headers
+Summary(es.UTF-8): Archivos de inclusión y bibliotecas estáticas
+Summary(fr.UTF-8): en-têtes et bibliothèques statiques
+Summary(pl.UTF-8): Pliki nagłówkowe libpng
+Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas estáticas
+Summary(tr.UTF-8): başlık dosyaları ve statik kitaplıklar
Group: Development/Libraries
-Group(pl): Programowanie/Biblioteki
-Requires: %{name} = %{version}
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: zlib-devel
+Provides: libpng(APNG)-devel = 0.10
+Conflicts: libpng < 1.0.15
%description devel
-The header files and static libraries are only needed for development
-of programs using the PNG library.
-
-%description -l pl devel
-W pakiecie tym znajduj± siê pliki nag³ówkowe, przeznaczone dla programistów
-u¿ywaj±cych bibliotek PNG.
-
-%description -l de devel
-Die Header-Dateien und statischen Libraries werden nur zur Entwicklung
-von Programmen mit der PNG-Library benötigt.
-
-%description -l de
-Die PNG-Library ist eine Sammlung von Routinen zum Erstellen und Bearbeiten
-von Grafiken im PNG-Format. Das PNG-Format wurde als Ersatz für GIF
-entwickelt und enthält viele Verbesserungen und Erweiterungen.
-
-%description -l fr devel
-Fichiers d'en-tete et les librairies qui sont requis seulement pour
-le développement avec la librairie PNG.
-
-%description -l fr
-La librairie PNG est un ensemble de routines utilisées pour créer et
-manipuler des fichiers graphiques au format PNG. Le format PNG a été
-élaboré pour remplacer le GIF, avec de nombreuses améliorations et
-extensions.
+The header files are only needed for development of programs using the
+PNG library.
+
+%description devel -l de.UTF-8
+Die Header-Dateien werden nur zur Entwicklung von Programmen mit der
+PNG-Library benötigt.
+
+%description devel -l es.UTF-8
+Archivos de inclusión y bibliotecas estáticas que son necesarios
+solamente para el desarrollo de programas que usan la biblioteca PNG.
+
+%description devel -l fr.UTF-8
+Fichiers d'en-tete et les librairies qui sont requis seulement pour le
+développement avec la librairie PNG.
+
+%description devel -l pl.UTF-8
+W pakiecie tym znajdują się pliki nagłówkowe, przeznaczone dla
+programistów używających bibliotek PNG.
+
+%description devel -l pt_BR.UTF-8
+Arquivos de inclusão e bibliotecas estáticas que são necessários
+somente para o desenvolvimento de programas que usam a biblioteca PNG.
+
+%description devel -l tr.UTF-8
+PNG kitaplığını kullanan programlar geliştirmek için gereken
+kitaplıklar ve başlık dosyaları.
+
+%package static
+Summary: Static PNG libraries
+Summary(de.UTF-8): Statischen PNG Libraries
+Summary(pl.UTF-8): Biblioteki statyczne PNG
+Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libpng
+Group: Development/Libraries
+Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+Provides: libpng(APNG)-static = 0.10
-%description -l tr devel
-PNG kitaplýðýný kullanan programlar geliþtirmek için gereken kitaplýklar ve
-baþlýk dosyalarý.
+%description static
+Static PNG libraries.
-%description -l tr
-PNG kitaplýðý, PNG formatýndaki resim dosyalarýný iþlemeye yönelik yordamlarý
-içerir. PNG, GIF formatýnýn yerini almak üzere tasarlanmýþ bir resim formatýdýr.
+%description static -l de.UTF-8
+Statischen PNG Libraries.
-%package static
-Summary: static libraries
-Summary(pl): Biblioteki statyczne
-Group: Development/Libraries
-Group(pl): Programowanie/Biblioteki
-Requires: %{name}-devel = %{version}
+%description static -l pl.UTF-8
+Biblioteki statyczne PNG.
-%description static
-static libraries
+%description static -l pt_BR.UTF-8
+Bibliotecas estáticas para desenvolvimento com libpng.
+
+%package progs
+Summary: libpng utility programs
+Summary(pl.UTF-8): Narzędzia do plików PNG
+Group: Applications/Graphics
+Requires: %{name} = %{epoch}:%{version}-%{release}
+
+%description progs
+This package contains utility programs to convert PNG files to and
+from PNM files.
-%description -l pl static
-Biblioteki statyczne
+%description progs -l pl.UTF-8
+Narzędzia do konwersji plików PNG z lub do plików PNM.
%prep
-%setup -q
-%patch -p1
-ln -s scripts/makefile.lnx ./Makefile
+%setup -q -c -T
+lzma -dc %{SOURCE0} | tar xf - -C ..
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p0
+
+%ifarch %{ix86}
+ln -sf scripts/makefile.gcmmx ./Makefile
+%else
+ln -sf scripts/makefile.linux ./Makefile
+%endif
%build
-make
+%{__make} \
+ prefix=%{_prefix} \
+ LIBPATH=%{_libdir} \
+ CC="%{__cc}" \
+%ifarch %{x8664} sparc sparcv9 sparc64
+ OPT_FLAGS="%{rpmcflags} -DPNG_NO_MMX_CODE"
+%else
+ OPT_FLAGS="%{rpmcflags}"
+%endif
+
+%{__make} -C contrib/pngminus -f makefile.std \
+ LIBPATH=%{_libdir} \
+ CC="%{__cc}" \
+ OPT_FLAGS="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/usr/{lib,man/man{3,5}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_mandir}/man{3,5}} \
+ $RPM_BUILD_ROOT{%{_pkgconfigdir},%{_examplesdir}/%{name}-%{version}}
-make prefix=$RPM_BUILD_ROOT/usr install
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ prefix=%{_prefix} \
+ LIBPATH=%{_libdir} \
+ MANPATH=%{_mandir}
-bzip2 -9 *.txt ANNOUNCE CHANGES KNOWNBUG README
+install contrib/pngminus/{png2pnm,pnm2png} $RPM_BUILD_ROOT%{_bindir}
+install example.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-install png.5 $RPM_BUILD_ROOT/usr/man/man5/
-install {libpngpf,libpng}.3 $RPM_BUILD_ROOT/usr/man/man3/
-
-strip $RPM_BUILD_ROOT/usr/lib/lib*so.*.*
-
-gzip -9nf $RPM_BUILD_ROOT/usr/man/man*/*
+%clean
+rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
-%attr(755,root,root) /usr/lib/*.so.*.*
-%attr(644,root,root) /usr/man/man5/*
+%defattr(644,root,root,755)
+%doc ANNOUNCE CHANGES KNOWNBUG README LICENSE
+%attr(755,root,root) %{_libdir}/libpng12.so.*.*.*
+%attr(755,root,root) %{_libdir}/libpng.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libpng12.so.0
+# alternative soname (symlink in PLD, so must be packaged)
+%attr(755,root,root) %{_libdir}/libpng.so.3
%files devel
%defattr(644,root,root,755)
-%doc {*.txt,ANNOUNCE,CHANGES,KNOWNBUG,README}.bz2
-%attr(755,root,root) /usr/lib/lib*.so
-/usr/include/*
-/usr/man/man3/*
+%doc *.txt
+%attr(755,root,root) %{_bindir}/libpng12-config
+%attr(755,root,root) %{_bindir}/libpng-config
+%attr(755,root,root) %{_libdir}/libpng12.so
+%attr(755,root,root) %{_libdir}/libpng.so
+%{_pkgconfigdir}/libpng12.pc
+%{_pkgconfigdir}/libpng.pc
+%{_includedir}/libpng12
+%{_includedir}/libpng
+%{_includedir}/png*.h
+%{_mandir}/man?/*
+%{_examplesdir}/%{name}-%{version}
%files static
-%attr(644,root,root) /usr/lib/lib*.a
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+%defattr(644,root,root,755)
+%{_libdir}/libpng12.a
+%{_libdir}/libpng.a
-%changelog
-* Fri Mar 5 1999 Tomasz K³oczko <kloczek@rudy.mif.pg.gda.pl>
- [1.0.3-4]
-- added striping shared libraries,
-- added installing man pages.
-
-* Fri Jan 22 1999 Pawe³ Gajda <pagaj@shadow.eu.org>
- [1.0.3-1d]
-- all files install now into /usr
-
-* Sun Nov 15 1998 Marcin Korzonek <mkorz@shadow.eu.org>
- [1.0.2-1d]
-- added some docs files,
-- added %%lang macros.
-
-* Thu Jul 16 1998 Wojtek ¦lusarczyk <wojtek@shadow.eu.org>
- [1.0.1-5d]
-- build against glibc-2.1,
-- added pl translation,
-- moved %changelog at the end of spec,
-- changed permisions of *.so libs to 755,
-- addes static subpackage.
-
-* Thu May 07 1998 Prospector System <bugs@redhat.com>
-- translations modified for de, fr, tr
-
-* Thu Apr 30 1998 Cristian Gafton <gafton@redhat.com>
-- devel subpackage moved to Development/Libraries
-
-* Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com>
-- upgraded to 1.0.1
-- added buildroot
-
-* Tue Oct 14 1997 Donnie Barnes <djb@redhat.com>
-- updated to new version
-- spec file cleanups
-
-* Thu Jul 10 1997 Erik Troan <ewt@redhat.com>
-- built against glibc
+%files progs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/p*