]>
Commit | Line | Data |
---|---|---|
e0da65aa JB |
1 | # TODO: |
2 | # - finish java (create .jar, install) | |
3 | # - build C#, rust bindings | |
4 | # | |
5 | # Conditional build: | |
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] | |
10 | # | |
11 | %ifarch pentium3 pentium4 %{x8664} x32 | |
12 | %define with_sse 1 | |
13 | %endif | |
14 | Summary: Image Quantization library | |
15 | Summary(pl.UTF-8): Biblioteka do kwantyzacji obrazów | |
16 | Name: libimagequant | |
80d0667f | 17 | Version: 2.12.1 |
e0da65aa JB |
18 | Release: 1 |
19 | # some original code was on MIT-like license | |
20 | License: GPL v3+ with MIT parts or commercial | |
21 | Group: Libraries | |
22 | #Source0Download: https://github.com/ImageOptim/libimagequant/releases | |
23 | Source0: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{name}-%{version}.tar.gz | |
80d0667f | 24 | # Source0-md5: 0481df2396a1e79302582c757d71bc4c |
e0da65aa JB |
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) | |
31 | ||
32 | %description | |
33 | Small, portable C library for high-quality conversion of RGBA images | |
34 | to 8-bit indexed-color (palette) images. | |
35 | ||
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ą). | |
39 | ||
40 | %package devel | |
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} | |
45 | ||
46 | %description devel | |
47 | Header files for libimagequant library. | |
48 | ||
49 | %description devel -l pl.UTF-8 | |
50 | Pliki nagłówkowe biblioteki libimagequant. | |
51 | ||
52 | %package static | |
53 | Summary: Static libimagequant library | |
54 | Summary(pl.UTF-8): Statyczna biblioteka libimagequant | |
55 | Group: Development/Libraries | |
56 | Requires: %{name}-devel = %{version}-%{release} | |
57 | ||
58 | %description static | |
59 | Static libimagequant library. | |
60 | ||
61 | %description static -l pl.UTF-8 | |
62 | Statyczna biblioteka libimagequant. | |
63 | ||
64 | %prep | |
65 | %setup -q | |
66 | %patch0 -p1 | |
67 | ||
68 | %build | |
69 | # not autoconf configure | |
70 | ./configure \ | |
71 | CC="%{__cc}" \ | |
72 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
73 | LDFLAGS="%{rpmldflags}" \ | |
74 | --prefix=%{_prefix} \ | |
75 | --libdir=%{_libdir} \ | |
76 | %{__enable_disable sse} \ | |
77 | %{?with_openmp:--with-openmp} | |
78 | ||
79 | %{__make} shared %{?with_static_libs:static} | |
80 | ||
81 | %if %{with java} | |
82 | %{__make} java \ | |
83 | CLASSPATH=. | |
84 | %endif | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %{__make} install \ | |
90 | DESTDIR=$RPM_BUILD_ROOT | |
91 | ||
92 | %if %{with static_libs} | |
93 | cp -p libimagequant.a $RPM_BUILD_ROOT%{_libdir} | |
94 | %endif | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %post -p /sbin/ldconfig | |
100 | %postun -p /sbin/ldconfig | |
101 | ||
102 | %files | |
103 | %defattr(644,root,root,755) | |
104 | %doc CHANGELOG COPYRIGHT README.md | |
105 | %attr(755,root,root) %{_libdir}/libimagequant.so.0 | |
106 | ||
107 | %files devel | |
108 | %defattr(644,root,root,755) | |
109 | %attr(755,root,root) %{_libdir}/libimagequant.so | |
110 | %{_includedir}/libimagequant.h | |
111 | %{_pkgconfigdir}/imagequant.pc | |
112 | ||
113 | %if %{with static_libs} | |
114 | %files static | |
115 | %defattr(644,root,root,755) | |
116 | %{_libdir}/libimagequant.a | |
117 | %endif |