Up to 6.4.2
[packages/php-tcpdf.git] / php-tcpdf.spec
1 # NOTE:
2 # - *.z are just gzcompress-ed .ttf files
3 %define         pkgname tcpdf
4 %define         php_min_version 5.2.7
5 Summary:        TCPDF - PHP class for PDF
6 Name:           php-%{pkgname}
7 Version:        6.4.2
8 Release:        1
9 License:        LGPL v2.1
10 Group:          Development/Languages/PHP
11 Source0:        https://github.com/tecnickcom/TCPDF/archive/refs/tags/%{version}.tar.gz
12 # Source0-md5:  9f595ca6649db615695baec65c6bc019
13 Patch0:         shebang.patch
14 URL:            http://www.tcpdf.org/
15 BuildRequires:  %{php_name}-cli
16 BuildRequires:  %{php_name}-devel
17 BuildRequires:  %{php_name}-pcre
18 BuildRequires:  %{php_name}-zlib
19 BuildRequires:  fonts-TTF-DejaVu
20 BuildRequires:  fonts-TTF-freefont
21 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
22 BuildRequires:  rpmbuild(macros) >= 1.268
23 BuildRequires:  unzip
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)
34 Suggests:       php-tcpdf-fonts-dejavu
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %define         _appdir         %{php_data_dir}/%{pkgname}
39 %define         _sysconfdir     /etc/%{pkgname}
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
46 %package fonts-dejavu
47 Summary:        DejaVu fonts for TCPDF
48 Group:          Development/Languages/PHP
49 Requires:       %{name} = %{version}-%{release}
50
51 %description fonts-dejavu
52 This package allow to use system DejaVu font faces in TCPDF.
53
54 %package fonts-freefont
55 Summary:        GNU FreeFonts for TCPDF
56 Group:          Development/Languages/PHP
57 Requires:       %{name} = %{version}-%{release}
58
59 %description fonts-freefont
60 This package allow to use system GNU FreeFont font faces in TCPDF.
61
62 %package examples
63 Summary:        TCPDF example programs
64 Summary(pl.UTF-8):      TCPDF programy przykładowe
65 Group:          Development/Languages/PHP
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
74 %prep
75 %setup -q -n TCPDF-%{version}
76 %undos *.TXT
77 %patch0 -p1
78
79 # remove bundled fonts
80 rm -r fonts/dejavu-fonts-ttf-* fonts/freefont-* fonts/ae_fonts_*
81
82 %build
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
88 done
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
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}
95 cp -a build/fonts/* $RPM_BUILD_ROOT%{_appdir}/fonts
96 install -p tools/tcpdf_addfont.php $RPM_BUILD_ROOT%{_bindir}/tcpdf_addfont
97 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %files
103 %defattr(644,root,root,755)
104 %doc CHANGELOG.TXT README.md
105 %dir %attr(750,root,http) %{_sysconfdir}
106 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tcpdf_config.php
107 %attr(755,root,root) %{_bindir}/tcpdf_addfont
108 %dir %{_appdir}
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*
117 %{_appdir}/fonts/dejavumathtexgyre*
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*
138
139 %files fonts-freefont
140 %defattr(644,root,root,755)
141 %{_appdir}/fonts/freemono*
142 %{_appdir}/fonts/freesans*
143 %{_appdir}/fonts/freeserif*
144
145 %files examples
146 %defattr(644,root,root,755)
147 %{_examplesdir}/%{name}-%{version}
This page took 0.271008 seconds and 3 git commands to generate.