]>
Commit | Line | Data |
---|---|---|
65ec0b27 ER |
1 | # TODO |
2 | # - external php-font-lib | |
3 | # - external php-tcpdf | |
ce569a25 | 4 | %define pkgname dompdf |
65ec0b27 | 5 | %define php_min_version 5.2.7 |
ce569a25 ER |
6 | %include /usr/lib/rpm/macros.php |
7 | Summary: HTML to PDF converter | |
8 | Name: php-%{pkgname} | |
7afd5f72 | 9 | Version: 0.6.2 |
ce569a25 ER |
10 | Release: 1 |
11 | License: LGPL v2.1 | |
12 | Group: Development/Languages/PHP | |
13 | Source0: https://github.com/dompdf/dompdf/releases/download/v%{version}/dompdf-%{version}.zip | |
7afd5f72 | 14 | # Source0-md5: 06c265913be9c0935c4f607617a7af0f |
5372d32a | 15 | Patch0: config.patch |
ce569a25 ER |
16 | URL: http://dompdf.github.io/ |
17 | BuildRequires: /usr/bin/php | |
18 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
19 | BuildRequires: rpmbuild(macros) >= 1.461 | |
20 | BuildRequires: unzip | |
21 | Requires: php(core) >= %{php_min_version} | |
65ec0b27 ER |
22 | Requires: php(date) |
23 | Requires: php(dom) | |
24 | Requires: php(gd) | |
25 | Requires: php(iconv) | |
26 | Requires: php(json) | |
ce569a25 | 27 | Requires: php(mbstring) |
65ec0b27 ER |
28 | Requires: php(pcre) |
29 | Requires: php(spl) | |
30 | Requires: php(xml) | |
ce569a25 ER |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
65ec0b27 ER |
34 | %define _noautoreq_pear dompdf_config.inc.php .*Font_Binary_Stream.php |
35 | ||
36 | # exclude optional php dependencies | |
37 | %define _noautophp php-curl php-pgsql php.*pgsql | |
38 | ||
39 | # put it together for rpmbuild | |
40 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
41 | ||
ce569a25 | 42 | %define _appdir %{php_data_dir}/%{pkgname} |
5372d32a | 43 | %define _sysconfdir /etc/%{pkgname} |
ce569a25 ER |
44 | |
45 | %description | |
46 | dompdf is an HTML to PDF converter. At its heart, dompdf is (mostly) | |
47 | CSS 2.1 compliant HTML layout and rendering engine written in PHP. It | |
48 | is a style-driven renderer: it will download and read external | |
49 | stylesheets, inline style tags, and the style attributes of individual | |
50 | HTML elements. It also supports most presentational HTML attributes. | |
51 | ||
52 | %prep | |
53 | %setup -qc | |
54 | mv %{pkgname}/* . | |
5372d32a | 55 | %patch0 -p1 |
ce569a25 ER |
56 | |
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
5372d32a | 59 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}} |
65ec0b27 | 60 | cp -a dompdf.php load_font.php include lib $RPM_BUILD_ROOT%{_appdir} |
5372d32a ER |
61 | cp -p dompdf_config.inc.php $RPM_BUILD_ROOT%{_sysconfdir} |
62 | ln -s %{_sysconfdir}/dompdf_config.inc.php $RPM_BUILD_ROOT%{_appdir} | |
ce569a25 | 63 | |
b7e87db1 ER |
64 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
65 | cp -a www/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
66 | ||
ce569a25 ER |
67 | %clean |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
72 | %doc README.md CONTRIBUTING.md | |
5372d32a ER |
73 | %dir %attr(750,root,http) %{_sysconfdir} |
74 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dompdf_config.inc.php | |
ce569a25 | 75 | %{_appdir} |
b7e87db1 | 76 | %{_examplesdir}/%{name}-%{version} |