]> git.pld-linux.org Git - packages/python-xhtml2pdf.git/blob - python-xhtml2pdf.spec
bf2b91f95233933be438ee1a9b9c568e528f679e
[packages/python-xhtml2pdf.git] / python-xhtml2pdf.spec
1 # TODO: Fix tests
2 # TODO: Fix dependencies for Python 3.x version
3 %bcond_with     doc     # don't build doc
4 %bcond_with     tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_with     python3 # CPython 3.x module
7
8 %define         module  xhtml2pdf
9 Summary:        PDF generator using HTML and CSS
10 Summary(pl.UTF-8):      Generator PDF używający HTML i CSS
11 Name:           python-%{module}
12 Version:        0.1a4
13 Release:        3
14 License:        Apache v2.0
15 Group:          Libraries/Python
16 Source0:        https://pypi.python.org/packages/1c/04/a52a262a9ae6cd07b86baf2d9486d00da1dec5edf638cbe19c5983ebd266/xhtml2pdf-%{version}.tar.gz
17 # Source0-md5:  beb2d99bb99376a3a4f584599eacec23
18 URL:            https://pypi.python.org/pypi/xhtml2pdf/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-PyPDF2
23 BuildRequires:  python-ReportLab >= 2.2
24 BuildRequires:  python-distribute
25 BuildRequires:  python-html5lib >= 0.11.1
26 BuildRequires:  python-modules
27 BuildRequires:  python-pillow
28 %endif
29 BuildRequires:  rpm-pythonprov
30 %if %{with python3}
31 BuildRequires:  python3-PyPDF2
32 BuildRequires:  python3-ReportLab >= 2.2
33 BuildRequires:  python3-distribute
34 BuildRequires:  python3-html5lib >= 0.11.1
35 BuildRequires:  python3-modules
36 BuildRequires:  python3-pillow
37 %endif
38 Requires:       python-modules
39 # /usr/bin/xhtml2pdf needs python-setuptools
40 Requires:       python-setuptools
41 Obsoletes:      python-pisa
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 html2pdf converter using the ReportLab Toolkit, the HTML5lib and
47 pyPdf.
48
49 %description -l pl.UTF-8
50 Konwertor html2pdf używający narzędzi ReportLab, HTML5lib i pyPdf.
51
52 %package -n python3-%{module}
53 Summary:        PDF generator using HTML and CSS
54 Summary(pl.UTF-8):      Generator PDF używający HTML i CSS
55 Group:          Libraries/Python
56 Requires:       python3-modules
57 Requires:       python3-pillow
58 Requires:       python3-setuptools
59
60 %description -n python3-%{module}
61 html2pdf converter using the ReportLab Toolkit, the HTML5lib and
62 pyPdf.
63
64 %description -n python3-%{module} -l pl.UTF-8
65 Konwertor html2pdf używający narzędzi ReportLab, HTML5lib i pyPdf.
66
67 %package apidocs
68 Summary:        %{module} API documentation
69 Summary(pl.UTF-8):      Dokumentacja API %{module}
70 Group:          Documentation
71
72 %description apidocs
73 API documentation for %{module}.
74
75 %description apidocs -l pl.UTF-8
76 Dokumentacja API %{module}.
77
78 %prep
79 %setup -q -n %{module}-%{version}
80
81 %build
82 %if %{with python2}
83 %py_build %{?with_tests:test}
84 %endif
85
86 %if %{with python3}
87 %py3_build %{?with_tests:test}
88 %endif
89
90 %if %{with doc}
91 cd docs
92 %{__make} -j1 html
93 rm -rf _build/html/_sources
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python2}
100 %py_install
101 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
102 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
103 %py_postclean
104 %endif
105
106 %if %{with python3}
107 %py3_install
108 %endif
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %files
115 %defattr(644,root,root,755)
116 %doc README.rst
117 %attr(755,root,root) %{_bindir}/*
118 %dir %{py_sitescriptdir}/%{module}
119 %{py_sitescriptdir}/%{module}/*.py[co]
120 %dir %{py_sitescriptdir}/%{module}/w3c
121 %{py_sitescriptdir}/%{module}/w3c/*.py[co]
122
123 %if "%{py_ver}" > "2.4"
124 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
125 %endif
126 %endif
127
128 %if %{with python3}
129 %files -n python3-%{module}
130 %defattr(644,root,root,755)
131 %doc README.rst
132 # TODO: files
133 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
134 %endif
135
136 %if %{with doc}
137 %files apidocs
138 %defattr(644,root,root,755)
139 %doc docs/_build/html/*
140 %endif
This page took 0.068233 seconds and 2 git commands to generate.