]>
Commit | Line | Data |
---|---|---|
d4dec6ed ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
4 | %bcond_without tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module parsedatetime | |
9 | Summary: Parse human-readable date/time strings in Python | |
10 | Name: python-%{module} | |
cd1df77b | 11 | Version: 2.1 |
777af4f8 | 12 | Release: 6 |
d4dec6ed ER |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
15 | Source0: https://github.com/bear/%{module}/archive/v%{version}/%{module}-%{version}.tar.gz | |
cd1df77b | 16 | # Source0-md5: 9054ba8585a94fb68f29d47c14536cc5 |
d4dec6ed ER |
17 | URL: https://github.com/bear/parsedatetime |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.713 | |
20 | %if %{with python2} | |
48832474 | 21 | BuildRequires: python-modules |
d4dec6ed | 22 | BuildRequires: python-setuptools |
cd1df77b AM |
23 | %if %{with tests} |
24 | BuildRequires: python-pyicu | |
48832474 | 25 | BuildRequires: python-test |
d4dec6ed | 26 | %endif |
cd1df77b | 27 | %endif |
d4dec6ed | 28 | %if %{with python3} |
48832474 | 29 | BuildRequires: python3-modules |
d4dec6ed | 30 | BuildRequires: python3-setuptools |
cd1df77b AM |
31 | %if %{with tests} |
32 | BuildRequires: python3-pyicu | |
48832474 | 33 | BuildRequires: python3-test |
d4dec6ed | 34 | %endif |
cd1df77b | 35 | %endif |
d4dec6ed ER |
36 | %if %{with doc} |
37 | BuildRequires: epydoc | |
38 | %endif | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | parsedatetime is a Python module that can parse human-readable | |
44 | date/time strings. | |
45 | ||
46 | %package doc | |
47 | Summary: Documentation for the parsedatetime Python module | |
48 | Group: Documentation | |
49 | ||
50 | %description doc | |
51 | This package contains the generated HTML documentation for the | |
52 | parsedatetime python module | |
53 | ||
54 | %package -n python3-%{module} | |
55 | Summary: Parse human-readable date/time strings in Python | |
56 | Group: Libraries/Python | |
57 | ||
58 | %description -n python3-%{module} | |
59 | parsedatetime is a Python module that can parse human-readable | |
60 | date/time strings. | |
61 | ||
62 | %prep | |
63 | %setup -q -n %{module}-%{version} | |
d4dec6ed ER |
64 | |
65 | %build | |
66 | %if %{with python2} | |
cd1df77b | 67 | %py_build %{?with_tests:test} |
d4dec6ed ER |
68 | %endif |
69 | ||
70 | %if %{with python3} | |
cd1df77b | 71 | %py3_build %{?with_tests:test} |
d4dec6ed ER |
72 | %endif |
73 | ||
74 | %if %{with doc} | |
75 | epydoc --html --config epydoc.conf | |
76 | %endif | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %py_install | |
d4dec6ed ER |
83 | |
84 | %py_postclean | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_install | |
d4dec6ed ER |
89 | %endif |
90 | ||
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %files | |
95 | %defattr(644,root,root,755) | |
96 | %doc LICENSE.txt | |
cd1df77b | 97 | %doc AUTHORS.txt CHANGES.txt README.rst |
d4dec6ed ER |
98 | %{py_sitescriptdir}/%{module} |
99 | %{py_sitescriptdir}/%{module}-%{version}-*.egg-info | |
100 | ||
101 | %if %{with python3} | |
102 | %files -n python3-%{module} | |
103 | %defattr(644,root,root,755) | |
104 | %doc LICENSE.txt | |
cd1df77b | 105 | %doc AUTHORS.txt CHANGES.txt README.rst |
d4dec6ed ER |
106 | %{py3_sitescriptdir}/%{module} |
107 | %{py3_sitescriptdir}/%{module}*.egg-info | |
108 | %endif | |
109 | ||
110 | %if %{with doc} | |
111 | %files doc | |
112 | %defattr(644,root,root,755) | |
cd1df77b | 113 | %doc docs/ examples/ |
d4dec6ed | 114 | %endif |