3 %bcond_without static_libs # static library
4 %bcond_without openmp # OpenMP support
5 %bcond_without lcms # LCMS support
6 %bcond_with sse # SSE instructions
8 %ifarch pentium3 pentium4 %{x8664} x32
11 Summary: PNG converter and lossy image compressor
12 Summary(pl.UTF-8): Konwerter i stratny kompresor dla plików PNG
18 #Source0Download: https://pngquant.org/releases.html
19 Source0: https://pngquant.org/%{name}-%{version}-src.tar.gz
20 # Source0-md5: d0f20b42cfd79a039c6af50aebb851a0
21 Patch0: %{name}-shared.patch
22 URL: https://pngquant.org/
23 %{?with_openmp:BuildRequires: gcc >= 6:4.2}
24 %{?with_openmp:BuildRequires: libgomp-devel}
25 %{?with_lcms:BuildRequires: lcms2-devel >= 2}
26 BuildRequires: libpng-devel
27 BuildRequires: pkgconfig
28 BuildRequires: zlib-devel
29 Requires: libimagequant = %{version}-%{release}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 PNG converter and lossy image compressor.
35 %description -l pl.UTF-8
36 Konwerter i stratny kompresor dla plików PNG.
38 %package -n libimagequant
39 Summary: Image Quantization library
40 Summary(pl.UTF-8): Biblioteka do kwantyzacji obrazów
42 URL: https://pngquant.org/lib/
44 %description -n libimagequant
45 Image Quantization library.
47 %description -n libimagequant -l pl.UTF-8
48 Biblioteka do kwantyzacji obrazów.
50 %package -n libimagequant-devel
51 Summary: Header files for libimagequant library
52 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libimagequant
53 Group: Development/Libraries
54 URL: https://pngquant.org/lib/
55 Requires: libimagequant = %{version}-%{release}
57 %description -n libimagequant-devel
58 Header files for libimagequant library.
60 %description -n libimagequant-devel -l pl.UTF-8
61 Pliki nagłówkowe biblioteki libimagequant.
63 %package -n libimagequant-static
64 Summary: Static libimagequant library
65 Summary(pl.UTF-8): Statyczna biblioteka libimagequant
66 Group: Development/Libraries
67 URL: https://pngquant.org/lib/
68 Requires: libimagequant-devel = %{version}-%{release}
70 %description -n libimagequant-static
71 Static libimagequant library.
73 %description -n libimagequant-static -l pl.UTF-8
74 Statyczna biblioteka libimagequant.
81 # not autoconf configure
84 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
85 LDFLAGS="%{rpmldflags}" \
87 %{?with_sse:--enable-sse} \
88 %{?with_lcms:--with-lcms2} \
89 %{?with_openmp:--with-openmp}
91 %{__make} -C lib %{!?with_static_libs:shared}
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
100 DESTDIR=$RPM_BUILD_ROOT
102 # not covered by make install
103 cp -a lib/libimagequant.so* $RPM_BUILD_ROOT%{_libdir}
104 %if %{with static_libs}
105 cp -p lib/libimagequant.a $RPM_BUILD_ROOT%{_libdir}
107 cp -p lib/libimagequant.h $RPM_BUILD_ROOT%{_includedir}
110 rm -rf $RPM_BUILD_ROOT
112 %post -n libimagequant -p /sbin/ldconfig
113 %postun -n libimagequant -p /sbin/ldconfig
116 %defattr(644,root,root,755)
117 %doc CHANGELOG COPYRIGHT README.md
118 %attr(755,root,root) %{_bindir}/pngquant
119 %{_mandir}/man1/pngquant.1*
121 %files -n libimagequant
122 %defattr(644,root,root,755)
123 %doc lib/{COPYRIGHT,MANUAL.md}
124 %attr(755,root,root) %{_libdir}/libimagequant.so.0
126 %files -n libimagequant-devel
127 %defattr(644,root,root,755)
128 %attr(755,root,root) %{_libdir}/libimagequant.so
129 %{_includedir}/libimagequant.h
131 %if %{with static_libs}
132 %files -n libimagequant-static
133 %defattr(644,root,root,755)
134 %{_libdir}/libimagequant.a