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