]>
Commit | Line | Data |
---|---|---|
aea9e640 ER |
1 | # NOTE: |
2 | # - *.z are just gzcompress-ed .ttf files | |
ba84953d | 3 | %define ver %(echo %{version} | tr . _) |
87c494a8 ER |
4 | %define pkgname tcpdf |
5 | %define php_min_version 5.2.7 | |
6 | %include /usr/lib/rpm/macros.php | |
ba84953d | 7 | Summary: TCPDF - PHP class for PDF |
00bed017 | 8 | Name: php-%{pkgname} |
20434d1f | 9 | Version: 6.2.12 |
11626367 | 10 | Release: 1 |
ba84953d ER |
11 | License: LGPL v2.1 |
12 | Group: Development/Languages/PHP | |
c0a0b18e | 13 | Source0: http://downloads.sourceforge.net/tcpdf/tcpdf_%{ver}.zip |
20434d1f | 14 | # Source0-md5: 904160b3eb1ba1ed2881d2d64b782486 |
a13238bd | 15 | URL: http://www.tcpdf.org/ |
c6973e2d ER |
16 | BuildRequires: %{php_name}-cli |
17 | BuildRequires: %{php_name}-pcre | |
00bed017 | 18 | BuildRequires: %{php_name}-zlib |
853004dc | 19 | BuildRequires: fonts-TTF-DejaVu |
609c9c2e | 20 | BuildRequires: fonts-TTF-freefont |
87c494a8 | 21 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
ba84953d | 22 | BuildRequires: rpmbuild(macros) >= 1.268 |
ec0c9764 | 23 | BuildRequires: unzip |
87c494a8 ER |
24 | Requires: php(bcmath) |
25 | Requires: php(core) >= %{php_min_version} | |
26 | Requires: php(date) | |
27 | Requires: php(gd) | |
28 | Requires: php(hash) | |
29 | Requires: php(json) | |
30 | Requires: php(mbstring) | |
31 | Requires: php(openssl) | |
32 | Requires: php(pcre) | |
33 | Requires: php(xml) | |
ba84953d ER |
34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
00bed017 | 37 | %define _appdir %{php_data_dir}/%{pkgname} |
aea9e640 | 38 | %define _sysconfdir /etc/%{pkgname} |
ba84953d ER |
39 | |
40 | %description | |
41 | Generic TCPDF screenshot TCPDF is a PHP class for generating PDF | |
42 | documents without requiring external extensions. TCPDF Supports UTF-8, | |
43 | Unicode, RTL languages and HTML. | |
44 | ||
02a10897 ER |
45 | %package fonts-dejavu |
46 | Summary: DejaVu fonts for TCPDF | |
39d2e589 | 47 | Group: Development/Languages/PHP |
02a10897 ER |
48 | Requires: %{name} = %{version}-%{release} |
49 | ||
50 | %description fonts-dejavu | |
51 | This package allow to use system DejaVu font faces in TCPDF. | |
52 | ||
609c9c2e ER |
53 | %package fonts-freefont |
54 | Summary: GNU FreeFonts for TCPDF | |
39d2e589 | 55 | Group: Development/Languages/PHP |
609c9c2e ER |
56 | Requires: %{name} = %{version}-%{release} |
57 | ||
58 | %description fonts-freefont | |
59 | This package allow to use system GNU FreeFont font faces in TCPDF. | |
60 | ||
6c2cbd52 ER |
61 | %package examples |
62 | Summary: TCPDF example programs | |
63 | Summary(pl.UTF-8): TCPDF programy przykładowe | |
39d2e589 | 64 | Group: Development/Languages/PHP |
6c2cbd52 ER |
65 | Requires: %{name} = %{version}-%{release} |
66 | ||
67 | %description examples | |
68 | TCPDF example programs. | |
69 | ||
70 | %description examples -l pl.UTF-8 | |
71 | TCPDF - przykładowe programy. | |
72 | ||
ba84953d | 73 | %prep |
02a10897 ER |
74 | %setup -qc |
75 | mv tcpdf/* . | |
3995e872 | 76 | %undos *.TXT |
ba84953d | 77 | |
00bed017 | 78 | # remove bundled fonts |
02a10897 | 79 | rm -r fonts/dejavu-fonts-ttf-* fonts/freefont-* fonts/ae_fonts_* |
00bed017 | 80 | |
68532b3a | 81 | %build |
609c9c2e ER |
82 | pkgs="fonts-TTF-DejaVu fonts-TTF-freefont" |
83 | install -d build/fonts | |
84 | for pkg in $pkgs; do | |
85 | fonts=$(rpm -ql $pkg | grep %{_fontsdir}/TTF | xargs | tr ' ' ',') | |
86 | %{__php} tools/tcpdf_addfont.php -t TrueTypeUnicode -i $fonts -o build/fonts | |
68532b3a AM |
87 | done |
88 | ||
ba84953d ER |
89 | %install |
90 | rm -rf $RPM_BUILD_ROOT | |
aea9e640 ER |
91 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},%{_bindir},%{_examplesdir}/%{name}-%{version}} |
92 | cp -a *.php fonts include $RPM_BUILD_ROOT%{_appdir} | |
93 | cp -p config/*.php $RPM_BUILD_ROOT%{_sysconfdir} | |
609c9c2e | 94 | cp -a build/fonts/* $RPM_BUILD_ROOT%{_appdir}/fonts |
00bed017 | 95 | install -p tools/tcpdf_addfont.php $RPM_BUILD_ROOT%{_bindir}/tcpdf_addfont |
ba84953d ER |
96 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
97 | ||
ba84953d ER |
98 | %clean |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc CHANGELOG.TXT README.TXT | |
aea9e640 ER |
104 | %dir %attr(750,root,http) %{_sysconfdir} |
105 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tcpdf_config.php | |
00bed017 | 106 | %attr(755,root,root) %{_bindir}/tcpdf_addfont |
02a10897 | 107 | %dir %{_appdir} |
02a10897 ER |
108 | %{_appdir}/include |
109 | %{_appdir}/tcpdf*.php | |
110 | ||
111 | %dir %{_appdir}/fonts | |
112 | %{_appdir}/fonts/aealarabiya* | |
113 | %{_appdir}/fonts/aefurat* | |
114 | %{_appdir}/fonts/cid0* | |
115 | %{_appdir}/fonts/courier* | |
02a10897 ER |
116 | %{_appdir}/fonts/helvetica* |
117 | %{_appdir}/fonts/hysmyeongjostdmedium* | |
118 | %{_appdir}/fonts/kozgopromedium* | |
119 | %{_appdir}/fonts/kozminproregular* | |
120 | %{_appdir}/fonts/msungstdlight* | |
121 | %{_appdir}/fonts/pdfacourier* | |
122 | %{_appdir}/fonts/pdfahelvetica* | |
123 | %{_appdir}/fonts/pdfasymbol* | |
124 | %{_appdir}/fonts/pdfatimes* | |
125 | %{_appdir}/fonts/pdfazapfdingbats* | |
126 | %{_appdir}/fonts/stsongstdlight* | |
127 | %{_appdir}/fonts/symbol* | |
128 | %{_appdir}/fonts/times* | |
129 | %{_appdir}/fonts/uni2cid_* | |
130 | %{_appdir}/fonts/zapfdingbats* | |
131 | ||
132 | %files fonts-dejavu | |
133 | %defattr(644,root,root,755) | |
134 | %{_appdir}/fonts/dejavusans* | |
135 | %{_appdir}/fonts/dejavuserif* | |
6c2cbd52 | 136 | |
609c9c2e ER |
137 | %files fonts-freefont |
138 | %defattr(644,root,root,755) | |
139 | %{_appdir}/fonts/freemono* | |
140 | %{_appdir}/fonts/freesans* | |
141 | %{_appdir}/fonts/freeserif* | |
142 | ||
6c2cbd52 ER |
143 | %files examples |
144 | %defattr(644,root,root,755) | |
ba84953d | 145 | %{_examplesdir}/%{name}-%{version} |