[packages/sphinx-pdg] - create symmetric -2 and -3 subpackages; base package contains just symlinks to one of them - dropp
qboosh
qboosh at pld-linux.org
Wed Dec 2 17:10:17 CET 2015
commit 19a390668dbedff5b42e37f8df75a0f2244d9057
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Dec 2 17:10:56 2015 +0100
- create symmetric -2 and -3 subpackages; base package contains just symlinks to one of them
- dropped -devel-tools dependencies (pdb is now optional, used when -P option is specified)
- dropped (outdated) dependencies duplicating autodetected python*egg(*) requires
- BR: babel (used by setup.py to enable some javascript functionality)
- added standard python2/python3 bconds
sphinx-pdg.spec | 68 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 34 insertions(+), 34 deletions(-)
---
diff --git a/sphinx-pdg.spec b/sphinx-pdg.spec
index d21e5e3..79171b3 100644
--- a/sphinx-pdg.spec
+++ b/sphinx-pdg.spec
@@ -3,6 +3,8 @@
# documentation generator)
#
# Conditional build:
+%bcond_without python2 # CPython 2.x version
+%bcond_without python3 # CPython 3.x version
%bcond_without python3_default # Use Python 3.x for easy_install executable
Summary: Sphinx - Python documentation generator
@@ -16,25 +18,25 @@ Group: Development/Languages/Python
Source0: https://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
# Source0-md5: 740b8171b760fb1fa801bf2d1f2d3133
URL: http://sphinx.pocoo.org/
+%if %{with python2}
+BuildRequires: python-babel >= 1.3
BuildRequires: python-devel >= 1:2.5
BuildRequires: python-modules >= 1:2.5
BuildRequires: python-setuptools >= 7.0
+%endif
+%if %{with python3}
BuildRequires: python3-2to3
+BuildRequires: python3-babel >= 1.3
BuildRequires: python3-devel
BuildRequires: python3-modules
BuildRequires: python3-setuptools >= 7.0
+%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.710
%if %{with python3_default}
-Requires: python3-Sphinx = %{version}-%{release}
-Requires: python3-devel-tools
-Provides: %{name}-3 = %{version}-%{release}
-Obsoletes: sphinx-pdg-3
+Requires: sphinx-pdg-3 = %{version}-%{release}
%else
-Requires: python-Sphinx = %{version}-%{release}
-Requires: python-devel-tools
-Provides: %{name}-2 = %{version}-%{release}
-Obsoletes: sphinx-pdg-2
+Requires: sphinx-pdg-2 = %{version}-%{release}
%endif
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -60,6 +62,7 @@ Summary: Sphinx Python documentation generator (Python 2 version)
Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (wersja dla Pythona 2)
Group: Development/Languages/Python
Requires: python-Sphinx = %{version}-%{release}
+Conflicts: sphinx-pdg < 1.3.2
%description 2
Sphinx is a tool that makes it easy to create intelligent and
@@ -82,6 +85,7 @@ Summary: Sphinx Python documentation generator (Python 3 version)
Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (wersja dla Pythona 3)
Group: Development/Languages/Python
Requires: python3-Sphinx = %{version}-%{release}
+Conflicts: sphinx-pdg < 1.3.2
%description 3
Sphinx is a tool that makes it easy to create intelligent and
@@ -103,11 +107,7 @@ będzie przydatne dla wielu innych projektów.
Summary: Sphinx Python documentation generator (Python 2.x modules)
Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 2.x)
Group: Development/Languages/Python
-Requires: python-docutils >= 0.7
-Requires: python-jinja2 >= 2.3
Requires: python-modules
-Requires: python-pygments >= 1.2
-Requires: python-setuptools > 7.0
Conflicts: sphinx-pdg < 1.0.7-2
%description -n python-Sphinx
@@ -126,10 +126,6 @@ sphinx-pdg.
Summary: Sphinx Python documentation generator (Python 3.x modules)
Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 3.x)
Group: Development/Languages/Python
-Requires: python3-docutils >= 0.8
-Requires: python3-jinja2 >= 2.3
-Requires: python3-pygments >= 1.2
-Requires: python3-setuptools > 7.0
Conflicts: sphinx-pdg-3 < 1.0.7-2
%description -n python3-Sphinx
@@ -148,37 +144,46 @@ sphinx-pdg-3.
%setup -q -n Sphinx-%{version}
%build
+%if %{with python2}
%py_build
%{__rm} sphinx/__init__.pyc
+%endif
+
+%if %{with python3}
%py3_build
%{__rm} -r sphinx/__pycache__
+%endif
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%py_install
%{__rm} sphinx/__init__.pyc
%py_postclean
for f in $RPM_BUILD_ROOT%{_bindir}/*; do
- mv "${f}" "${f}-2"
+ %{__mv} "${f}" "${f}-2"
done
+%endif
+%if %{with python3}
%py3_install
%{__rm} -r sphinx/__pycache__
for f in $RPM_BUILD_ROOT%{_bindir}/*; do
[ "${f%%-2}" == "$f" ] || continue
- mv "${f}" "${f}-3"
+ %{__mv} "${f}" "${f}-3"
done
+%endif
%if %{with python3_default}
for f in $RPM_BUILD_ROOT%{_bindir}/*-3; do
- ln "${f}" "${f%%-3}"
+ ln -sf "$(basename "$f")" "${f%%-3}"
done
%else
for f in $RPM_BUILD_ROOT%{_bindir}/*-2; do
- ln "${f}" "${f%%-2}"
+ ln -sf "$(basename "$f")" "${f%%-2}"
done
%endif
@@ -187,46 +192,41 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS CHANGES EXAMPLES LICENSE PKG-INFO README.rst
-%attr(755,root,root) %{_bindir}/sphinx-autogen
%attr(755,root,root) %{_bindir}/sphinx-apidoc
+%attr(755,root,root) %{_bindir}/sphinx-autogen
%attr(755,root,root) %{_bindir}/sphinx-build
%attr(755,root,root) %{_bindir}/sphinx-quickstart
-%if %{with python3_default}
-%attr(755,root,root) %{_bindir}/sphinx-autogen-3
-%attr(755,root,root) %{_bindir}/sphinx-apidoc-3
-%attr(755,root,root) %{_bindir}/sphinx-build-3
-%attr(755,root,root) %{_bindir}/sphinx-quickstart-3
+%if %{with python2}
%files 2
%defattr(644,root,root,755)
%doc AUTHORS CHANGES EXAMPLES LICENSE PKG-INFO README.rst
-%attr(755,root,root) %{_bindir}/sphinx-autogen-2
%attr(755,root,root) %{_bindir}/sphinx-apidoc-2
-%attr(755,root,root) %{_bindir}/sphinx-build-2
-%attr(755,root,root) %{_bindir}/sphinx-quickstart-2
-
-%else
%attr(755,root,root) %{_bindir}/sphinx-autogen-2
-%attr(755,root,root) %{_bindir}/sphinx-apidoc-2
%attr(755,root,root) %{_bindir}/sphinx-build-2
%attr(755,root,root) %{_bindir}/sphinx-quickstart-2
+%endif
+%if %{with python3}
%files 3
%defattr(644,root,root,755)
%doc AUTHORS CHANGES EXAMPLES LICENSE PKG-INFO README.rst
-%attr(755,root,root) %{_bindir}/sphinx-autogen-3
%attr(755,root,root) %{_bindir}/sphinx-apidoc-3
+%attr(755,root,root) %{_bindir}/sphinx-autogen-3
%attr(755,root,root) %{_bindir}/sphinx-build-3
%attr(755,root,root) %{_bindir}/sphinx-quickstart-3
%endif
+%if %{with python2}
%files -n python-Sphinx
%defattr(644,root,root,755)
%{py_sitescriptdir}/sphinx
%{py_sitescriptdir}/Sphinx-%{version}-py*.egg-info
+%endif
+%if %{with python3}
%files -n python3-Sphinx
%defattr(644,root,root,755)
%{py3_sitescriptdir}/sphinx
%{py3_sitescriptdir}/Sphinx-%{version}-py*.egg-info
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/sphinx-pdg.git/commitdiff/19a390668dbedff5b42e37f8df75a0f2244d9057
More information about the pld-cvs-commit
mailing list