]>
Commit | Line | Data |
---|---|---|
4d6b99a4 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ## Disable the tests as apparently the version 0.4.2 does not ship them | |
6 | %bcond_with tests # do not perform "make test" | |
7 | ||
8 | %define module arrow | |
9 | Summary: Better dates and times for Python | |
10 | Name: python-%{module} | |
11 | Version: 0.4.2 | |
88a73ab0 | 12 | Release: 12 |
4d6b99a4 ER |
13 | License: Apache v2.0 |
14 | Group: Development/Libraries | |
15 | Source0: http://pypi.python.org/packages/source/a/%{module}/%{module}-%{version}.tar.gz | |
16 | # Source0-md5: 5caa8442fd3a84a5ad0155a1f626ef1d | |
17 | URL: http://pypi.python.org/pypi/arrow | |
8b324dcc | 18 | BuildRequires: rpmbuild(macros) >= 1.710 |
9def19cc ER |
19 | BuildRequires: rpm-pythonprov |
20 | %if %{with python2} | |
4d6b99a4 ER |
21 | BuildRequires: python-chai |
22 | BuildRequires: python-dateutil | |
9def19cc ER |
23 | BuildRequires: python-distribute |
24 | BuildRequires: python-modules | |
4d6b99a4 | 25 | BuildRequires: python-six |
9def19cc | 26 | %endif |
4d6b99a4 | 27 | %if %{with python3} |
9def19cc | 28 | BuildRequires: python3-modules |
4d6b99a4 ER |
29 | %endif |
30 | Requires: python-dateutil | |
31 | Requires: python-six | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Arrow is a Python library that offers a sensible, human-friendly | |
37 | approach to creating, manipulating, formatting and converting dates, | |
38 | times, and timestamps. It implements and updates the datetime type, | |
39 | plugging gaps in functionality, and provides an intelligent module API | |
40 | that supports many common creation scenarios. | |
41 | ||
42 | Simply put, it helps you work with dates and times with fewer imports | |
43 | and a lot less code. | |
44 | ||
45 | %package -n python3-arrow | |
46 | Summary: Better dates and times for Python | |
47 | Group: Development/Libraries | |
48 | Requires: python3-dateutil | |
49 | Requires: python3-six | |
50 | ||
51 | %description -n python3-arrow | |
52 | Arrow is a Python library that offers a sensible, human-friendly | |
53 | approach to creating, manipulating, formatting and converting dates, | |
54 | times, and timestamps. It implements and updates the datetime type, | |
55 | plugging gaps in functionality, and provides an intelligent module API | |
56 | that supports many common creation scenarios. | |
57 | ||
58 | Simply put, it helps you work with dates and times with fewer imports | |
59 | and a lot less code. | |
60 | ||
61 | %prep | |
62 | %setup -q -n %{module}-%{version} | |
63 | ||
64 | # Remove bundled egg-info in case it exists | |
65 | rm -r %{module}.egg-info | |
66 | ||
67 | %build | |
68 | %if %{with python2} | |
b2555e47 | 69 | %py_build %{?with_tests:test} |
4d6b99a4 ER |
70 | %endif |
71 | ||
72 | %if %{with python3} | |
b2555e47 | 73 | %py3_build %{?with_tests:test} |
4d6b99a4 ER |
74 | %endif |
75 | ||
76 | %install | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %if %{with python2} | |
b2555e47 | 80 | %py_install |
4d6b99a4 ER |
81 | |
82 | %py_postclean | |
83 | %endif | |
84 | ||
85 | %if %{with python3} | |
b2555e47 | 86 | %py3_install |
4d6b99a4 ER |
87 | %endif |
88 | ||
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %files | |
93 | %defattr(644,root,root,755) | |
94 | # pr pending https://github.com/crsmithdev/arrow/pull/70 | |
95 | #%doc LICENSE README.md HISTORY.md | |
96 | %{py_sitescriptdir}/arrow | |
97 | %{py_sitescriptdir}/arrow-%{version}-py*.egg-info | |
98 | ||
99 | %if %{with python3} | |
100 | %files -n python3-%{module} | |
101 | %defattr(644,root,root,755) | |
102 | #%doc LICENSE README.md HISTORY.md | |
103 | %{py3_sitescriptdir}/arrow | |
104 | %{py3_sitescriptdir}/arrow-%{version}-py*.egg-info | |
105 | %endif |