- updated to 21.03.0 (new libpoppler soname)
[packages/poppler.git] / poppler.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # gtk-doc API documentation
4 %bcond_without  cairo   # Cairo backend
5 %bcond_without  qt5     # Qt 5 wrapper
6 %bcond_with     qt6     # Qt 6 wrapper
7 %bcond_without  cpp     # C++ wrapper
8 %bcond_without  glib    # GLib wrapper
9 %bcond_without  static_libs     # don't build static libraries
10
11 %define         cairo_ver       1.10.0
12 %define         qt5_ver         5.5.0
13 %define         qt6_ver         6.0.0
14 Summary:        PDF rendering library
15 Summary(pl.UTF-8):      Biblioteka renderująca PDF
16 Name:           poppler
17 Version:        21.03.0
18 Release:        1
19 License:        GPL v2+
20 Group:          Libraries
21 Source0:        https://poppler.freedesktop.org/%{name}-%{version}.tar.xz
22 # Source0-md5:  641a9f382c4166d5728f1f28f163de58
23 Patch0:         %{name}-gtkdocdir.patch
24 Patch1:         %{name}-include.patch
25 URL:            https://poppler.freedesktop.org/
26 %{?with_qt5:BuildRequires:      Qt5Core-devel >= %{qt5_ver}}
27 %{?with_qt5:BuildRequires:      Qt5Gui-devel >= %{qt5_ver}}
28 %{?with_qt5:BuildRequires:      Qt5Test-devel >= %{qt5_ver}}
29 %{?with_qt5:BuildRequires:      Qt5Widgets-devel >= %{qt5_ver}}
30 %{?with_qt5:BuildRequires:      Qt5Xml-devel >= %{qt5_ver}}
31 %{?with_qt6:BuildRequires:      Qt6Core-devel >= %{qt6_ver}}
32 %{?with_qt6:BuildRequires:      Qt6Gui-devel >= %{qt6_ver}}
33 %{?with_qt6:BuildRequires:      Qt6Test-devel >= %{qt6_ver}}
34 %{?with_qt6:BuildRequires:      Qt6Widgets-devel >= %{qt6_ver}}
35 BuildRequires:  boost-devel >= 1.58.0
36 %{?with_cairo:BuildRequires:    cairo-devel >= %{cairo_ver}}
37 BuildRequires:  cmake >= 3.5.0
38 BuildRequires:  curl-devel
39 BuildRequires:  docbook-dtd412-xml
40 BuildRequires:  fontconfig-devel >= 2.0.0
41 BuildRequires:  freetype-devel >= 2.0
42 BuildRequires:  gettext-tools
43 %{?with_glib:BuildRequires:     glib2-devel >= 1:2.41}
44 %{?with_glib:BuildRequires:     gobject-introspection-devel >= 0.9.12}
45 %{?with_apidocs:BuildRequires:  gtk-doc >= 1.14}
46 BuildRequires:  lcms2-devel >= 2
47 BuildRequires:  libjpeg-devel
48 BuildRequires:  libpng-devel
49 # -std=c++14
50 BuildRequires:  libstdc++-devel >= 6:5.0
51 BuildRequires:  libtiff-devel
52 BuildRequires:  libxml2-devel >= 2.0
53 BuildRequires:  nss-devel >= 3.19
54 BuildRequires:  openjpeg2-devel >= 2
55 BuildRequires:  pkgconfig >= 1:0.18
56 # wanted cairo backends
57 BuildRequires:  pkgconfig(cairo-pdf) >= %{cairo_ver}
58 BuildRequires:  pkgconfig(cairo-ps) >= %{cairo_ver}
59 BuildRequires:  pkgconfig(cairo-svg) >= %{cairo_ver}
60 %{?with_qt5:BuildRequires:      qt5-build >= %{qt5_ver}}
61 %{?with_qt6:BuildRequires:      qt6-build >= %{qt6_ver}}
62 BuildRequires:  rpmbuild(macros) >= 1.752
63 BuildRequires:  sed >= 4.0
64 BuildRequires:  tar >= 1:1.22
65 BuildRequires:  which
66 BuildRequires:  xz
67 BuildRequires:  zlib-devel
68 Requires:       openjpeg2 >= 2
69 Obsoletes:      poppler-qt4-static
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 %description
73 A common PDF rendering library for integrating PDF viewing into
74 desktop applications (based on the xpdf-3.0 code base).
75
76 %description -l pl.UTF-8
77 Wspólna biblioteka renderująca PDF do integrowania oglądania PDF w
78 aplikacjach desktopowych (oparta na kodzie xpdf-3.0).
79
80 %package devel
81 Summary:        Poppler header files
82 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Poppler
83 Group:          Development/Libraries
84 Requires:       %{name} = %{version}-%{release}
85 Requires:       curl-devel
86 Requires:       lcms2-devel >= 2
87 Requires:       libstdc++-devel >= 6:5.0
88 Requires:       nss-devel >= 3.19
89 Conflicts:      poppler0.61-devel
90
91 %description devel
92 Header files for the Poppler library.
93
94 %description devel -l pl.UTF-8
95 Pliki nagłówkowe biblioteki Poppler.
96
97 %package static
98 Summary:        Poppler static libraries
99 Summary(pl.UTF-8):      Statyczne biblioteki Poppler
100 Group:          Development/Libraries
101 Requires:       %{name}-devel = %{version}-%{release}
102
103 %description static
104 Poppler static libraries.
105
106 %description static -l pl.UTF-8
107 Statyczne biblioteki Poppler.
108
109 %package apidocs
110 Summary:        Poppler library API documentation
111 Summary(pl.UTF-8):      Dokumentacja API biblioteki Poppler
112 Group:          Documentation
113 Requires:       gtk-doc-common
114 BuildArch:      noarch
115
116 %description apidocs
117 Poppler library API documentation.
118
119 %description apidocs -l pl.UTF-8
120 Dokumentacja API biblioteki Poppler.
121
122 %package cpp
123 Summary:        Cpp wrapper for poppler
124 Summary(pl.UTF-8):      Wrapper cpp dla popplera
125 Group:          Libraries
126 Requires:       %{name} = %{version}-%{release}
127
128 %description cpp
129 Cpp wrapper for poppler.
130
131 %description cpp -l pl.UTF-8
132 Wrapper cpp dla popplera.
133
134 %package cpp-devel
135 Summary:        Header files for cpp wrapper for poppler
136 Summary(pl.UTF-8):      Pliki nagłówkowe wrappera cpp dla popplera
137 Group:          Development/Libraries
138 Requires:       %{name}-cpp = %{version}-%{release}
139 Requires:       %{name}-devel = %{version}-%{release}
140
141 %description cpp-devel
142 Header files for cpp wrapper for poppler.
143
144 %description cpp-devel -l pl.UTF-8
145 Pliki nagłówkowe wrappera cpp dla popplera.
146
147 %package cpp-static
148 Summary:        Static version of cpp wrapper for poppler
149 Summary(pl.UTF-8):      Statyczna wersja wrappera cpp dla popplera
150 Group:          Development/Libraries
151 Requires:       %{name}-cpp-devel = %{version}-%{release}
152
153 %description cpp-static
154 Static version of cpp wrapper for poppler.
155
156 %description cpp-static -l pl.UTF-8
157 Statyczna wersja wrappera cpp dla popplera.
158
159 %package glib
160 Summary:        GLib wrapper for poppler
161 Summary(pl.UTF-8):      Wrapper GLib dla popplera
162 Group:          Libraries
163 Requires:       %{name} = %{version}-%{release}
164 %{?with_cairo:Requires: cairo >= %{cairo_ver}}
165 Requires:       glib2 >= 1:2.41
166
167 %description glib
168 GLib wrapper for poppler.
169
170 %description glib -l pl.UTF-8
171 Wrapper GLib dla popplera.
172
173 %package glib-devel
174 Summary:        Header files for GLib wrapper for poppler
175 Summary(pl.UTF-8):      Pliki nagłówkowe wrappera GLib dla popplera
176 Group:          Development/Libraries
177 Requires:       %{name}-devel = %{version}-%{release}
178 Requires:       %{name}-glib = %{version}-%{release}
179 %{?with_cairo:Requires: cairo-devel >= %{cairo_ver}}
180 Requires:       glib2-devel >= 1:2.41
181
182 %description glib-devel
183 Header files for GLib wrapper for poppler.
184
185 %description glib-devel -l pl.UTF-8
186 Pliki nagłówkowe wrappera GLib dla popplera.
187
188 %package glib-static
189 Summary:        Static version of GLib wrapper for poppler
190 Summary(pl.UTF-8):      Statyczna wersja wrappera GLib dla popplera
191 Group:          Development/Libraries
192 Requires:       %{name}-glib-devel = %{version}-%{release}
193
194 %description glib-static
195 Static version of GLib wrapper for poppler.
196
197 %description glib-static -l pl.UTF-8
198 Statyczna wersja wrappera GLib dla popplera.
199
200 %package qt5
201 Summary:        Qt5 wrapper for poppler
202 Summary(pl.UTF-8):      Wrapper Qt5 dla popplera
203 Group:          Libraries
204 Requires:       %{name} = %{version}-%{release}
205
206 %description qt5
207 Qt5 wrapper for poppler.
208
209 %description qt5 -l pl.UTF-8
210 Wrapper Qt5 dla popplera.
211
212 %package qt5-devel
213 Summary:        Header files for Qt5 wrapper for poppler
214 Summary(pl.UTF-8):      Pliki nagłówkowe wrappera Qt5 dla popplera
215 Group:          Development/Libraries
216 Requires:       %{name}-devel = %{version}-%{release}
217 Requires:       %{name}-qt5 = %{version}-%{release}
218 Requires:       Qt5Core-devel >= %{qt5_ver}
219 Requires:       Qt5Gui-devel >= %{qt5_ver}
220 Requires:       Qt5Widgets-devel >= %{qt5_ver}
221 Requires:       Qt5Xml-devel >= %{qt5_ver}
222
223 %description qt5-devel
224 Header files for Qt5 wrapper for poppler.
225
226 %description qt5-devel -l pl.UTF-8
227 Pliki nagłówkowe wrapper Qt5 dla popplera.
228
229 %package qt5-static
230 Summary:        Static version of Qt5 wrapper for poppler
231 Summary(pl.UTF-8):      Statyczna wersja wrappera Qt5 dla popplera
232 Group:          Development/Libraries
233 Requires:       %{name}-qt5-devel = %{version}-%{release}
234
235 %description qt5-static
236 Static version of Qt5 wrapper for poppler.
237
238 %description qt5-static -l pl.UTF-8
239 Statyczna wersja wrappera Qt5 dla popplera.
240
241 %package progs
242 Summary:        Set of tools for viewing information and converting PDF files
243 Summary(pl.UTF-8):      Zestaw narzędzi do wyświetlania informacji i konwertowania plików PDF
244 Group:          Applications/Publishing
245 Provides:       pdftops
246 Obsoletes:      pdftohtml
247 Obsoletes:      pdftohtml-pdftops
248 Obsoletes:      poppler-utils
249 Obsoletes:      xpdf-tools
250
251 %description progs
252 Package contains utilites for PDF files. These utilities allow to
253 - extract information about PDF files,
254 - extract images from PDF files,
255 - convert PDF files to HTML, plain text and PS formats.
256
257 %description progs -l pl.UTF-8
258 Pakiet zawiera zestaw narzędzi do plików PDF. Programy te umożliwiają
259 - wyświetlanie informacji o plikach PDF,
260 - wydobywanie obrazków z plików PDF,
261 - konwersję plików PDF do formatów takich jak HTML, PS czy też
262   czystego tekstu.
263
264 %prep
265 %setup -q
266 %patch0 -p1
267 %patch1 -p1
268
269 %build
270 install -d build
271 cd build
272 %cmake .. \
273         %{!?with_cpp:-DENABLE_CPP=OFF} \
274         %{!?with_glib:-DENABLE_GLIB=OFF} \
275         %{?with_apidocs:-DENABLE_GTK_DOC=ON} \
276         -DENABLE_GTK_TESTS=OFF \
277         -DENABLE_LIBCURL=ON \
278         %{!?with_qt5:-DENABLE_QT5=OFF} \
279         %{!?with_qt6:-DENABLE_QT6=OFF} \
280         -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
281         -DENABLE_ZLIB=ON \
282         %{!?with_cairo:-DWITH_CAIRO=OFF}
283
284 %{__make}
285 cd ..
286
287 %if %{with static_libs}
288 install -d build-static
289 cd build-static
290 %cmake .. \
291         -DBUILD_SHARED_LIBS=OFF \
292         %{!?with_cpp:-DENABLE_CPP=OFF} \
293         %{!?with_glib:-DENABLE_GLIB=OFF} \
294         -DENABLE_GTK_DOC=OFF \
295         -DENABLE_GTK_TESTS=OFF \
296         -DENABLE_LIBCURL=ON \
297         %{!?with_qt5:-DENABLE_QT5=OFF} \
298         -DENABLE_ZLIB=ON \
299         %{!?with_cairo:-DWITH_CAIRO=OFF}
300
301 %{__make}
302 %endif
303
304 %install
305 rm -rf $RPM_BUILD_ROOT
306
307 %if %{with static_libs}
308 %{__make} -C build-static install \
309         DESTDIR=$RPM_BUILD_ROOT
310 %endif
311
312 %{__make} -C build install \
313         DESTDIR=$RPM_BUILD_ROOT
314
315 %clean
316 rm -rf $RPM_BUILD_ROOT
317
318 %post   -p /sbin/ldconfig
319 %postun -p /sbin/ldconfig
320
321 %post   cpp -p /sbin/ldconfig
322 %postun cpp -p /sbin/ldconfig
323
324 %post   glib -p /sbin/ldconfig
325 %postun glib -p /sbin/ldconfig
326
327 %post   qt5 -p /sbin/ldconfig
328 %postun qt5 -p /sbin/ldconfig
329
330 %files
331 %defattr(644,root,root,755)
332 %doc AUTHORS ChangeLog NEWS README*
333 %attr(755,root,root) %{_libdir}/libpoppler.so.*.*.*
334 %attr(755,root,root) %ghost %{_libdir}/libpoppler.so.108
335
336 %files devel
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/libpoppler.so
339 %dir %{_includedir}/poppler
340 %{_includedir}/poppler/poppler-config.h
341 %{_includedir}/poppler/[ABCDEFGHJLMNOPRSTUVX]*.h
342 %{_includedir}/poppler/fofi
343 %{_includedir}/poppler/goo
344 %{_includedir}/poppler/splash
345 %{_pkgconfigdir}/poppler.pc
346
347 %if %{with static_libs}
348 %files static
349 %defattr(644,root,root,755)
350 %{_libdir}/libpoppler.a
351 %endif
352
353 %if %{with apidocs}
354 %files apidocs
355 %defattr(644,root,root,755)
356 %{_gtkdocdir}/poppler
357 %endif
358
359 %if %{with cpp}
360 %files cpp
361 %defattr(644,root,root,755)
362 %attr(755,root,root) %{_libdir}/libpoppler-cpp.so.*.*.*
363 %attr(755,root,root) %ghost %{_libdir}/libpoppler-cpp.so.0
364
365 %files cpp-devel
366 %defattr(644,root,root,755)
367 %attr(755,root,root) %{_libdir}/libpoppler-cpp.so
368 %{_includedir}/poppler/cpp
369 %{_pkgconfigdir}/poppler-cpp.pc
370
371 %if %{with static_libs}
372 %files cpp-static
373 %defattr(644,root,root,755)
374 %{_libdir}/libpoppler-cpp.a
375 %endif
376 %endif
377
378 %if %{with glib}
379 %files glib
380 %defattr(644,root,root,755)
381 %attr(755,root,root) %{_libdir}/libpoppler-glib.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libpoppler-glib.so.8
383 %{_libdir}/girepository-1.0/Poppler-0.18.typelib
384
385 %files glib-devel
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_libdir}/libpoppler-glib.so
388 %{_includedir}/poppler/glib
389 %{_pkgconfigdir}/poppler-glib.pc
390 %{_datadir}/gir-1.0/Poppler-0.18.gir
391
392 %if %{with static_libs}
393 %files glib-static
394 %defattr(644,root,root,755)
395 %{_libdir}/libpoppler-glib.a
396 %endif
397 %endif
398
399 %if %{with qt5}
400 %files qt5
401 %defattr(644,root,root,755)
402 %attr(755,root,root) %{_libdir}/libpoppler-qt5.so.*.*.*
403 %attr(755,root,root) %ghost %{_libdir}/libpoppler-qt5.so.1
404
405 %files qt5-devel
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_libdir}/libpoppler-qt5.so
408 %{_includedir}/poppler/qt5
409 %{_pkgconfigdir}/poppler-qt5.pc
410
411 %if %{with static_libs}
412 %files qt5-static
413 %defattr(644,root,root,755)
414 %{_libdir}/libpoppler-qt5.a
415 %endif
416 %endif
417
418 %files progs
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_bindir}/pdfattach
421 %attr(755,root,root) %{_bindir}/pdfdetach
422 %attr(755,root,root) %{_bindir}/pdffonts
423 %attr(755,root,root) %{_bindir}/pdfimages
424 %attr(755,root,root) %{_bindir}/pdfinfo
425 %attr(755,root,root) %{_bindir}/pdfseparate
426 %attr(755,root,root) %{_bindir}/pdfsig
427 %attr(755,root,root) %{_bindir}/pdftocairo
428 %attr(755,root,root) %{_bindir}/pdftohtml
429 %attr(755,root,root) %{_bindir}/pdftoppm
430 %attr(755,root,root) %{_bindir}/pdftops
431 %attr(755,root,root) %{_bindir}/pdftotext
432 %attr(755,root,root) %{_bindir}/pdfunite
433 %{_mandir}/man1/pdfattach.1*
434 %{_mandir}/man1/pdfdetach.1*
435 %{_mandir}/man1/pdffonts.1*
436 %{_mandir}/man1/pdfimages.1*
437 %{_mandir}/man1/pdfinfo.1*
438 %{_mandir}/man1/pdfseparate.1*
439 %{_mandir}/man1/pdfsig.1*
440 %{_mandir}/man1/pdftocairo.1*
441 %{_mandir}/man1/pdftohtml.1*
442 %{_mandir}/man1/pdftoppm.1*
443 %{_mandir}/man1/pdftops.1*
444 %{_mandir}/man1/pdftotext.1*
445 %{_mandir}/man1/pdfunite.1*
This page took 0.107486 seconds and 4 git commands to generate.