]> git.pld-linux.org Git - packages/python-grequests.git/commitdiff
- started python3 support
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 14 Aug 2015 13:23:42 +0000 (15:23 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 14 Aug 2015 13:23:42 +0000 (15:23 +0200)
python-grequests.spec

index b01b51d789ad356eaaaf2178773d47d16ee163ea..e68211fc84ac80ffa4a6cebcf6d56f288e10b4a6 100644 (file)
@@ -1,3 +1,10 @@
+#
+# Conditional build:
+%bcond_without  doc             # don't build doc
+%bcond_without  tests   # do not perform "make test"
+%bcond_without  python2 # CPython 2.x module
+%bcond_with  python3 # CPython 3.x module
+
 %define        module  grequests
 Summary:       gevent support for python-requests
 Name:          python-%{module}
@@ -8,11 +15,18 @@ Group:               Libraries/Python
 Source0:       https://pypi.python.org/packages/source/g/grequests/grequests-%{version}.tar.gz
 # Source0-md5: 23186795cf69d127f5e90df665d25387
 URL:           https://github.com/kennethreitz/grequests
+%if %{with python2}
 BuildRequires: python-distribute
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: python-gevent
 Requires:      python-libs
 Requires:      python-requests
+%endif
+%if %{with python3}
+BuildRequires: python3-distribute
+BuildRequires: python3-gevent
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.219
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -20,26 +34,53 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 GRequests allows you to use Requests with Gevent to make asyncronous
 HTTP Requests easily.
 
+%package -n python3-%{module}
+Summary:       gevent support for python-requests
+Group:         Libraries/Python
+Requires:      python3-libs
+Requires:      python3-requests
+
+%description -n python3-%{module}
+GRequests allows you to use Requests with Gevent to make asyncronous
+HTTP Requests easily.
+
 %prep
 %setup -q -n %{module}-%{version}
 
 %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
 
+%if %{with python2}
 %{__python} setup.py \
-       build --build-base build-2 \
-       install --skip-build \
-       --optimize=2 \
-       --root=$RPM_BUILD_ROOT
+               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
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc README.rst
@@ -47,3 +88,12 @@ rm -rf $RPM_BUILD_ROOT
 %if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/*.egg-info
 %endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README.rst
+#%{py3_sitescriptdir}/%{module}
+#%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
This page took 0.110207 seconds and 4 git commands to generate.