-# TODO: switch to zlib >= 1.2.8.1 when released (for inflateValidate())
+# NOTE: there is intel SSE optimization available but with no runtime detection;
+# it's enabled based on compiler flags (-msse*, either explicit or implied by -march=)
#
# Conditional build:
%bcond_without tests # don't perform "make check"
Summary(pt_BR.UTF-8): Biblioteca PNG
Summary(tr.UTF-8): PNG kitaplığı
Name: libpng
-Version: 1.6.26
-Release: 1
+Version: 1.6.37
+Release: 2
Epoch: 2
License: distributable
Group: Libraries
Source0: http://downloads.sourceforge.net/libpng/%{name}-%{version}.tar.xz
-# Source0-md5: faed9bb495d2e12dd0c9ec561ca60cd8
-Patch0: %{name}-pngminus.patch
-Patch1: http://downloads.sourceforge.net/libpng-apng/%{name}-%{version}-apng.patch.gz
-# Patch1-md5: 921d2717418bf74b40b94191c8b282c7
+# Source0-md5: 015e8e15db1eecde5f2eb9eb5b6e59e9
+Patch0: http://downloads.sourceforge.net/libpng-apng/%{name}-%{version}-apng.patch.gz
+# Patch0-md5: f02073fd96816b184c79b297775e37dc
+Patch1: %{name}-pngminus.patch
+Patch2: %{name}-drop-Llibdir.patch
URL: http://www.libpng.org/pub/png/libpng.html
BuildRequires: rpmbuild(macros) >= 1.213
BuildRequires: tar >= 1:1.22
BuildRequires: xz >= 1:4.999.7
-BuildRequires: zlib-devel
+BuildRequires: zlib-devel >= 1.2.9
Provides: libpng(APNG) = 0.10
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
-%configure
+%configure \
+%ifarch %{arm} aarch64
+ --enable-arm-neon=check \
+%endif
+%ifarch mipsel mips64el
+ --enable-mips-msa=check \
+%endif
+%ifarch ppc ppc64
+ --enable-powerpc-vsx=check
+%endif
+
%{__make}
-%{__make} -C contrib/pngminus -f makefile.std \
+%{__make} -C contrib/pngminus \
LIBPATH=%{_libdir} \
CC="%{__cc}" \
OPT_FLAGS="%{rpmcppflags} %{rpmcflags}"
-%{?with_tests:%{__make} check}
+%{?with_tests:%{__make} -j1 check}
%install
rm -rf $RPM_BUILD_ROOT