forked from pool/python-docutils
- only emit rst2html5 alternatives for python 3
- switch the "docutils" provides to the python 3 package (all the comands live ther) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=42
This commit is contained in:
committed by
Git OBS Bridge
parent
e62867ea5f
commit
f3a5c9d375
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 6 13:31:03 UTC 2017 - jmatejek@suse.com
|
||||||
|
|
||||||
|
- only emit rst2html5 alternatives for python 3
|
||||||
|
- switch the "docutils" provides to the python 3 package (all the comands live ther)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 1 19:33:19 UTC 2017 - toddrme2178@gmail.com
|
Mon May 1 19:33:19 UTC 2017 - toddrme2178@gmail.com
|
||||||
|
|
||||||
|
@@ -32,13 +32,13 @@ BuildRequires: %{python_module xml}
|
|||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-xml
|
Requires: python-xml
|
||||||
%ifpython2
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
BuildArch: noarch
|
||||||
|
%ifpython3
|
||||||
Provides: docutils = %{version}
|
Provides: docutils = %{version}
|
||||||
Obsoletes: docutils < %{version}
|
Obsoletes: docutils < %{version}
|
||||||
%endif
|
%endif
|
||||||
Requires(post): update-alternatives
|
|
||||||
Requires(preun): update-alternatives
|
|
||||||
BuildArch: noarch
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -47,7 +47,7 @@ such as HTML, XML, and LaTeX. For input Docutils supports reStructuredText, an
|
|||||||
easy-to-read, what-you-see-is-what-you-get plaintext markup syntax.
|
easy-to-read, what-you-see-is-what-you-get plaintext markup syntax.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n docutils-%{version}
|
%setup -q -n docutils-%{version}
|
||||||
# Remove useless ".py" ending from executables:
|
# Remove useless ".py" ending from executables:
|
||||||
for i in tools/rst*; do mv "$i" "${i/.py}"; done
|
for i in tools/rst*; do mv "$i" "${i/.py}"; done
|
||||||
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py
|
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py
|
||||||
@@ -69,12 +69,16 @@ mv %{buildroot}%{_bindir}/rst2html5 %{buildroot}%{_bindir}/rst2html5-docutils
|
|||||||
ln -s -f %{_sysconfdir}/alternatives/rst2html5 %{buildroot}%{_bindir}/rst2html5
|
ln -s -f %{_sysconfdir}/alternatives/rst2html5 %{buildroot}%{_bindir}/rst2html5
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
%ifpython3
|
||||||
update-alternatives --install %{_bindir}/rst2html5 rst2html5 %{_bindir}/rst2html5-docutils 15
|
update-alternatives --install %{_bindir}/rst2html5 rst2html5 %{_bindir}/rst2html5-docutils 15
|
||||||
|
%endif
|
||||||
|
|
||||||
%preun
|
%postun
|
||||||
|
%ifpython3
|
||||||
if [ ! -f %{_bindir}/rst2html5-docutils ] ; then
|
if [ ! -f %{_bindir}/rst2html5-docutils ] ; then
|
||||||
update-alternatives --remove rst2html5 %{_bindir}/rst2html5-docutils
|
update-alternatives --remove rst2html5 %{_bindir}/rst2html5-docutils
|
||||||
fi
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%python_exec -c 'import subprocess; import sys; sys.exit(subprocess.call([sys.executable, "test/alltests.py" if sys.version_info[0] == 2 else "test3/alltests.py"]))'
|
%python_exec -c 'import subprocess; import sys; sys.exit(subprocess.call([sys.executable, "test/alltests.py" if sys.version_info[0] == 2 else "test3/alltests.py"]))'
|
||||||
|
Reference in New Issue
Block a user