2 # - finish java (create .jar, install)
3 # - build C#, rust bindings
6 %bcond_without static_libs # static library
7 %bcond_without openmp # OpenMP support
8 %bcond_with sse # SSE instructions
9 %bcond_with java # Java bindings [TODO: finish]
11 %ifarch pentium3 pentium4 %{x8664} x32
14 Summary: Image Quantization library
15 Summary(pl.UTF-8): Biblioteka do kwantyzacji obrazów
19 # some original code was on MIT-like license
20 License: GPL v3+ with MIT parts or commercial
22 #Source0Download: https://github.com/ImageOptim/libimagequant/releases
23 Source0: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{name}-%{version}.tar.gz
24 # Source0-md5: 0481df2396a1e79302582c757d71bc4c
25 Patch0: %{name}-shared.patch
26 URL: https://pngquant.org/lib/
27 %{?with_openmp:BuildRequires: gcc >= 6:4.2}
28 %{?with_java:BuildRequires: jdk}
29 %{?with_openmp:BuildRequires: libgomp-devel}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Small, portable C library for high-quality conversion of RGBA images
34 to 8-bit indexed-color (palette) images.
36 %description -l pl.UTF-8
37 Mała, przenośna biblioteka C do wysokiej jakości konwersji obrazów
38 RGBA do obrazów 8-bitowych z indeksowanymi kolorami (paletą).
41 Summary: Header files for libimagequant library
42 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libimagequant
43 Group: Development/Libraries
44 Requires: %{name} = %{version}-%{release}
47 Header files for libimagequant library.
49 %description devel -l pl.UTF-8
50 Pliki nagłówkowe biblioteki libimagequant.
53 Summary: Static libimagequant library
54 Summary(pl.UTF-8): Statyczna biblioteka libimagequant
55 Group: Development/Libraries
56 Requires: %{name}-devel = %{version}-%{release}
59 Static libimagequant library.
61 %description static -l pl.UTF-8
62 Statyczna biblioteka libimagequant.
69 # not autoconf configure
72 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
73 LDFLAGS="%{rpmldflags}" \
76 %{__enable_disable sse} \
77 %{?with_openmp:--with-openmp}
79 %{__make} shared %{?with_static_libs:static}
87 rm -rf $RPM_BUILD_ROOT
90 DESTDIR=$RPM_BUILD_ROOT
92 %if %{with static_libs}
93 cp -p libimagequant.a $RPM_BUILD_ROOT%{_libdir}
97 rm -rf $RPM_BUILD_ROOT
99 %post -p /sbin/ldconfig
100 %postun -p /sbin/ldconfig
103 %defattr(644,root,root,755)
104 %doc CHANGELOG COPYRIGHT README.md
105 %attr(755,root,root) %{_libdir}/libimagequant.so.0
108 %defattr(644,root,root,755)
109 %attr(755,root,root) %{_libdir}/libimagequant.so
110 %{_includedir}/libimagequant.h
111 %{_pkgconfigdir}/imagequant.pc
113 %if %{with static_libs}
115 %defattr(644,root,root,755)
116 %{_libdir}/libimagequant.a