3 %bcond_without tests # do not perform "make test"
4 %bcond_without python3 # CPython 3.x module
6 %define module flexmock
7 Summary: Testing library that makes it easy to create mocks, stubs and fakes
12 Group: Libraries/Python
13 Source0: http://pypi.python.org/packages/source/f/flexmock/flexmock-%{version}.tar.gz
14 # Source0-md5: f91c7b608fb4235419d75fe9274f7f0c
15 # git clone https://github.com/has207/flexmock.git && cd flexmock
16 # git checkout 0.9.6 && tar -czf python-flexmock-0.9.6-tests.tgz tests/
17 Source1: %{name}-%{version}-tests.tgz
18 # Source1-md5: 6cecfda41b4b86a66dc9b6fc3aa9b002
19 URL: https://github.com/has207/flexmock
20 BuildRequires: python-devel
21 BuildRequires: python-setuptools
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.710
24 BuildRequires: sed >= 4.0
26 BuildRequires: python3-devel
27 BuildRequires: python3-modules
28 BuildRequires: python3-setuptools
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Flexmock is a testing library for Python that makes it easy to create
35 mocks, stubs and fakes. The API is inspired by a Ruby library of the
36 same name, but Python flexmock is not a clone of the Ruby version. It
37 omits a number of redundancies in the Ruby flexmock API, alters some
38 defaults, and introduces a number of Python-only features.
40 %package -n python3-flexmock
41 Summary: Testing library that makes it easy to create mocks, stubs and fakes
42 Group: Libraries/Python
44 %description -n python3-flexmock
45 Flexmock is a testing library for Python that makes it easy to create
46 mocks, stubs and fakes. The API is inspired by a Ruby library of the
47 same name, but Python flexmock is not a clone of the Ruby version. It
48 omits a number of redundancies in the Ruby flexmock API, alters some
49 defaults, and introduces a number of Python-only features.
52 %setup -q -n %{module}-%{version}
54 %{__tar} xf %{SOURCE1} -C build/lib
64 PYTHONPATH=build-2/lib %{__python} tests/flexmock_unittest_test.py
67 PYTHONPATH=build-3/lib %{__python3} tests/flexmock_unittest_test.py
72 rm -rf $RPM_BUILD_ROOT
82 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %doc LICENSE README.md CHANGELOG
87 %{py_sitescriptdir}/flexmock.py[co]
88 %{py_sitescriptdir}/flexmock-%{version}-py*.egg-info
91 %files -n python3-flexmock
92 %defattr(644,root,root,755)
93 %doc LICENSE README.md CHANGELOG
94 %{py3_sitescriptdir}/__pycache__/%{module}.*.py[co]
95 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
96 %{py3_sitescriptdir}/%{module}.py