[python-social-auth/epel7] - python3 and python version related macros required to build python3- subpackage are not available

Jakub QB Dorňák jdornak at fedoraproject.org
Mon Feb 3 07:43:51 UTC 2014


commit f45d17ae306b659323ef2dc7b7d735651cb1d083
Author: Jakub Dorňák <jdornak at redhat.com>
Date:   Mon Feb 3 08:40:58 2014 +0100

    - python3 and python version related macros required to build python3- subpackage are not available in epel7

 python-social-auth.spec |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)
---
diff --git a/python-social-auth.spec b/python-social-auth.spec
index 80c4459..d796232 100644
--- a/python-social-auth.spec
+++ b/python-social-auth.spec
@@ -1,4 +1,14 @@
-%bcond_without python3
+%if 0%{?el7}
+    # python3 and python version related macros
+    # required to build python3- subpackage
+    # are not available in epel7
+    %global with_python3    0
+    %global __python2       %{__python}
+    %global python2_sitelib %{python_sitelib}
+%else
+    %bcond_without python3
+%endif
+%bcond_without doc
 
 %global pkgname social-auth
 
@@ -19,7 +29,7 @@ BuildRequires:  python-setuptools
 %if 0%{?with_python3}
 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
-%endif
+%endif # with_python3
 
 Requires:       python-oauthlib >= 0.3.8
 Requires:       python-openid   >= 2.2
@@ -35,6 +45,7 @@ Crafted using base code from django-social-auth, implements a common interface
 to define new authentication providers from third parties. And to bring support
 for more frameworks and ORMs.
 
+%if 0%{?with_doc}
 %package doc
 Summary:        Documentation for Python Social Auth
 Group:          Documentation
@@ -42,6 +53,7 @@ Requires:       %{name} = %{version}-%{release}
 
 %description doc
 This package contains the documentation for %{name}.
+%endif # with_doc
 
 %if 0%{?with_python3}
 %package -n python3-%{pkgname}
@@ -62,6 +74,7 @@ Crafted using base code from django-social-auth, implements a common interface
 to define new authentication providers from third parties. And to bring support
 for more frameworks and ORMs.
 
+%if 0%{?with_doc}
 %package -n python3-%{pkgname}-doc
 Summary:        Documentation for Python Social Auth
 Group:          Documentation
@@ -69,7 +82,8 @@ Requires:       python3-%{pkgname} = %{version}-%{release}
 
 %description -n python3-%{pkgname}-doc
 This package contains the documentation for %{name}.
-%endif
+%endif # with_doc
+%endif # with_python3
 
 
 %prep
@@ -77,7 +91,7 @@ This package contains the documentation for %{name}.
 
 %if 0%{?with_python3}
 cp -a . %{py3dir}
-%endif
+%endif # with_python3
 
 
 %build
@@ -87,12 +101,14 @@ cp -a . %{py3dir}
 pushd %{py3dir}
 %{__python3} setup.py build
 popd
-%endif
+%endif # with_python3
 
 # build documentation
+%if 0%{?with_doc}
 pushd docs
     make html
 popd
+%endif # with_doc
 
 
 %install
@@ -102,7 +118,7 @@ popd
 pushd %{py3dir}
 %{__python3} setup.py install --skip-build --root %{buildroot}
 popd
-%endif
+%endif # with_python3
 
 # remove .po files
 find %{buildroot} -name "*.po" | xargs rm -f
@@ -161,8 +177,10 @@ find %{buildroot} -name "*.po" | xargs rm -f
 %{python2_sitelib}/python_social_auth-%{version}-py2.*.egg-info
 
 
+%if 0%{?with_doc}
 %files doc
 %doc docs/_build/html
+%endif # with_doc
 
 %if 0%{?with_python3}
 %files -n python3-%{pkgname}
@@ -233,9 +251,11 @@ find %{buildroot} -name "*.po" | xargs rm -f
 %{python3_sitelib}/social/tests/backends/__pycache__/*.py[co]
 %{python3_sitelib}/python_social_auth-%{version}-py3.*.egg-info
 
+%if 0%{?with_doc}
 %files -n python3-%{pkgname}-doc
 %doc docs/_build/html
-%endif
+%endif # with_doc
+%endif # with_python3
 
 %changelog
 * Fri Nov 29 2013 Jakub Dorňák <jdornak at redhat.com> - 0.1.17-1


More information about the scm-commits mailing list