]>
Commit | Line | Data |
---|---|---|
1db2f73f 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 pyRFC3339 | |
9 | Summary: Generate and parse RFC 3339 timestamps | |
10 | Name: python-pyrfc3339 | |
ac3a6957 AM |
11 | Version: 1.1 |
12 | Release: 1 | |
1db2f73f ER |
13 | License: MIT |
14 | Source0: https://pypi.python.org/packages/source/p/pyRFC3339/pyRFC3339-%{version}.tar.gz | |
ac3a6957 | 15 | # Source0-md5: c829980738b8271b0179ffd0c41187b0 |
1db2f73f ER |
16 | Group: Libraries/Python |
17 | URL: https://pypi.python.org/pypi/pyRFC3339 | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.713 | |
20 | %if %{with python2} | |
77084ecb | 21 | BuildRequires: python-setuptools |
1db2f73f ER |
22 | %if %{with tests} |
23 | BuildRequires: python-nose | |
24 | BuildRequires: python-pytz | |
25 | %endif | |
26 | %endif | |
27 | %if %{with python3} | |
77084ecb | 28 | BuildRequires: python3-setuptools |
1db2f73f ER |
29 | %if %{with tests} |
30 | BuildRequires: python3-nose | |
31 | BuildRequires: python3-pytz | |
32 | %endif | |
33 | %endif | |
34 | BuildArch: noarch | |
35 | ||
36 | %description | |
bcf8b5f5 | 37 | This package contains a Python 2 library to parse and generate RFC |
1db2f73f ER |
38 | 3339-compliant timestamps using Python datetime.datetime objects. |
39 | ||
40 | %package -n python3-pyrfc3339 | |
41 | Summary: Generate and parse RFC 3339 timestamps | |
42 | Group: Libraries/Python | |
43 | ||
44 | %description -n python3-pyrfc3339 | |
45 | This package contains a Python 3 library to parse and generate RFC | |
46 | 3339-compliant timestamps using Python datetime.datetime objects. | |
47 | ||
48 | %prep | |
49 | %setup -q -n %{module}-%{version} | |
50 | ||
51 | %build | |
52 | %if %{with python2} | |
53 | %py_build %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %if %{with python3} | |
57 | %py3_build %{?with_tests:test} | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %if %{with python2} | |
63 | %py_install | |
64 | %py_postclean | |
65 | %endif | |
66 | ||
67 | %if %{with python3} | |
68 | %py3_install | |
69 | %endif | |
70 | ||
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %if %{with python2} | |
75 | %files | |
76 | %defattr(644,root,root,755) | |
77 | %doc README.rst LICENSE.txt | |
78 | %{py_sitescriptdir}/pyrfc3339 | |
79 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
83 | %files -n python3-pyrfc3339 | |
84 | %defattr(644,root,root,755) | |
85 | %doc README.rst LICENSE.txt | |
86 | %{py3_sitescriptdir}/pyrfc3339 | |
87 | %{py3_sitescriptdir}/%{module}-%{version}-*.egg-info | |
88 | %endif |