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
17 # note: versions >= 4 are rewritten in rust, prepared on DEVEL-rust branch
20 # some original code was on MIT-like license
21 License: GPL v3+ with MIT parts or commercial
23 #Source0Download: https://github.com/ImageOptim/libimagequant/tags
24 Source0: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{name}-%{version}.tar.gz
25 # Source0-md5: bc0870e98d02fef68f65ef770d0d5c30
26 Patch0: %{name}-shared.patch
27 URL: https://pngquant.org/lib/
28 %{?with_openmp:BuildRequires: gcc >= 6:4.2}
29 %{?with_java:BuildRequires: jdk}
30 %{?with_openmp:BuildRequires: libgomp-devel}
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Small, portable C library for high-quality conversion of RGBA images
35 to 8-bit indexed-color (palette) images.
37 %description -l pl.UTF-8
38 Mała, przenośna biblioteka C do wysokiej jakości konwersji obrazów
39 RGBA do obrazów 8-bitowych z indeksowanymi kolorami (paletą).
42 Summary: Header files for libimagequant library
43 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libimagequant
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
48 Header files for libimagequant library.
50 %description devel -l pl.UTF-8
51 Pliki nagłówkowe biblioteki libimagequant.
54 Summary: Static libimagequant library
55 Summary(pl.UTF-8): Statyczna biblioteka libimagequant
56 Group: Development/Libraries
57 Requires: %{name}-devel = %{version}-%{release}
60 Static libimagequant library.
62 %description static -l pl.UTF-8
63 Statyczna biblioteka libimagequant.
70 # not autoconf configure
73 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
74 LDFLAGS="%{rpmldflags}" \
77 %{__enable_disable sse} \
78 %{?with_openmp:--with-openmp}
80 %{__make} shared %{?with_static_libs:static}
88 rm -rf $RPM_BUILD_ROOT
91 DESTDIR=$RPM_BUILD_ROOT
93 %if %{with static_libs}
94 cp -p libimagequant.a $RPM_BUILD_ROOT%{_libdir}
98 rm -rf $RPM_BUILD_ROOT
100 %post -p /sbin/ldconfig
101 %postun -p /sbin/ldconfig
104 %defattr(644,root,root,755)
105 %doc CHANGELOG COPYRIGHT README.md
106 %attr(755,root,root) %{_libdir}/libimagequant.so.0
109 %defattr(644,root,root,755)
110 %attr(755,root,root) %{_libdir}/libimagequant.so
111 %{_includedir}/libimagequant.h
112 %{_pkgconfigdir}/imagequant.pc
114 %if %{with static_libs}
116 %defattr(644,root,root,755)
117 %{_libdir}/libimagequant.a