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