]>
Commit | Line | Data |
---|---|---|
683a4347 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
0ce2e68e | 4 | %bcond_without openmp # OpenMP support |
683a4347 JB |
5 | %bcond_without lcms # LCMS support |
6 | %bcond_with sse # SSE instructions | |
7 | # | |
8 | %ifarch pentium3 pentium4 %{x8664} x32 | |
9 | %define with_sse 1 | |
10 | %endif | |
11 | Summary: PNG converter and lossy image compressor | |
12 | Summary(pl.UTF-8): Konwerter i stratny kompresor dla plików PNG | |
13 | Name: pngquant | |
7c90211d | 14 | Version: 2.7.2 |
683a4347 JB |
15 | Release: 1 |
16 | License: BSD | |
17 | Group: Libraries | |
18 | #Source0Download: https://pngquant.org/releases.html | |
58b7aa3b | 19 | Source0: https://pngquant.org/%{name}-%{version}-src.tar.gz |
7c90211d | 20 | # Source0-md5: d0f20b42cfd79a039c6af50aebb851a0 |
58b7aa3b | 21 | Patch0: %{name}-shared.patch |
683a4347 | 22 | URL: https://pngquant.org/ |
0ce2e68e JB |
23 | %{?with_openmp:BuildRequires: gcc >= 6:4.2} |
24 | %{?with_openmp:BuildRequires: libgomp-devel} | |
683a4347 JB |
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) | |
31 | ||
32 | %description | |
33 | PNG converter and lossy image compressor. | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | Konwerter i stratny kompresor dla plików PNG. | |
37 | ||
38 | %package -n libimagequant | |
39 | Summary: Image Quantization library | |
40 | Summary(pl.UTF-8): Biblioteka do kwantyzacji obrazów | |
41 | Group: Libraries | |
42 | URL: https://pngquant.org/lib/ | |
43 | ||
44 | %description -n libimagequant | |
45 | Image Quantization library. | |
46 | ||
47 | %description -n libimagequant -l pl.UTF-8 | |
48 | Biblioteka do kwantyzacji obrazów. | |
49 | ||
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} | |
56 | ||
57 | %description -n libimagequant-devel | |
58 | Header files for libimagequant library. | |
59 | ||
60 | %description -n libimagequant-devel -l pl.UTF-8 | |
61 | Pliki nagłówkowe biblioteki libimagequant. | |
62 | ||
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} | |
69 | ||
70 | %description -n libimagequant-static | |
71 | Static libimagequant library. | |
72 | ||
73 | %description -n libimagequant-static -l pl.UTF-8 | |
74 | Statyczna biblioteka libimagequant. | |
75 | ||
76 | %prep | |
77 | %setup -q | |
78 | %patch0 -p1 | |
683a4347 JB |
79 | |
80 | %build | |
81 | # not autoconf configure | |
82 | ./configure \ | |
83 | CC="%{__cc}" \ | |
84 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
85 | LDFLAGS="%{rpmldflags}" \ | |
86 | --prefix=%{_prefix} \ | |
87 | %{?with_sse:--enable-sse} \ | |
88 | %{?with_lcms:--with-lcms2} \ | |
0ce2e68e | 89 | %{?with_openmp:--with-openmp} |
683a4347 JB |
90 | |
91 | %{__make} -C lib %{!?with_static_libs:shared} | |
92 | ||
93 | %{__make} | |
94 | ||
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}} | |
98 | ||
99 | %{__make} install \ | |
100 | DESTDIR=$RPM_BUILD_ROOT | |
101 | ||
58b7aa3b | 102 | # not covered by make install |
683a4347 JB |
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} | |
106 | %endif | |
107 | cp -p lib/libimagequant.h $RPM_BUILD_ROOT%{_includedir} | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %post -n libimagequant -p /sbin/ldconfig | |
113 | %postun -n libimagequant -p /sbin/ldconfig | |
114 | ||
115 | %files | |
116 | %defattr(644,root,root,755) | |
117 | %doc CHANGELOG COPYRIGHT README.md | |
118 | %attr(755,root,root) %{_bindir}/pngquant | |
58b7aa3b | 119 | %{_mandir}/man1/pngquant.1* |
683a4347 JB |
120 | |
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 | |
125 | ||
126 | %files -n libimagequant-devel | |
127 | %defattr(644,root,root,755) | |
128 | %attr(755,root,root) %{_libdir}/libimagequant.so | |
129 | %{_includedir}/libimagequant.h | |
130 | ||
131 | %if %{with static_libs} | |
132 | %files -n libimagequant-static | |
133 | %defattr(644,root,root,755) | |
134 | %{_libdir}/libimagequant.a | |
135 | %endif |