summaryrefslogtreecommitdiffstats
path: root/pdflib-lite.spec
blob: 0eb99516fc48c4cc2179e774ba336e90f5709f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
%global with_python 0
%global with_perl   0
%else
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_include:  %global python_include  %(%{__python} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(0)")}
%global with_python 1
%global with_perl   1
%endif


Summary:        Portable C library for dynamically generating PDF files
Name:           pdflib-lite
# Remenber to check the URL after changing this...
Version:        7.0.5
Release:        10%{?dist}
License:        Distributable
URL:            http://www.pdflib.com/

Source:         http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-%{version}.tar.gz

Patch0:         pdflib-lite-7.0.4-gcc43.patch
Patch1:         pdflib-lite-7.0.5-format-security.patch

BuildRequires:  gcc
BuildRequires:  gcc-c++


%description
PDFlib is a development tool for PDF-enabling your software, 
or generating PDF on your server. PDFlib offers a simple-to-use API
for programmatically creating PDF files from within your own server- 
or client-side software. PDFlib doesn't make use of third-party software
for generating PDF, nor does it require any other tools.

%package devel
Summary:        Development files for pdflib
Requires:       %{name} = %{version}-%{release}

%description devel
PDFlib is a development tool for PDF-enabling your software, 
or generating PDF on your server. PDFlib offers a simple-to-use API
for programmatically creating PDF files from within your own server- 
or client-side software. PDFlib doesn't make use of third-party software
for generating PDF, nor does it require any other tools.

This package contains the files needed for compiling programs that will use
the PDFlib library.

%if %{with_python}
%package python
Summary:        Python shared library for pdflib
BuildRequires:  python-devel
Requires:       %{name} = %{version}-%{release}
Provides:       python-pdflib = %{version}-%{release}

%description python
PDFlib is a development tool for PDF-enabling your software, 
or generating PDF on your server. PDFlib offers a simple-to-use API
for programmatically creating PDF files from within your own server- 
or client-side software. PDFlib doesn't make use of third-party software
for generating PDF, nor does it require any other tools.

This package contains the library needed for python programs 
that will use the PDFlib library.
%endif

%if %{with_perl}
%package perl
Summary:        Perl shared library for pdflib
Requires:       %{name} = %{version}-%{release}
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Provides:       perl-pdflib = %{version}-%{release}
%if 0%{?fedora} >= 7 || 0%{?rhel} >= 6
BuildRequires:  perl-devel
%endif

%description perl
PDFlib is a development tool for PDF-enabling your software, 
or generating PDF on your server. PDFlib offers a simple-to-use API
for programmatically creating PDF files from within your own server- 
or client-side software. PDFlib doesn't make use of third-party software
for generating PDF, nor does it require any other tools.

This package contains the library needed for perl programs 
that will use the PDFlib library.
%endif


%prep
%setup -q -n PDFlib-Lite-%{version}
%patch0 -p0 -b .gcc43
%patch1 -b .format-security

sed -i -e 's,^PYTHONLIBDIR.*,PYTHONLIBDIR = %{python_sitearch},' \
       -e 's,^PERLLIBDIR.*,PERLLIBDIR = %{perl_vendorarch},' \
       config/mkcommon.inc.in

%build
# C, CPP, perl and python bindings enabled
# java, ruby and tcl disabled
# File a bug with RFE and patch if you need it
%configure \
    --with-pyincl=%{python_include} \
    --with-java=no \
    --with-ruby=no \
    --with-tcl=no \
%if ! %{with_python}
    --with-py=no \
%endif
%if ! %{with_perl}
    --with-perl=no \
%endif
    --enable-large_files --enable-tiffwrite

# for x86_64 build
sed -e s@/usr/lib@%{_libdir}@ -i libtool
sed -e /redhat-hardened-ld/s@%{_libdir}@/usr/lib@ -i libtool

%{__make} %{?_smp_mflags}

%if %{with_python}
%{__make} -C bind/pdflib/python
%endif

%if %{with_perl}
%{__make} -C bind/pdflib/python
%endif


%install
rm -rf examples
make install DESTDIR=%{buildroot}

%if %{with_python}
mkdir -p %{buildroot}%{python_sitearch}
make -C bind/pdflib/python install DESTDIR=%{buildroot}
rm %{buildroot}%{python_sitearch}/*.{la,a}
chmod +x %{buildroot}%{python_sitearch}/pdflib_py.so*
%endif

%if %{with_perl}
mkdir -p %{buildroot}%{perl_vendorarch}
make -C bind/pdflib/perl install DESTDIR=%{buildroot}
rm %{buildroot}%{perl_vendorarch}/*.{la,a}
chmod +x %{buildroot}%{perl_vendorarch}/pdflib_pl.so*
%endif

install -p -m 0644 bind/pdflib/cpp/pdflib.hpp %{buildroot}%{_includedir}/pdflib.hpp

rm %{buildroot}%{_libdir}/*.{la,a}

# require to extract debuginfo
chmod +x %{buildroot}%{_libdir}/libpdf*

# Only sources
mkdir -p examples/{c,cpp,php}
cp -r bind/pdflib/data examples/data
cp bind/pdflib/c/*.c \
   bind/pdflib/c/Makefile \
   bind/pdflib/c/readme.txt \
   examples/c
cp bind/pdflib/cpp/*.cpp \
   bind/pdflib/cpp/Makefile \
   bind/pdflib/cpp/readme.txt \
   examples/cpp
%if %{with_perl}
mkdir -p examples/perl
cp bind/pdflib/perl/*.pl \
   bind/pdflib/perl/Makefile \
   bind/pdflib/perl/readme.txt \
   examples/perl
%endif
%if %{with_python}
mkdir -p examples/python
cp bind/pdflib/python/*.py \
   bind/pdflib/python/Makefile \
   bind/pdflib/python/readme.txt \
   examples/python
%endif
cp bind/pdflib/php/*.php \
   bind/pdflib/php/readme.txt \
   examples/php
# overwrite the default php4 one
cp bind/pdflib/php/examples.php5/*.php \
   examples/php


%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif


%files
%doc readme.txt doc/pdflib/PDFlib-Lite-license.pdf
%{_bindir}/pdfimage
%{_bindir}/text2pdf
%{_libdir}/*.so.*


%files devel
%doc doc/pdflib/PDFlib-Lite-license.pdf
%doc doc/pdflib/changes.txt doc/pdflib/compatibility.txt examples
%doc doc/pdflib/PDFlib-API-reference.pdf doc/pdflib/PDFlib-tutorial.pdf doc/pdflib/readme-source-unix.txt
%{_bindir}/pdflib-config
%{_includedir}/*
%{_libdir}/*.so


%if %{with_python}
%files python
%doc doc/pdflib/PDFlib-Lite-license.pdf
%{python_sitearch}/pdflib_py.so*
%endif


%if %{with_perl}
%files perl
%doc doc/pdflib/PDFlib-Lite-license.pdf
%{perl_vendorarch}/pdflib_pl.*
%endif


%changelog
* Wed Aug 12 2020 Remi Collet <remi@remirepo.net> - 7.0.5-10
- F33 build

* Mon Aug 12 2019 Remi Collet <remi@remirepo.net> - 7.0.5-9
- also drop perl and python bindings on Fedora >= 31

* Wed Dec 12 2018 Remi Collet <remi@remirepo.net> - 7.0.5-8
- cleanup for EL-8, drop perl and python subpackage
  which have to be build as part of the modules

* Wed Aug 22 2018 Remi Collet <remi@remirepo.net> - 7.0.5-7
- Add patch to work around false positive in format-security check
  (From rpmfusion, by Paul Howarth )

* Mon Feb 26 2018 Remi Collet <remi@remirepo.net> - 7.0.5-6
- F28 cleanup

* Fri Aug 28 2015 Remi Collet <Fedora@FamilleCollet.com> 7.0.5-5
- rebuild

* Thu Dec 19 2013 Remi Collet <Fedora@FamilleCollet.com> 7.0.5-4
- rebuild

* Sun Oct 21 2012 Remi Collet <Fedora@FamilleCollet.com> 7.0.5-3
- rebuild

* Wed Oct 10 2012 Nicolas Chauvet <kwizart@gmail.com> - 7.0.5-3
- Rebuilt for perl

* Thu Feb 09 2012 Nicolas Chauvet <kwizart@gmail.com> - 7.0.5-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Jul 23 2011 Remi Collet <Fedora@FamilleCollet.com> 7.0.5-1.1
- BR perl-devel on EL-6

* Thu May 06 2010 Remi Collet <Fedora@FamilleCollet.com> 7.0.5-1
- update to 7.0.5

* Sat Jun 13 2009 Remi Collet <Fedora@FamilleCollet.com> 7.0.4p4-1
- update to 7.0.4p4

* Thu Mar 19 2009 Remi Collet <Fedora@FamilleCollet.com> 7.0.4p1-1
- update to 7.0.4p1

* Thu Mar 19 2009 Remi Collet <Fedora@FamilleCollet.com> 7.0.4-1
- update to 7.0.4

* Sat Dec 20 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 7.0.3-3
- rebuild for python 2.6

* Sun Sep 28 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 7.0.3-2
- rebuild

* Fri Mar 28 2008 Remi Collet <Fedora@FamilleCollet.com> 7.0.3-1
- update to 7.0.3
- fix CVE-2007-6561: PDFlib stack-based buffer overflows

* Sat Mar 15 2008 Thorsten Leemhuis <fedora at leemhuis.info> 7.0.2p8-2
- rebuild for new perl

* Fri Feb 29 2008 Remi Collet <Fedora@FamilleCollet.com> 7.0.2p8-1
- update to 7.0.2p8
- del destdir.patch ("make install DESTDIR" is now ok)
- add gcc43.patch for Fedora 9

* Thu Aug 16 2007 Remi Collet <Fedora@FamilleCollet.com> 7.0.2-1
- Add BR perl-devel for fedora >= 7

* Thu Aug 16 2007 Remi Collet <Fedora@FamilleCollet.com> 7.0.2-1
- update to 7.0.2

* Thu Mar 15 2007 Remi Collet <Fedora@FamilleCollet.com> 7.0.1-1
- update to 7.0.1

* Mon Dec 18 2006 Remi Collet <Fedora@FamilleCollet.com> 7.0.0p3-3
- review for Livna
- Requires/BuildRequires cleanup
- Change License = Distributable, include PDFlib-Lite-license.pdf in sub-packages
- add --with-pyinc, python2.5 not defined in configure
- add some comments

* Sun Dec 10 2006 Remi Collet <Fedora@FamilleCollet.com> 7.0.0p3-2
- add python subpackage
- add perl subpackage

* Sat Dec 09 2006 Remi Collet <Fedora@FamilleCollet.com> 7.0.0p3-1
- initial release for Extras