]> git.pld-linux.org Git - packages/pngquant.git/blob - pngquant.spec
- new
[packages/pngquant.git] / pngquant.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # static library
4 %bcond_without  gomp            # OpenMP support
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
14 Version:        2.4.1
15 Release:        1
16 License:        BSD
17 Group:          Libraries
18 #Source0Download: https://pngquant.org/releases.html
19 Source0:        https://pngquant.org/%{name}-%{version}-src.tar.bz2
20 # Source0-md5:  2809b10f8d183853c1283cfdfa292ab3
21 Patch0:         %{name}-soname.patch
22 Patch1:         %{name}-shared.patch
23 URL:            https://pngquant.org/
24 %{?with_gomp:BuildRequires:     gcc >= 6:4.2}
25 %{?with_gomp:BuildRequires:     libgomp-devel}
26 %{?with_lcms:BuildRequires:     lcms2-devel >= 2}
27 BuildRequires:  libpng-devel
28 BuildRequires:  pkgconfig
29 BuildRequires:  zlib-devel
30 Requires:       libimagequant = %{version}-%{release}
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 PNG converter and lossy image compressor.
35
36 %description -l pl.UTF-8
37 Konwerter i stratny kompresor dla plików PNG.
38
39 %package -n libimagequant
40 Summary:        Image Quantization library
41 Summary(pl.UTF-8):      Biblioteka do kwantyzacji obrazów
42 Group:          Libraries
43 URL:            https://pngquant.org/lib/
44
45 %description -n libimagequant
46 Image Quantization library.
47
48 %description -n libimagequant -l pl.UTF-8
49 Biblioteka do kwantyzacji obrazów.
50
51 %package -n libimagequant-devel
52 Summary:        Header files for libimagequant library
53 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libimagequant
54 Group:          Development/Libraries
55 URL:            https://pngquant.org/lib/
56 Requires:       libimagequant = %{version}-%{release}
57
58 %description -n libimagequant-devel
59 Header files for libimagequant library.
60
61 %description -n libimagequant-devel -l pl.UTF-8
62 Pliki nagłówkowe biblioteki libimagequant.
63
64 %package -n libimagequant-static
65 Summary:        Static libimagequant library
66 Summary(pl.UTF-8):      Statyczna biblioteka libimagequant
67 Group:          Development/Libraries
68 URL:            https://pngquant.org/lib/
69 Requires:       libimagequant-devel = %{version}-%{release}
70
71 %description -n libimagequant-static
72 Static libimagequant library.
73
74 %description -n libimagequant-static -l pl.UTF-8
75 Statyczna biblioteka libimagequant.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80 %patch1 -p1
81
82 %build
83 # not autoconf configure
84 ./configure \
85         CC="%{__cc}" \
86         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
87         LDFLAGS="%{rpmldflags}" \
88         --prefix=%{_prefix} \
89         %{?with_sse:--enable-sse} \
90         %{?with_lcms:--with-lcms2} \
91         %{?with_gomp:--with-openmp}
92
93 %{__make} -C lib %{!?with_static_libs:shared}
94
95 %{__make}
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
100
101 %{__make} install \
102         DESTDIR=$RPM_BUILD_ROOT
103
104 cp -a lib/libimagequant.so* $RPM_BUILD_ROOT%{_libdir}
105 %if %{with static_libs}
106 cp -p lib/libimagequant.a $RPM_BUILD_ROOT%{_libdir}
107 %endif
108 cp -p lib/libimagequant.h $RPM_BUILD_ROOT%{_includedir}
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %post   -n libimagequant -p /sbin/ldconfig
114 %postun -n libimagequant -p /sbin/ldconfig
115
116 %files
117 %defattr(644,root,root,755)
118 %doc CHANGELOG COPYRIGHT README.md
119 %attr(755,root,root) %{_bindir}/pngquant
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
This page took 0.079121 seconds and 3 git commands to generate.