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