]> git.pld-linux.org Git - packages/python-mockito.git/blob - python-mockito.spec
bef1284c8f5554690ee44671d27454b57d718a46
[packages/python-mockito.git] / python-mockito.spec
1 #
2 # Conditional build:
3 %bcond_without  python2
4 %bcond_without  python3
5
6 %define         module  mockito
7 Summary:        Spying framework
8 Name:           python-%{module}
9 Version:        0.5.1
10 Release:        0.1
11 License:        MIT
12 Group:          Development/Languages/Python
13 Source0:        http://mockito-python.googlecode.com/files/%{module}-python-%{version}.tar.gz
14 # Source0-md5:  814669d5a6f1dc051f409d8c3521da64
15 URL:            http://code.google.com/p/mockito-python
16 %if %{with python2}
17 BuildRequires:  python-distribute
18 Requires:       python-modules
19 %endif
20 %if %{with python3}
21 BuildRequires:  python3
22 BuildRequires:  python3-2to3 >= 1:3.1.1-3
23 BuildRequires:  python3-modules
24 %endif
25 BuildRequires:  rpm-pythonprov
26 BuildRequires:  rpmbuild(macros) >= 1.219
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Mockito is a spying framework based on Java library with the same
32 name.
33
34 %package -n python3-%{module}
35 Summary:        Spying framework
36 Group:          Development/Languages/Python
37
38 %description -n python3-%{module}
39 Mockito is a spying framework based on Java library with the same
40 name.
41
42 %prep
43 %setup -q -n %{module}-python
44
45 find . -name '*.py' -type f | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
46
47 %build
48 %if %{with python2}
49 %{__python} setup.py \
50         build -b build-2
51
52 %endif
53
54 %if %{with python3}
55 %{__python3} setup.py \
56         build -b build-3
57 %endif
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61 %if %{with python2}
62 %{__python} -- setup.py \
63         build -b build-2 \
64         install \
65         --root=$RPM_BUILD_ROOT \
66         --optimize=2
67
68 # shutup check-files
69 %py_postclean
70 %endif
71
72 %if %{with python3}
73 %{__python3} -- setup.py \
74         build -b build-3 \
75         install \
76         --root=$RPM_BUILD_ROOT \
77         --optimize=2
78
79 # shutup check-files
80 %py3_postclean
81 %endif
82
83 %clean
84 rm -rf $RPM_BUILD_ROOT
85
86 %if %{with python2}
87 %files
88 %defattr(644,root,root,755)
89 %doc README
90 %dir %{py_sitescriptdir}/mockito
91 %{py_sitescriptdir}/mockito/*.py[co]
92 %dir %{py_sitescriptdir}/mockito_test
93 %{py_sitescriptdir}/mockito_test/*.py[co]
94 %dir %{py_sitescriptdir}/mockito_util
95 %{py_sitescriptdir}/mockito_util/*.py[co]
96 %if "%{py_ver}" > "2.4"
97 %{py_sitescriptdir}/mockito-*.egg-info
98 %endif
99 %endif
100
101 %if %{with python3}
102 %files -n python3-%{module}
103 %defattr(644,root,root,755)
104 %dir %{py3_sitescriptdir}/mockito
105 %{py3_sitescriptdir}/mockito/*.py[co]
106 %dir %{py3_sitescriptdir}/mockito_test
107 %{py3_sitescriptdir}/mockito_test/*.py[co]
108 %dir %{py3_sitescriptdir}/mockito_util
109 %{py3_sitescriptdir}/mockito_util/*.py[co]
110 %{py3_sitescriptdir}/mockito-*.egg-info
111 %endif
This page took 0.063907 seconds and 2 git commands to generate.