]> git.pld-linux.org Git - packages/python-sure.git/blob - python-sure.spec
Release 2. Fixed Python 3.4 build and tests.
[packages/python-sure.git] / python-sure.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  sure
8 Summary:        Utility belt for automated testing in python for python
9 Name:           python-%{module}
10 Version:        1.2.12
11 Release:        2
12 License:        GPL v3+
13 Group:          Libraries/Python
14 # Source0:      https://github.com/gabrielfalcao/sure/archive/%{version}.tar.gz
15 Source0:        https://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.tar.gz
16 # Source0-md5:  fc57c30e76bddba68f84443ec91e7026
17 Patch0:         %{name}-py3_fixes.patch
18 URL:            https://github.com/gabrielfalcao/sure
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.219
21 %if %{with python2}
22 BuildRequires:  python-devel
23 BuildRequires:  python-distribute
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-devel
27 BuildRequires:  python3-distribute
28 BuildRequires:  python3-modules
29 %endif
30 Requires:       python-modules
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 A testing library for python with powerful and flexible assertions.
36 Sure is heavily inspired by should.js.
37
38 %package -n python3-%{module}
39 Summary:        Utility belt for automated testing in python for python
40 Group:          Libraries/Python
41 Requires:       python3-modules
42
43 %description -n python3-%{module}
44 A testing library for python with powerful and flexible assertions.
45 Sure is heavily inspired by should.js.
46
47 %prep
48 %setup -q -n %{module}-%{version}
49 %patch0 -p1
50
51 %build
52 %if %{with python2}
53 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
54 %endif
55
56 %if %{with python3}
57 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
58 %endif
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62
63 %if %{with python2}
64 %{__python} setup.py \
65         build --build-base build-2 \
66         install --skip-build \
67         --optimize=2 \
68         --root=$RPM_BUILD_ROOT
69
70 %py_postclean
71 %endif
72
73 %if %{with python3}
74 %{__python3} setup.py \
75         build --build-base build-3 \
76         install --skip-build \
77         --optimize=2 \
78         --root=$RPM_BUILD_ROOT
79 %endif
80
81 %clean
82 rm -rf $RPM_BUILD_ROOT
83
84 %if %{with python2}
85 %files
86 %defattr(644,root,root,755)
87 %doc README.md
88 %dir %{py_sitescriptdir}/sure
89 %{py_sitescriptdir}/sure/*.py[co]
90 %if "%{py_ver}" > "2.4"
91 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
92 %endif
93 %endif
94
95 %if %{with python3}
96 %files -n python3-%{module}
97 %defattr(644,root,root,755)
98 %doc  README.md
99 %{py3_sitescriptdir}/%{module}
100 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
101 %endif
This page took 0.082187 seconds and 3 git commands to generate.