]>
Commit | Line | Data |
---|---|---|
7f39570e JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: FreezeGun: Let your Python 2 tests travel through time | |
8 | Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 2 podróżowania w czasie | |
9 | Name: python-freezegun | |
10 | Version: 0.3.10 | |
38ef068b | 11 | Release: 2 |
7f39570e JB |
12 | License: Apache v2.0 |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/freezegun/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz | |
16 | # Source0-md5: 703b64446743c0d9f81ca9308e5097a0 | |
17 | Patch0: %{name}-mock.patch | |
97944efc | 18 | Patch1: %{name}-python3.7.patch |
7f39570e JB |
19 | URL: https://pypi.org/project/freezegun/ |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.6 | |
24 | BuildRequires: python-setuptools | |
25 | %if %{with tests} | |
26 | BuildRequires: python-dateutil >= 2.1 | |
27 | BuildRequires: python-mock | |
c7631783 | 28 | BuildRequires: python-modules-sqlite |
7f39570e JB |
29 | BuildRequires: python-nose |
30 | BuildRequires: python-six | |
31 | %endif | |
32 | %endif | |
33 | %if %{with python3} | |
34 | BuildRequires: python3-modules >= 1:3.3 | |
35 | BuildRequires: python3-setuptools | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-dateutil >= 2.1 | |
38 | BuildRequires: python3-nose | |
39 | BuildRequires: python3-six | |
40 | %endif | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.6 | |
43 | BuildArch: noarch | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | FreezeGun is a library that allows your Python tests to travel through | |
48 | time by mocking the datetime module. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w | |
52 | czasie dzięki atrapie modułu datetime. | |
53 | ||
54 | %package -n python3-freezegun | |
55 | Summary: FreezeGun: Let your Python 3 tests travel through time | |
56 | Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 3 podróżowania w czasie | |
57 | Group: Libraries/Python | |
58 | Requires: python3-modules >= 1:3.3 | |
59 | ||
60 | %description -n python3-freezegun | |
61 | FreezeGun is a library that allows your Python tests to travel through | |
62 | time by mocking the datetime module. | |
63 | ||
64 | %description -n python3-freezegun -l pl.UTF-8 | |
65 | FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w | |
66 | czasie dzięki atrapie modułu datetime. | |
67 | ||
68 | %prep | |
69 | %setup -q -n freezegun-%{version} | |
70 | %patch0 -p1 | |
97944efc | 71 | %patch1 -p1 |
7f39570e JB |
72 | |
73 | %build | |
74 | %if %{with python2} | |
75 | %py_build | |
76 | ||
77 | %if %{with tests} | |
78 | nosetests-%{py_ver} tests | |
79 | %endif | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
83 | %py3_build | |
84 | ||
85 | %if %{with tests} | |
86 | nosetests-%{py3_ver} tests | |
87 | %endif | |
88 | %endif | |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
93 | %if %{with python2} | |
94 | %py_install | |
95 | ||
96 | %py_postclean | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | %py3_install | |
101 | %endif | |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
109 | %doc AUTHORS.rst CHANGELOG README.rst | |
110 | %{py_sitescriptdir}/freezegun | |
111 | %{py_sitescriptdir}/freezegun-%{version}-py*.egg-info | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %files -n python3-freezegun | |
116 | %defattr(644,root,root,755) | |
117 | %doc AUTHORS.rst CHANGELOG README.rst | |
118 | %{py3_sitescriptdir}/freezegun | |
119 | %{py3_sitescriptdir}/freezegun-%{version}-py*.egg-info | |
120 | %endif |