summaryrefslogtreecommitdiffstats
path: root/php-tcpdf.spec
blob: a51c1a06ff9b206f02590b2d7514fc7dfef82e7c (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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# spec file for php-tcpdf
#
# Copyright (c) 2013 Remi Collet, Johan Cwiklinski
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Please, preserve the changelog entries
#
%global dl_version %(c=%{version}; echo ${c//./_})
%global real_name  tcpdf

Name:           php-tcpdf
Summary:        PHP class for generating PDF documents
Version:        6.0.049
Release:        1%{?dist}

URL:            http://www.tcpdf.org
License:        LGPLv3+
Group:          Development/Libraries

Source0:        http://downloads.sourceforge.net/%{real_name}/%{real_name}_%{dl_version}.zip

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  php-cli

Requires:       php(language) >= 5.3
Requires:       php-bcmath
Requires:       php-curl
Requires:       php-date
Requires:       php-gd
Requires:       php-hash
Requires:       php-mbstring
Requires:       php-mcrypt
Requires:       php-openssl
Requires:       php-pcre
Requires:       php-spl
Requires:       php-tidy
Requires:       php-xml
Requires:       php-zlib
# imagick is optionnal (and conflicts with gmagick)


%description
PHP class for generating PDF documents.

* no external libraries are required for the basic functions;
* all standard page formats, custom page formats, custom margins and units
  of measure;
* UTF-8 Unicode and Right-To-Left languages;
* TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
* font subsetting;
* methods to publish some XHTML + CSS code, Javascript and Forms;
* images, graphic (geometric figures) and transformation methods;
* supports JPEG, PNG and SVG images natively, all images supported by GD 
  (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported
  via ImagMagick (http: www.imagemagick.org/www/formats.html)
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93,
  USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits
  UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET,
  RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code),
  KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode,
  USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS,
  Datamatrix ECC200, QR-Code, PDF417;
* ICC Color Profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
* automatic page header and footer management;
* document encryption up to 256 bit and digital signature certifications;
* transactions to UNDO commands;
* PDF annotations, including links, text and file attachments;
* text rendering modes (fill, stroke and clipping);
* multiple columns mode;
* no-write page regions;
* bookmarks and table of content;
* text hyphenation;
* text stretching and spacing (tracking/kerning);
* automatic page break, line break and text alignments including justification;
* automatic page numbering and page groups;
* move and delete pages;
* page compression (requires php-zlib extension);
* XOBject templates;
* PDF/A-1b (ISO 19005-1:2005) support.

By default, TCPDF uses the GD library which is know as slower than ImageMagick
solution. You can optionally install php-pecl-imagick; TCPDF will use it.


%package dejavu-lgc-sans-fonts
Summary:        DejaVu LGC sans-serif fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-lgc-sans-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-lgc-sans-fonts

%description dejavu-lgc-sans-fonts
This package allow to use system DejaVu LGC sans-serif variable-width
font faces in TCPDF.

%package dejavu-lgc-sans-mono-fonts
Summary:        DejaVu LGC mono-spaced fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-lgc-sans-mono-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-lgc-sans-mono-fonts

%description dejavu-lgc-sans-mono-fonts
This package allow to use system DejaVu LGC sans-serif mono-spaced
font faces in TCPDF.

%package dejavu-lgc-serif-fonts
Summary:        DejaVu LGC serif fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-lgc-serif-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-lgc-serif-fonts

%description dejavu-lgc-serif-fonts
This package allow to use system DejaVu LGC serif variable-width
font faces in TCPDF.

%package dejavu-sans-fonts
Summary:        DejaVu sans-serif fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-sans-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-sans-fonts

%description dejavu-sans-fonts
This package allow to use system DejaVu sans-serif variable-width
font faces in TCPDF.

%package dejavu-sans-mono-fonts
Summary:        DejaVu mono-spaced fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-sans-mono-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-sans-mono-fonts

%description dejavu-sans-mono-fonts
This package allow to use system DejaVu sans-serif mono-spaced
font faces in TCPDF.

%package dejavu-serif-fonts
Summary:        DejaVu serif fonts for tcpdf
Group:          Development/Libraries
BuildRequires:  dejavu-serif-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       dejavu-serif-fonts

%description dejavu-serif-fonts
This package allow to use system DejaVu serif variable-width
font faces in TCPDF.

%package gnu-free-mono-fonts
Summary:        GNU FreeFonts mono-spaced for tcpdf
Group:          Development/Libraries
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
BuildRequires:  gnu-free-mono-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       gnu-free-mono-fonts
%else
BuildRequires:  freefont
Requires:       freefont
%endif

%description gnu-free-mono-fonts
This package allow to use system GNU FreeFonts mono-spaced font faces in TCPDF.

%package gnu-free-sans-fonts
Summary:        GNU FreeFonts sans-serif for tcpdf
Group:          Development/Libraries
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
BuildRequires:  gnu-free-sans-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       gnu-free-sans-fonts
%else
BuildRequires:  freefont
Requires:       freefont
%endif

%description gnu-free-sans-fonts
This package allow to use system GNU FreeFont sans-serif font faces in TCPDF.

%package gnu-free-serif-fonts
Summary:        GNU FreeFonts serif for tcpdf
Group:          Development/Libraries
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
BuildRequires:  gnu-free-serif-fonts
Requires:       %{name} = %{version}-%{release}
Requires:       gnu-free-serif-fonts
%else
BuildRequires:  freefont
Requires:       freefont
%endif

%description gnu-free-serif-fonts
This package allow to use system GNU FreeFont serif font faces in TCPDF.


# Meta packages to allow upgrade from version before fonts split
%package dejavu-fonts
Summary:        DejaVu fonts for tcpdf
Group:          Development/Libraries
Requires:       %{name}-dejavu-lgc-sans-fonts
Requires:       %{name}-dejavu-lgc-sans-mono-fonts
Requires:       %{name}-dejavu-lgc-serif-fonts
Requires:       %{name}-dejavu-sans-fonts
Requires:       %{name}-dejavu-sans-mono-fonts
Requires:       %{name}-dejavu-serif-fonts

%description dejavu-fonts
This package allow to use system DejaVu fonts in TCPDF.

%package gnu-free-fonts
Summary:        GNU FreeFonts for tcpdf
Group:          Development/Libraries
Requires:       %{name}-gnu-free-mono-fonts
Requires:       %{name}-gnu-free-sans-fonts
Requires:       %{name}-gnu-free-serif-fonts

%description gnu-free-fonts
This package allow to use system GNU FreeFonts in TCPDF.


%prep
%setup -qn %{real_name}

: remove bundled fonts
rm -rf fonts/dejavu-fonts-ttf* fonts/freefont-*
for fic in fonts/*.z
do
  rm -f $fic ${fic/.z/.php}
done
ls fonts | sed -e 's|^|%{_datadir}/php/%{real_name}/fonts/|' >corefonts.lst


%build
: empty build section, nothing required


%install
rm -rf %{buildroot}
# Library
install -d     %{buildroot}%{_datadir}/php/%{real_name}
cp -a *.php    %{buildroot}%{_datadir}/php/%{real_name}/
cp -a include  %{buildroot}%{_datadir}/php/%{real_name}/
cp -a fonts    %{buildroot}%{_datadir}/php/%{real_name}/
install -d     %{buildroot}%{_datadir}/php/%{real_name}/images
install -m 0644 examples/images/_blank.png \
               %{buildroot}%{_datadir}/php/%{real_name}/images/

# Config
install -d     %{buildroot}%{_sysconfdir}/%{name}
install -m 0644 config/*.php \
               %{buildroot}%{_sysconfdir}/%{name}

# Tools
install -d %{buildroot}%{_bindir}
install -m 0755 tools/%{real_name}_addfont.php \
           %{buildroot}%{_bindir}/%{real_name}_addfont

# Fonts
list=""
for ttf in \
    /usr/share/fonts/dejavu/*ttf \
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
    /usr/share/fonts/gnu-free/*ttf \
%else
    /usr/share/fonts/freefont/*ttf \
%endif
; do
   list=$ttf${list:+,${list}}
done
php tools/tcpdf_addfont.php \
    --fonts $list \
    --link \
    --outpath %{buildroot}%{_datadir}/php/%{real_name}/fonts/


%clean
rm -rf %{buildroot}


%files -f corefonts.lst
%defattr(-,root,root,-)
%doc LICENSE.TXT README.TXT CHANGELOG.TXT examples
%{_bindir}/%{real_name}_addfont
%dir %{_datadir}/php/%{real_name}
%dir %{_datadir}/php/%{real_name}/fonts
%{_datadir}/php/%{real_name}/include
%{_datadir}/php/%{real_name}/images
%{_datadir}/php/%{real_name}/*php
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*

%files dejavu-lgc-sans-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavulgcsans*
%exclude %{_datadir}/php/%{real_name}/fonts/dejavulgcsansmono*

%files dejavu-lgc-sans-mono-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavulgcsansmono*

%files dejavu-lgc-serif-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavulgcserif*

%files dejavu-sans-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavusans*
%exclude %{_datadir}/php/%{real_name}/fonts/dejavusansmono*

%files dejavu-sans-mono-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavusansmono*

%files dejavu-serif-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/dejavuserif*

%files gnu-free-mono-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/freemono*

%files gnu-free-sans-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/freesans*

%files gnu-free-serif-fonts
%defattr(-,root,root,-)
%{_datadir}/php/%{real_name}/fonts/freeserif*

%files gnu-free-fonts
# empty

%files dejavu-fonts
# empty


%changelog
* Thu Nov 28 2013 Remi Collet <remi@fedoraproject.org> - 6.0.049-1
- update to 6.0.049
- fix but with same PNG image included twice, #1035392

* Thu Nov 21 2013 Remi Collet <remi@fedoraproject.org> - 6.0.047-1
- update to 6.0.047

* Mon Nov 11 2013 Remi Collet <remi@fedoraproject.org> - 6.0.044-1
- update to 6.0.044

* Sun Oct 27 2013 Remi Collet <remi@fedoraproject.org> - 6.0.042-1
- update to 6.0.042

* Wed Oct 16 2013 Remi Collet <remi@fedoraproject.org> - 6.0.039-1
- update to 6.0.039

* Mon Oct  7 2013 Remi Collet <remi@fedoraproject.org> - 6.0.038-1
- update to 6.0.038

* Tue Oct  1 2013 Remi Collet <remi@fedoraproject.org> - 6.0.037-1
- update to 6.0.037

* Sat Sep 28 2013 Remi Collet <remi@fedoraproject.org> - 6.0.035-1
- update to 6.0.035

* Tue Sep 24 2013 Remi Collet <remi@fedoraproject.org> - 6.0.033-1
- update to 6.0.033

* Thu Sep 19 2013 Remi Collet <remi@fedoraproject.org> - 6.0.031-1
- update to 6.0.031

* Fri Sep 13 2013 Remi Collet <remi@fedoraproject.org> - 6.0.025-1
- update to 6.0.025

* Mon Sep  2 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 6.0.024-1
- update to 6.0.024

* Tue Aug  6 2013 Remi Collet <remi@fedoraproject.org> - 6.0.023-1
- update to 6.0.023

* Wed Jun 19 2013 Remi Collet <remi@fedoraproject.org> - 6.0.020-1
- update to 6.0.020

* Sat Jun  1 2013 Remi Collet <remi@fedoraproject.org> - 6.0.018-1
- update to 6.0.018
- barcode examples now works out of the box

* Sat May 18 2013 Remi Collet <remi@fedoraproject.org> - 6.0.017-2
- split fonts, 1 subpackage per font package

* Sat May 18 2013 Remi Collet <remi@fedoraproject.org> - 6.0.017-1
- update to 6.0.017

* Thu May 16 2013 Remi Collet <remi@fedoraproject.org> - 6.0.016-1
- update to 6.0.016
- add /usr/share/php/tcpdf/images dir

* Wed May 15 2013 Remi Collet <remi@fedoraproject.org> - 6.0.015-1
- update to 6.0.015
- clean spec (upstream changes for packaging)
- drop .php suffix from tools

* Tue May 14 2013 Remi Collet <remi@fedoraproject.org> - 6.0.014-1
- update to 6.0.014
- drop patch merged upstream

* Mon May 13 2013 Remi Collet <remi@fedoraproject.org> - 6.0.013-2
- split fonts in sub-packages

* Mon May 13 2013 Remi Collet <remi@fedoraproject.org> - 6.0.013-1
- update to 6.0.013
- use available system TTF fonts

* Sun May 12 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 6.0.012-3
- Fix README.cache file permissions

* Fri May 10 2013 Remi Collet <remi@fedoraproject.org> - 6.0.012-2
- improve cache ownership, on folder per web server
- drop bundled fonts

* Thu May 09 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 6.0.012-1
- Initial packaging