]>
Commit | Line | Data |
---|---|---|
0bcba7eb JP |
1 | # Conditional build: |
2 | %bcond_without python2 # CPython 2.x module | |
3 | %bcond_without python3 # CPython 3.x module | |
4 | ||
5 | %define module jdcal | |
6 | Summary: Julian dates from proleptic Gregorian and Julian calendars | |
7 | Name: python-%{module} | |
8 | Version: 1.4.1 | |
1d153fcf | 9 | Release: 5 |
0bcba7eb JP |
10 | License: BSD |
11 | Group: Libraries/Python | |
12 | #Source0Download: https://pypi.org/simple/jdcal/ | |
13 | Source0: https://files.pythonhosted.org/packages/source/j/jdcal/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: e05bdb60fa80f25bc60e73e0c6b7c5dc | |
15 | URL: https://github.com/phn/jdcal | |
16 | %if %{with python2} | |
17 | BuildRequires: python-modules >= 1:2.7 | |
18 | BuildRequires: python-setuptools | |
19 | %endif | |
20 | %if %{with python3} | |
21 | BuildRequires: python3-modules >= 1:3.4 | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | BuildRequires: rpm-pythonprov | |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | Requires: python-modules >= 1:2.7 | |
27 | BuildArch: noarch | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | This module contains functions for converting between Julian dates and | |
32 | calendar dates. | |
33 | ||
34 | %package -n python3-%{module} | |
35 | Summary: Julian dates from proleptic Gregorian and Julian calendars | |
36 | Group: Libraries/Python | |
37 | Requires: python3-modules >= 1:3.4 | |
38 | ||
39 | %description -n python3-%{module} | |
40 | This module contains functions for converting between Julian dates and | |
41 | calendar dates. | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{module}-%{version} | |
45 | ||
46 | %build | |
47 | %if %{with python2} | |
48 | %py_build | |
49 | %endif | |
50 | ||
51 | %if %{with python3} | |
52 | %py3_build | |
53 | %endif | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %if %{with python2} | |
59 | %py_install | |
60 | ||
61 | %py_postclean | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %py3_install | |
66 | %endif | |
67 | ||
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %if %{with python2} | |
72 | %files | |
73 | %defattr(644,root,root,755) | |
74 | %doc README.rst | |
75 | %{py_sitescriptdir}/%{module}.py[co] | |
76 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %files -n python3-%{module} | |
81 | %defattr(644,root,root,755) | |
82 | %doc README.rst | |
83 | %{py3_sitescriptdir}/%{module}.py | |
84 | %{py3_sitescriptdir}/__pycache__ | |
85 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
86 | %endif |