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