]>
Commit | Line | Data |
---|---|---|
eef52307 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2 package | |
4 | %bcond_without python3 # Python 3 package | |
5 | ||
6 | %define module html2text | |
7 | Summary: A HTML to markdown-structured text converter | |
8 | Name: python-%{module} | |
fbc335a8 JP |
9 | Version: 2016.1.8 |
10 | Release: 1 | |
eef52307 JP |
11 | License: GPL v3 |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/h/html2text/%{module}-%{version}.tar.gz | |
fbc335a8 | 14 | # Source0-md5: a1e9b15c2ad5643c95fe790fd4a5df61 |
eef52307 JP |
15 | URL: https://github.com/Alir3z4/html2text/ |
16 | %if %{with python2} | |
17 | BuildRequires: python-modules | |
18 | %endif | |
19 | %if %{with python3} | |
20 | BuildRequires: python3-Cython | |
21 | BuildRequires: python3-modules | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | BuildRequires: rpm-pythonprov | |
ab29caca | 25 | BuildRequires: rpmbuild(macros) >= 1.710 |
a5a75d23 | 26 | BuildArch: noarch |
eef52307 JP |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | A HTML to markdown-structured text converter. | |
31 | ||
32 | %package -n python3-%{module} | |
33 | Summary: A HTML to markdown-structured text converter | |
34 | Group: Libraries/Python | |
35 | ||
36 | %description -n python3-%{module} | |
37 | A HTML to markdown-structured text converter. | |
38 | ||
39 | %prep | |
40 | %setup -q -n %{module}-%{version} | |
41 | ||
42 | %build | |
43 | %if %{with python2} | |
19e0b478 | 44 | %py_build |
eef52307 JP |
45 | %endif |
46 | %if %{with python3} | |
19e0b478 | 47 | %py3_build |
eef52307 JP |
48 | %endif |
49 | ||
50 | %install | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %if %{with python2} | |
19e0b478 | 54 | %py_install |
eef52307 JP |
55 | |
56 | %py_postclean | |
57 | %endif | |
58 | ||
59 | %if %{with python3} | |
19e0b478 | 60 | %py3_install |
eef52307 JP |
61 | %endif |
62 | ||
63 | %clean | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
66 | %if %{with python2} | |
67 | %files | |
68 | %defattr(644,root,root,755) | |
69 | %dir %{py_sitescriptdir}/html2text | |
70 | %{py_sitescriptdir}/html2text/*.py[co] | |
71 | %{py_sitescriptdir}/html2text-*.egg-info | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %files -n python3-%{module} | |
76 | %defattr(644,root,root,755) | |
77 | %dir %{py3_sitescriptdir}/html2text | |
78 | %{py3_sitescriptdir}/html2text/*.py | |
79 | %{py3_sitescriptdir}/html2text/__pycache__ | |
80 | %{py3_sitescriptdir}/html2text-*.egg-info | |
81 | %endif |