]> git.pld-linux.org Git - packages/python-sure.git/blob - python-sure.spec
f7f41ad820fd36b0d64688e0b7ed1b298200d9cf
[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_with     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:        1
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 URL:            https://github.com/gabrielfalcao/sure
18 BuildRequires:  rpm-pythonprov
19 BuildRequires:  rpmbuild(macros) >= 1.219
20 %if %{with python2}
21 BuildRequires:  python-devel
22 BuildRequires:  python-distribute
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-devel
26 BuildRequires:  python3-distribute
27 BuildRequires:  python3-modules
28 %endif
29 Requires:       python-modules
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 A testing library for python with powerful and flexible assertions.
35 Sure is heavily inspired by should.js.
36
37 %package -n python3-%{module}
38 Summary:        Utility belt for automated testing in python for python
39 Group:          Libraries/Python
40 Requires:       python3-modules
41
42 %description -n python3-%{module}
43 A testing library for python with powerful and flexible assertions.
44 Sure is heavily inspired by should.js.
45
46 %prep
47 %setup -q -n %{module}-%{version}
48
49 %build
50 %if %{with python2}
51 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
52 %endif
53
54 %if %{with python3}
55 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
56 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
57 %endif
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61
62 %if %{with python2}
63 %{__python} setup.py \
64         build --build-base build-2 \
65         install --skip-build \
66         --optimize=2 \
67         --root=$RPM_BUILD_ROOT
68
69 %py_postclean
70 %endif
71
72 %if %{with python3}
73 %{__python3} setup.py \
74         build --build-base build-3 \
75         install --skip-build \
76         --optimize=2 \
77         --root=$RPM_BUILD_ROOT
78 %endif
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %if %{with python2}
84 %files
85 %defattr(644,root,root,755)
86 %doc README.md
87 %dir %{py_sitescriptdir}/sure
88 %{py_sitescriptdir}/sure/*.py[co]
89 %if "%{py_ver}" > "2.4"
90 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
91 %endif
92 %endif
93
94 %if %{with python3}
95 %files -n python3-%{module}
96 %defattr(644,root,root,755)
97 %doc  README.md
98 %{py3_sitescriptdir}/%{module}
99 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
100 %endif
This page took 0.040951 seconds and 2 git commands to generate.