]> git.pld-linux.org Git - packages/python-parsedatetime.git/blob - python-parsedatetime.spec
e9a85e9a97dcd1e8fa33b671c0397407a9481c1c
[packages/python-parsedatetime.git] / python-parsedatetime.spec
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}
11 Version:        1.5
12 Release:        2
13 License:        Apache v2.0
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
21 %if %{with python2}
22 BuildRequires:  python-modules
23 BuildRequires:  python-setuptools
24 BuildRequires:  python-test
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-modules
28 BuildRequires:  python3-setuptools
29 BuildRequires:  python3-test
30 %endif
31 %if %{with doc}
32 BuildRequires:  epydoc
33 %endif
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 parsedatetime is a Python module that can parse human-readable
39 date/time strings.
40
41 %package doc
42 Summary:        Documentation for the parsedatetime Python module
43 Group:          Documentation
44
45 %description doc
46 This package contains the generated HTML documentation for the
47 parsedatetime python module
48
49 %package -n python3-%{module}
50 Summary:        Parse human-readable date/time strings in Python
51 Group:          Libraries/Python
52
53 %description -n python3-%{module}
54 parsedatetime is a Python module that can parse human-readable
55 date/time strings.
56
57 %prep
58 %setup -q -n %{module}-%{version}
59 %patch0 -p1
60
61 # Fixes spurious-executable-perm warning
62 chmod 644 implementation_notes.txt
63
64 %build
65 %if %{with python2}
66 %py_build
67 %{?with_tests:%{__python} run_tests.py}
68 %endif
69
70 %if %{with python3}
71 %py3_build
72 %{?with_tests:%{__python3} run_tests.py test}
73 %endif
74
75 %if %{with doc}
76 epydoc --html --config epydoc.conf
77 %endif
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81
82 %if %{with python2}
83 %py_install
84 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
85
86 %py_postclean
87 %endif
88
89 %if %{with python3}
90 %py3_install
91 rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
92 %endif
93
94 %clean
95 rm -rf $RPM_BUILD_ROOT
96
97 %files
98 %defattr(644,root,root,755)
99 %doc LICENSE.txt
100 %doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
101 %{py_sitescriptdir}/%{module}
102 %{py_sitescriptdir}/%{module}-%{version}-*.egg-info
103
104 %if %{with python3}
105 %files -n python3-%{module}
106 %defattr(644,root,root,755)
107 %doc LICENSE.txt
108 %doc AUTHORS.txt CHANGES.txt INSTALL.txt README.rst THANKS.txt
109 %{py3_sitescriptdir}/%{module}
110 %{py3_sitescriptdir}/%{module}*.egg-info
111 %endif
112
113 %if %{with doc}
114 %files doc
115 %defattr(644,root,root,755)
116 %doc docs/ examples/ implementation_notes.txt locale_date_grouping_notes.txt
117 %endif
This page took 0.064198 seconds and 2 git commands to generate.