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
8 %define module parsedatetime
9 Summary: Parse human-readable date/time strings in Python
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://github.com/bear/%{module}/archive/v%{version}/%{module}-%{version}.tar.gz
16 # Source0-md5: f7b6b8258728ca9aa2ef536b3f221baf
17 Patch0: fix-non-executable-script-init.patch
18 URL: https://github.com/bear/parsedatetime
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.713
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
24 BuildRequires: python-test
27 BuildRequires: python3-modules
28 BuildRequires: python3-setuptools
29 BuildRequires: python3-test
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 parsedatetime is a Python module that can parse human-readable
42 Summary: Documentation for the parsedatetime Python module
46 This package contains the generated HTML documentation for the
47 parsedatetime python module
49 %package -n python3-%{module}
50 Summary: Parse human-readable date/time strings in Python
51 Group: Libraries/Python
53 %description -n python3-%{module}
54 parsedatetime is a Python module that can parse human-readable
58 %setup -q -n %{module}-%{version}
61 # Fixes spurious-executable-perm warning
62 chmod 644 implementation_notes.txt
67 %{?with_tests:%{__python} run_tests.py}
72 %{?with_tests:%{__python3} run_tests.py test}
76 epydoc --html --config epydoc.conf
80 rm -rf $RPM_BUILD_ROOT
84 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
91 rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
95 rm -rf $RPM_BUILD_ROOT
98 %defattr(644,root,root,755)
100 %doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
101 %{py_sitescriptdir}/%{module}
102 %{py_sitescriptdir}/%{module}-%{version}-*.egg-info
105 %files -n python3-%{module}
106 %defattr(644,root,root,755)
108 %doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
109 %{py3_sitescriptdir}/%{module}
110 %{py3_sitescriptdir}/%{module}*.egg-info
115 %defattr(644,root,root,755)
116 %doc docs/ examples/ implementation_notes.txt locale_date_grouping_notes.txt