]> git.pld-linux.org Git - packages/pdflib-lite.git/blob - pdflib-lite.spec
- bump java source version compatibility
[packages/pdflib-lite.git] / pdflib-lite.spec
1 # TODO: php, ruby
2 #
3 # Conditional build:
4 %bcond_without  static_libs     # static library
5 %bcond_without  cxx             # C++ binding
6 %bcond_without  java            # Java binding
7 %bcond_without  perl            # Perl binding
8 %bcond_without  python          # Python binding
9 %bcond_with     ruby            # Ruby binding (not finished in sources)
10 %bcond_without  tcl             # Tcl binding
11 %bcond_with     system_libjpeg  # system libjpeg library (included libtiff relies on libjpeg = 6b)
12 %bcond_without  system_libpng   # system libpng library
13 %bcond_with     system_libtiff  # system libtiff library (PDFLib uses modified version)
14 %bcond_without  system_zlib     # system ZLib library
15 #
16 Summary:        PDFlib - A library for generating PDF on the fly
17 Summary(pl.UTF-8):      PDFlib - biblioteka do tworzenia plików PDF w locie
18 Name:           pdflib-lite
19 Version:        7.0.5p3
20 Release:        2
21 License:        free for personal use
22 Group:          Libraries
23 # originally http://www.pdflib.com/download/pdflib-family/pdflib-lite-7/ but no longer available;
24 # use a copy from other distro repo
25 Source0:        http://ponce.cc/slackware/sources/repo/PDFlib-Lite-%{version}.tar.gz
26 # Source0-md5:  371d332d610a8b21a542bb7a2bdaf954
27 Patch0:         %{name}-format.patch
28 Patch1:         %{name}-tcl.patch
29 Patch2:         %{name}-modules.patch
30 Patch3:         %{name}-perl.patch
31 Patch4:         %{name}-python.patch
32 Patch5:         %{name}-libtool.patch
33 Patch6:         %{name}-system-libs.patch
34 Patch7:         %{name}-shared.patch
35 Patch8:         java-compat.patch
36 URL:            https://www.pdflib.com/
37 BuildRequires:  autoconf
38 BuildRequires:  automake
39 %{?with_java:BuildRequires:     jdk >= 1.4}
40 %{?with_system_libjpeg:BuildRequires:   libjpeg-devel >= 6b}
41 %{?with_system_libpng:BuildRequires:    libpng-devel >= 2:1.2.36}
42 %{?with_cxx:BuildRequires:      libstdc++-devel}
43 %{?with_system_libtiff:BuildRequires:   libtiff-devel >= 3.7.4}
44 BuildRequires:  libtool
45 %{?with_perl:BuildRequires:     perl-devel >= 5}
46 %{?with_python:BuildRequires:   python-devel >= 2}
47 BuildRequires:  rpm-perlprov
48 BuildRequires:  rpmbuild(macros) >= 1.754
49 %{?with_tcl:BuildRequires:      tcl-devel >= 8.2}
50 %{?with_system_zlib:BuildRequires:      zlib-devel >= 1.2.3}
51 %{?with_system_libjpeg:Requires:        libjpeg >= 6b}
52 %{?with_system_libpng:Requires: libpng >= 2:1.2.36}
53 %{?with_system_libtiff:Requires:        libtiff >= 3.7.4}
54 %{?with_system_zlib:Requires:   zlib >= 1.2.3}
55 Obsoletes:      pdflib < 5
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         tcl_ver         %(echo `echo "puts [info tclversion]" | tclsh`)
59 %define         tcl_libdir      %{_libdir}/tcl%{tcl_ver}
60
61 %description
62 PDFlib is a library for generating PDF files. It offers an API with
63 support for text, vector graphics, raster image, and hypertext. Call
64 PDFlib routines from within your client program and voila: dynamic PDF
65 files!
66
67 PDFlib Lite is an open-source edition for basic PDF generation, free
68 for personal use. PDFlib Lite does not support all languages, and is
69 not available on EBCDIC platforms. PDFlib Lite supports only a subset
70 of PDFlib features.
71
72 %description -l pl.UTF-8
73 PDFlib to biblioteka do generowania plików PDF. Oferuje API z obsługą
74 tekstu, grafiki wektorowej, obrazów rastrowych i hipertekstu. Funkcje
75 biblioteki PDFlib można wywoływać z programów klienckich, otrzymując
76 dynamiczne pliki PDF.
77
78 PDFlib Lite to wydanie biblioteki z otwartymi źródłami, pozwalające na
79 generowanie podstawowych plików PDF, darmowe do użytku osobistego. Nie
80 obsługuje wszystkich języków, nie jest dostępne na platformach EBCDIC.
81 Obsługuje tylko podzbiór możliwości pełnej wersji biblioteki PDFlib.
82
83 %package devel
84 Summary:        Header file for PDFlib Lite library
85 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki PDFlib Lite
86 Group:          Development/Libraries
87 Requires:       %{name} = %{version}-%{release}
88 %{?with_system_libjpeg:BuildRequires:   libjpeg-devel >= 6b}
89 %{?with_system_libpng:BuildRequires:    libpng-devel >= 2:1.2.36}
90 %{?with_system_libtiff:BuildRequires:   libtiff-devel >= 3.7.4}
91 %{?with_system_zlib:BuildRequires:      zlib-devel >= 1.2.3}
92 Obsoletes:      pdflib-devel < 5
93
94 %description devel
95 Header file for PDFlib Lite library.
96
97 %description devel -l pl.UTF-8
98 Plik nagłówkowy biblioteki PDFlib Lite.
99
100 %package static
101 Summary:        Static PDFlib Lite library
102 Summary(pl.UTF-8):      Statyczna biblioteka PDFlib Lite
103 Group:          Development/Libraries
104 Requires:       %{name}-devel = %{version}-%{release}
105 Obsoletes:      pdflib-static < 5
106
107 %description static
108 Static PDFlib Lite library.
109
110 %description static -l pl.UTF-8
111 Statyczna biblioteka PDFlib Lite.
112
113 %package c++
114 Summary:        C++ binding for PDFlib Lite library
115 Summary(pl.UTF-8):      Wiązania C++ do biblioteki PDFlib Lite
116 Group:          Libraries
117 Requires:       %{name} = %{version}-%{release}
118
119 %description c++
120 C++ binding for PDFlib Lite library.
121
122 %description c++ -l pl.UTF-8
123 Wiązania C++ do biblioteki PDFlib Lite.
124
125 %package c++-devel
126 Summary:        Header file for C++ PDFlib Lite binding
127 Summary(pl.UTF-8):      Plik nagłówkowy wiązań C++ do biblioteki PDFlib Lite
128 Group:          Development/Libraries
129 Requires:       %{name}-c++ = %{version}-%{release}
130 Requires:       %{name}-devel = %{version}-%{release}
131 Requires:       libstdc++-devel
132
133 %description c++-devel
134 Header file for C++ PDFlib Lite binding.
135
136 %description c++-devel -l pl.UTF-8
137 Plik nagłówkowy wiązań C++ do biblioteki PDFlib Lite.
138
139 %package c++-static
140 Summary:        Static C++ PDFlib Lite binding library
141 Summary(pl.UTF-8):      Statyczna biblioteka wiązań C++ do biblioteki PDFlib Lite
142 Group:          Development/Libraries
143 Requires:       %{name}-c++-devel = %{version}-%{release}
144
145 %description c++-static
146 Static C++ PDFlib Lite binding library.
147
148 %description c++-static -l pl.UTF-8
149 Statyczna biblioteka wiązań C++ do biblioteki PDFlib Lite.
150
151 %package -n java-pdflib-lite
152 Summary:        Java bindings for PDFlib Lite library
153 Summary(pl.UTF-8):      Wiązania Javy do biblioteki PDFlib Lite
154 Group:          Development/Languages/Java
155 Requires:       %{name} = %{version}-%{release}
156 Obsoletes:      pdflib-java < 5
157
158 %description -n java-pdflib-lite
159 Java bindings for PDFlib Lite library.
160
161 %description -n java-pdflib-lite -l pl.UTF-8
162 Wiązania Javy do biblioteki PDFlib Lite.
163
164 %package -n java-pdflib-lite-javadoc
165 Summary:        Documentation for Java PDFlib Lite binding
166 Summary(pl.UTF-8):      Dokumentacja wiązań Javy do biblioteki PDFlib Lite
167 Group:          Documentation
168 BuildArch:      noarch
169
170 %description -n java-pdflib-lite-javadoc
171 Documentation for Java PDFlib Lite binding.
172
173 %description -n java-pdflib-lite-javadoc -l pl.UTF-8
174 Dokumentacja wiązań Javy do biblioteki PDFlib Lite.
175
176 %package -n perl-pdflib-lite
177 Summary:        Perl bindings for PDFlib Lite library
178 Summary(pl.UTF-8):      Wiązania Perla do biblioteki PDFlib Lite
179 Group:          Development/Languages/Perl
180 Requires:       %{name} = %{version}-%{release}
181 Obsoletes:      pdflib-perl < 5
182 Obsoletes:      pdflib-perl5 < 5
183
184 %description -n perl-pdflib-lite
185 Perl bindings for PDFlib Lite library.
186
187 %description -n perl-pdflib-lite -l pl.UTF-8
188 Wiązania Perla do biblioteki PDFlib Lite.
189
190 %package -n python-pdflib-lite
191 Summary:        Python 2 bindings for PDFlib Lite library
192 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki PDFlib Lite
193 Group:          Development/Languages/Python
194 Requires:       %{name} = %{version}-%{release}
195 Obsoletes:      pdflib-python < 5
196 Obsoletes:      pdflib-python1.5 < 5
197
198 %description -n python-pdflib-lite
199 Python 2 bindings for PDFlib Lite library.
200
201 %description -n python-pdflib-lite -l pl.UTF-8
202 Wiązania Pythona 2 do biblioteki PDFlib Lite.
203
204 %package -n tcl-pdflib-lite
205 Summary:        Tcl bindings for PDFlib Lite library
206 Summary(pl.UTF-8):      Wiązania Tcl-a do biblioteki PDFlib Lite
207 Group:          Development/Languages/Tcl
208 Requires:       %{name} = %{version}-%{release}
209 Obsoletes:      pdflib-tcl < 5
210 Obsoletes:      pdflib-tcl8.0 < 5
211
212 %description -n tcl-pdflib-lite
213 Tcl bindings for PDFlib Lite library.
214
215 %description -n tcl-pdflib-lite -l pl.UTF-8
216 Wiązania Tcl-a do biblioteki PDFlib Lite.
217
218 %prep
219 %setup -q -n PDFlib-Lite-%{version}
220 %patch0 -p1
221 %patch1 -p1
222 %patch2 -p1
223 %patch3 -p1
224 %patch4 -p1
225 %patch5 -p1
226 %patch6 -p1
227 %patch7 -p1
228 %patch8 -p1
229
230 %{?with_system_zlib:%{__rm} -r libs/flate}
231 %{?with_system_zlib:%{__sed} -i -e '/\/flate\// d' libs/pdflib/Make_objs2.inc}
232 %{?with_system_libjpeg:%{__rm} -r libs/jpeg}
233 %{?with_system_libjpeg:%{__sed} -i -e '/\/jpeg\// d' libs/pdflib/Make_objs2.inc}
234 %{?with_system_libpng:%{__rm} -r libs/png}
235 %{?with_system_libpng:%{__sed} -i -e '/\/png\// d' libs/pdflib/Make_objs2.inc}
236 %{?with_system_libtiff:%{__rm} -r libs/tiff}
237 %{?with_system_libtiff:%{__sed} -i -e '/\/tiff\// d' libs/pdflib/Make_objs2.inc}
238
239 : >config/aclocal.m4
240
241 %build
242 %{__libtoolize}
243 %{__aclocal} --output config/aclocal.m4
244 %{__autoconf}
245 %configure \
246         %{!?with_cxx:--disable-cxx} \
247         %{!?with_static_libs:--disable-static} \
248         --with-java=%{?with_java:%{java_home}}%{!?with_java:no} \
249 %if %{with perl}
250         --with-perl=%{__perl} \
251         --with-perlincl=%{perl_archlib}/CORE \
252 %else
253         --without-perl \
254 %endif
255 %if %{with python}
256         --with-py=%{py_sitedir} \
257         --with-pyincl=%{py_incdir} \
258 %else
259         --without-py \
260 %endif
261 %if %{with ruby}
262         --with-ruby=%{__ruby} \
263         --with-rubyincl=%{ruby_rubyhdrdir} \
264 %else
265         --without-ruby \
266 %endif
267 %if %{with tcl}
268         --with-tcl=%{_bindir}/tclsh \
269         --with-tclpkg=%{_libdir}/tcl%{tcl_ver} \
270 %else
271         --without-tcl
272 %endif
273
274 %{__make}
275
276 %if %{with cxx}
277 cd bind/pdflib/cpp
278 ../../../libtool --mode=link %{__cxx} -o libpdf_cpp.la pdflib.lo ../../../libs/pdflib/libpdf.la -rpath %{_libdir}
279 cd ../../..
280 %endif
281
282 %if %{with java}
283 %{__make} -C bind/pdflib/java javadoc
284 %endif
285
286 %if %{with perl}
287 %{__make} -C bind/pdflib/perl
288 %endif
289
290 %if %{with python}
291 %{__make} -C bind/pdflib/python
292 %endif
293
294 %if %{with ruby}
295 %{__make} -C bind/pdflib/ruby
296 %endif
297
298 %if %{with tcl}
299 %{__make} -C bind/pdflib/tcl
300 %endif
301
302 %install
303 rm -rf $RPM_BUILD_ROOT
304
305 %{__make} install \
306         DESTDIR=$RPM_BUILD_ROOT
307
308 %if %{with cxx}
309 cd bind/pdflib/cpp
310 ../../../libtool --mode=install install libpdf_cpp.la $RPM_BUILD_ROOT%{_libdir}
311 cp -p pdflib.hpp $RPM_BUILD_ROOT%{_includedir}
312 cd ../../..
313 %endif
314
315 %if %{with java}
316 install -d $RPM_BUILD_ROOT{%{_javadir},%{_javadocdir}}
317 cp -p bind/pdflib/java/pdflib.jar $RPM_BUILD_ROOT%{_javadir}
318 cp -pr bind/pdflib/java/javadoc $RPM_BUILD_ROOT%{_javadocdir}/pdflib
319 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libpdf_java.la
320 %endif
321
322 %if %{with perl}
323 install -d $RPM_BUILD_ROOT%{perl_vendorarch}
324 %{__make} -C bind/pdflib/perl install \
325         DESTDIR=$RPM_BUILD_ROOT
326 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/pdflib_pl.la
327 %endif
328
329 %if %{with python}
330 install -d $RPM_BUILD_ROOT%{py_sitedir}
331 %{__make} -C bind/pdflib/python install \
332         DESTDIR=$RPM_BUILD_ROOT
333 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/pdflib_py.la
334 %endif
335
336 %if %{with ruby}
337 %{__make} -C bind/pdflib/ruby install \
338         DESTDIR=$RPM_BUILD_ROOT
339 %endif
340
341 %if %{with tcl}
342 %{__make} -C bind/pdflib/tcl install \
343         DESTDIR=$RPM_BUILD_ROOT
344 %{__rm} $RPM_BUILD_ROOT%{tcl_libdir}/pdflib/pdflib_tcl.la
345 %endif
346
347 # ensure soname deps are generated
348 find $RPM_BUILD_ROOT%{_libdir} -name '*.so*' | xargs chmod 755
349
350 %clean
351 rm -rf $RPM_BUILD_ROOT
352
353 %post   -p /sbin/ldconfig
354 %postun -p /sbin/ldconfig
355
356 %post   c++ -p /sbin/ldconfig
357 %postun c++ -p /sbin/ldconfig
358
359 %post   -n java-pdflib-lite -p /sbin/ldconfig
360 %postun -n java-pdflib-lite -p /sbin/ldconfig
361
362 %files
363 %defattr(644,root,root,755)
364 %doc readme.txt doc/PDFlib-terms-and-conditions.pdf doc/pdflib/{PDFlib-Lite-license.pdf,changes.txt}
365 %attr(755,root,root) %{_bindir}/pdfimage
366 %attr(755,root,root) %{_bindir}/text2pdf
367 %attr(755,root,root) %{_libdir}/libpdf.so.*.*.*
368 %attr(755,root,root) %ghost %{_libdir}/libpdf.so.6
369
370 %files devel
371 %defattr(644,root,root,755)
372 %doc doc/pdflib/{PDFlib-API-reference.pdf,PDFlib-tutorial.pdf,compatibility.txt}
373 %attr(755,root,root) %{_bindir}/pdflib-config
374 %attr(755,root,root) %{_libdir}/libpdf.so
375 %{_libdir}/libpdf.la
376 %{_includedir}/pdflib.h
377
378 %if %{with static_libs}
379 %files static
380 %defattr(644,root,root,755)
381 %{_libdir}/libpdf.a
382 %endif
383
384 %if %{with cxx}
385 %files c++
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_libdir}/libpdf_cpp.so.*.*.*
388 %attr(755,root,root) %ghost %{_libdir}/libpdf_cpp.so.0
389
390 %files c++-devel
391 %defattr(644,root,root,755)
392 %attr(755,root,root) %{_libdir}/libpdf_cpp.so
393 %{_libdir}/libpdf_cpp.la
394 %{_includedir}/pdflib.hpp
395
396 %if %{with static_libs}
397 %files c++-static
398 %defattr(644,root,root,755)
399 %{_libdir}/libpdf_cpp.a
400 %endif
401 %endif
402
403 %if %{with java}
404 %files -n java-pdflib-lite
405 %defattr(644,root,root,755)
406 %doc bind/pdflib/java/readme.txt
407 %attr(755,root,root) %{_libdir}/libpdf_java.so
408 %{_javadir}/pdflib.jar
409
410 %files -n java-pdflib-lite-javadoc
411 %defattr(644,root,root,755)
412 %{_javadocdir}/pdflib
413 %endif
414
415 %if %{with perl}
416 %files -n perl-pdflib-lite
417 %defattr(644,root,root,755)
418 %doc bind/pdflib/perl/readme.txt
419 %{perl_vendorarch}/pdflib_pl.pm
420 %attr(755,root,root) %{perl_vendorarch}/pdflib_pl.so
421 %endif
422
423 %if %{with perl}
424 %files -n python-pdflib-lite
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{py_sitedir}/pdflib_py.so
427 %endif
428
429 %if %{with tcl}
430 %files -n tcl-pdflib-lite
431 %defattr(644,root,root,755)
432 %doc bind/pdflib/tcl/readme.txt
433 %dir %{tcl_libdir}/pdflib
434 %attr(755,root,root) %{tcl_libdir}/pdflib/pdflib_tcl.so
435 %{tcl_libdir}/pdflib/pkgIndex.tcl
436 %endif
This page took 0.111495 seconds and 4 git commands to generate.