[packages/python-anyjson] add python3 support
jajcus
jajcus at pld-linux.org
Mon Nov 16 15:55:41 CET 2015
commit ac9a9fadc6ce93ebfce005aaedb69dc787ee14f1
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date: Mon Nov 16 15:55:26 2015 +0100
add python3 support
Release: 2
python-anyjson.spec | 65 +++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 56 insertions(+), 9 deletions(-)
---
diff --git a/python-anyjson.spec b/python-anyjson.spec
index c88e1c4..02237d4 100644
--- a/python-anyjson.spec
+++ b/python-anyjson.spec
@@ -1,18 +1,29 @@
+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
%define module anyjson
Summary: JSON implementation in a common interface
Name: python-%{module}
Version: 0.3.3
-Release: 1
+Release: 2
License: BSD
Group: Development/Languages/Python
Source0: http://pypi.python.org/packages/source/a/%{module}/%{module}-%{version}.tar.gz
# Source0-md5: 2ea28d6ec311aeeebaf993cb3008b27c
URL: https://bitbucket.org/runeh/anyjson
-BuildRequires: python-distribute
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: rpmbuild(macros) >= 1.612
+%if %{with python2}
+%{?with_tests:BuildRequires: python-nose}
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-setuptools
+%endif
Requires: python-modules
-Requires: python-pyparsing
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -21,29 +32,65 @@ Anyjson loads whichever is the fastest JSON module installed and
provides a uniform API regardless of which JSON implementation is
used.
+%package -n python3-%{module}
+Summary: JSON implementation in a common interface
+Group: Libraries/Python
+Requires: python3-modules
+
+%description -n python3-%{module}
+Anyjson loads whichever is the fastest JSON module installed and
+provides a uniform API regardless of which JSON implementation is
+used.
+
%prep
%setup -q -n %{module}-%{version}
%build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 # %{?with_tests:test}
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- --skip-build \
+
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
--optimize=2 \
--root=$RPM_BUILD_ROOT
%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README*
-
+%doc CHANGELOG README
%{py_sitescriptdir}/%{module}
%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/%{module}-*.egg-info
%endif
+
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGELOG README
+%{py3_sitescriptdir}/%{module}
+%if "%{py_ver}" > "2.4"
+%{py3_sitescriptdir}/%{module}-*.egg-info
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-anyjson.git/commitdiff/ac9a9fadc6ce93ebfce005aaedb69dc787ee14f1
More information about the pld-cvs-commit
mailing list