[python-social-auth/el6] - python3 and python version related macros required to build python3- subpackage are not available
Jakub QB Dorňák
jdornak at fedoraproject.org
Tue Jan 21 14:13:23 UTC 2014
commit b031c41a4767c9167443dfc91b5f87011d860f89
Author: Jakub Dorňák <jdornak at redhat.com>
Date: Mon Jan 20 11:49:23 2014 +0100
- python3 and python version related macros required to build python3- subpackage are not available in el6
- sphinx.ext.viewcode required to build -doc subpackage is not available in el6
python-social-auth.spec | 37 ++++++++++++++++++++++++++++++-------
1 files changed, 30 insertions(+), 7 deletions(-)
---
diff --git a/python-social-auth.spec b/python-social-auth.spec
index 80c4459..0f607d7 100644
--- a/python-social-auth.spec
+++ b/python-social-auth.spec
@@ -1,4 +1,17 @@
-%bcond_without python3
+%if 0%{?el6}
+ # python3 and python version related macros
+ # required to build python3- subpackage
+ # are not available in el6
+ %global with_python3 0
+ %global __python2 %{__python}
+ %global python2_sitelib %{python_sitelib}
+ # sphinx.ext.viewcode required to build -doc subpackage
+ # is not available in el6
+ %global with_doc 0
+%else
+ %bcond_without python3
+ %bcond_without doc
+%endif
%global pkgname social-auth
@@ -19,7 +32,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 +48,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 +56,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 +77,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 +85,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 +94,7 @@ This package contains the documentation for %{name}.
%if 0%{?with_python3}
cp -a . %{py3dir}
-%endif
+%endif # with_python3
%build
@@ -87,12 +104,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 +121,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 +180,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 +254,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