]>
Commit | Line | Data |
---|---|---|
1 | # NOTE: | |
2 | # - *.z are just gzcompress-ed .ttf files | |
3 | %define pkgname tcpdf | |
4 | %define ver %(echo %{version} | tr . _) | |
5 | Summary: TCPDF - PHP class for PDF | |
6 | Name: php-%{pkgname} | |
7 | Version: 6.2.6 | |
8 | Release: 1 | |
9 | License: LGPL v2.1 | |
10 | Group: Development/Languages/PHP | |
11 | Source0: http://downloads.sourceforge.net/tcpdf/tcpdf_%{ver}.zip | |
12 | # Source0-md5: 9185f0ca4ecc65fb8a1dc115ab96b52b | |
13 | URL: http://www.tcpdf.org/ | |
14 | BuildRequires: %{php_name}-cli | |
15 | BuildRequires: %{php_name}-pcre | |
16 | BuildRequires: %{php_name}-zlib | |
17 | BuildRequires: fonts-TTF-DejaVu | |
18 | BuildRequires: fonts-TTF-freefont | |
19 | BuildRequires: rpmbuild(macros) >= 1.268 | |
20 | BuildRequires: unzip | |
21 | Requires: php(core) >= 5.0 | |
22 | BuildArch: noarch | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %define _appdir %{php_data_dir}/%{pkgname} | |
26 | %define _sysconfdir /etc/%{pkgname} | |
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 | ||
33 | %package fonts-dejavu | |
34 | Summary: DejaVu fonts for TCPDF | |
35 | Group: Development/Languages/PHP | |
36 | Requires: %{name} = %{version}-%{release} | |
37 | ||
38 | %description fonts-dejavu | |
39 | This package allow to use system DejaVu font faces in TCPDF. | |
40 | ||
41 | %package fonts-freefont | |
42 | Summary: GNU FreeFonts for TCPDF | |
43 | Group: Development/Languages/PHP | |
44 | Requires: %{name} = %{version}-%{release} | |
45 | ||
46 | %description fonts-freefont | |
47 | This package allow to use system GNU FreeFont font faces in TCPDF. | |
48 | ||
49 | %package examples | |
50 | Summary: TCPDF example programs | |
51 | Summary(pl.UTF-8): TCPDF programy przykładowe | |
52 | Group: Development/Languages/PHP | |
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 | ||
61 | %prep | |
62 | %setup -qc | |
63 | mv tcpdf/* . | |
64 | %undos *.TXT | |
65 | ||
66 | # remove bundled fonts | |
67 | rm -r fonts/dejavu-fonts-ttf-* fonts/freefont-* fonts/ae_fonts_* | |
68 | ||
69 | %build | |
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 | |
75 | done | |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
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} | |
82 | cp -a build/fonts/* $RPM_BUILD_ROOT%{_appdir}/fonts | |
83 | install -p tools/tcpdf_addfont.php $RPM_BUILD_ROOT%{_bindir}/tcpdf_addfont | |
84 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc CHANGELOG.TXT README.TXT | |
92 | %dir %attr(750,root,http) %{_sysconfdir} | |
93 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tcpdf_config.php | |
94 | %attr(755,root,root) %{_bindir}/tcpdf_addfont | |
95 | %dir %{_appdir} | |
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* | |
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* | |
124 | ||
125 | %files fonts-freefont | |
126 | %defattr(644,root,root,755) | |
127 | %{_appdir}/fonts/freemono* | |
128 | %{_appdir}/fonts/freesans* | |
129 | %{_appdir}/fonts/freeserif* | |
130 | ||
131 | %files examples | |
132 | %defattr(644,root,root,755) | |
133 | %{_examplesdir}/%{name}-%{version} |