packages: python-mockito/python-mockito.spec - build for python 3.x too
wiget
wiget at pld-linux.org
Sun Mar 6 14:10:28 CET 2011
Author: wiget Date: Sun Mar 6 13:10:28 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- build for python 3.x too
---- Files affected:
packages/python-mockito:
python-mockito.spec (1.1 -> 1.2)
---- Diffs:
================================================================
Index: packages/python-mockito/python-mockito.spec
diff -u packages/python-mockito/python-mockito.spec:1.1 packages/python-mockito/python-mockito.spec:1.2
--- packages/python-mockito/python-mockito.spec:1.1 Mon Feb 28 14:36:50 2011
+++ packages/python-mockito/python-mockito.spec Sun Mar 6 14:10:22 2011
@@ -1,7 +1,8 @@
# $Revision$, $Date$
#
# Conditional build:
-%bcond_without tests # do not perform "make test"
+%bcond_without python2
+%bcond_without python3
%define module mockito
Summary: Spying framework
@@ -13,10 +14,18 @@
Source0: http://mockito-python.googlecode.com/files/%{module}-python-%{version}.tar.gz
# Source0-md5: 814669d5a6f1dc051f409d8c3521da64
URL: http://code.google.com/p/mockito-python
+%if %{with python2}
BuildRequires: python-distribute
+Requires: python-modules
+%endif
+%if %{with python3}
+BuildRequires: python3
+BuildRequires: python3-2to3 >= 1:3.1.1-3
+BuildRequires: python3-distribute
+BuildRequires: python3-modules
+%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
-Requires: python-modules
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -24,28 +33,59 @@
Mockito is a spying framework based on Java library with the same
name.
+%package -n python3-%{module}
+Summary: Spying framework
+Group: Development/Languages/Python
+
+%description -n python3-%{module}
+Mockito is a spying framework based on Java library with the same
+name.
+
%prep
%setup -q -n %{module}-python
find . -name '*.py' -type f | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
%build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py \
+ build -b build-2
+
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build -b build-3
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- --skip-build \
- --optimize=2 \
- --root=$RPM_BUILD_ROOT
+%if %{with python2}
+%{__python} -- setup.py \
+ build -b build-2 \
+ install \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
+# shutup check-files
%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} -- setup.py \
+ build -b build-3 \
+ install \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
+
+# shutup check-files
+%py3_postclean
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
%doc README
@@ -58,6 +98,19 @@
%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/mockito-*.egg-info
%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%dir %{py3_sitescriptdir}/mockito
+%{py3_sitescriptdir}/mockito/*.py[co]
+%dir %{py3_sitescriptdir}/mockito_test
+%{py3_sitescriptdir}/mockito_test/*.py[co]
+%dir %{py3_sitescriptdir}/mockito_util
+%{py3_sitescriptdir}/mockito_util/*.py[co]
+%{py3_sitescriptdir}/mockito-*.egg-info
+%endif
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -65,6 +118,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.2 2011/03/06 13:10:22 wiget
+- build for python 3.x too
+
Revision 1.1 2011/02/28 13:36:50 atler
- new
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-mockito/python-mockito.spec?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list