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