Accepting request 482913 from home:alois:branches:devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/482913 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=37
This commit is contained in:
parent
0b8a87ae1d
commit
056d029962
2
python-docutils-rpmlintrc
Normal file
2
python-docutils-rpmlintrc
Normal file
@ -0,0 +1,2 @@
|
||||
# these can't be helped
|
||||
addFilter("no-manual-page-for-binary rst.*")
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 24 12:53:55 UTC 2017 - aloisio@gmx.com
|
||||
|
||||
- Converted to single-spec
|
||||
- Added python-docutils-rpmlintrc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 9 11:39:11 UTC 2017 - dmueller@suse.com
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-docutils
|
||||
Version: 0.13.1
|
||||
Release: 0
|
||||
@ -24,20 +25,20 @@ License: Python-2.0 and BSD-2-Clause and GPL-2.0+ and GPL-3.0+ and SUSE-P
|
||||
Group: Development/Languages/Python
|
||||
Url: https://pypi.python.org/pypi/docutils/
|
||||
Source: https://pypi.io/packages/source/d/docutils/docutils-%{version}.tar.gz
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
BuildRequires: python-xml
|
||||
Source99: python-docutils-rpmlintrc
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: %{python_module xml}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-xml
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Provides: docutils = %{version}
|
||||
Obsoletes: docutils < %{version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%else
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
Requires(post): update-alternatives
|
||||
Requires(preun): update-alternatives
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Docutils is a modular system for processing documentation into useful formats,
|
||||
@ -47,84 +48,51 @@ easy-to-read, what-you-see-is-what-you-get plaintext markup syntax.
|
||||
%prep
|
||||
%setup -n docutils-%{version}
|
||||
# Remove useless ".py" ending from executables:
|
||||
for i in tools/rst*; do mv "$i" "${i/.py}-%{py_ver}"; done
|
||||
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1-%{py_ver}'|" setup.py
|
||||
for i in tools/rst*; do mv "$i" "${i/.py}"; done
|
||||
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py
|
||||
# Remove shebang from non-executable files
|
||||
for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html'}; do
|
||||
for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html','math/tex2mathml_extern'}; do
|
||||
sed -i -e "1d" "docutils/utils/$i.py"
|
||||
done
|
||||
sed -i -e "1d" "docutils/writers/xetex/__init__.py"
|
||||
sed -i -e "1d" "docutils/writers/xetex/__init__.py" "docutils/writers/_html_base.py"
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
%python_install
|
||||
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
|
||||
|
||||
# Prepare for update-alternatives usage
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
binaries="rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html"
|
||||
for p in $binaries ; do
|
||||
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
|
||||
for p in rst2html rst2html5 rst2latex rst2man rst2odt rst2odt_prepstyles \
|
||||
rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html ; do
|
||||
%python_clone -a %{buildroot}%{_bindir}/$p
|
||||
done
|
||||
|
||||
%check
|
||||
nosetests
|
||||
%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"]))'
|
||||
|
||||
%post
|
||||
%_sbindir/update-alternatives \
|
||||
--install %{_bindir}/rst2html rst2html %{_bindir}/rst2html-%{py_ver} 20 \
|
||||
--slave %{_bindir}/rst2html5 rst2html5 %{_bindir}/rst2html5-%{py_ver} \
|
||||
--slave %{_bindir}/rst2latex rst2latex %{_bindir}/rst2latex-%{py_ver} \
|
||||
--slave %{_bindir}/rst2man rst2man %{_bindir}/rst2man-%{py_ver} \
|
||||
--slave %{_bindir}/rst2odt rst2odt %{_bindir}/rst2odt-%{py_ver} \
|
||||
--slave %{_bindir}/rst2odt_prepstyles rst2odt_prepstyles %{_bindir}/rst2odt_prepstyles-%{py_ver} \
|
||||
--slave %{_bindir}/rst2pseudoxml rst2pseudoxml %{_bindir}/rst2pseudoxml-%{py_ver} \
|
||||
--slave %{_bindir}/rst2s5 rst2s5 %{_bindir}/rst2s5-%{py_ver} \
|
||||
--slave %{_bindir}/rst2xetex rst2xetex %{_bindir}/rst2xetex-%{py_ver} \
|
||||
--slave %{_bindir}/rst2xml rst2xml %{_bindir}/rst2xml-%{py_ver} \
|
||||
--slave %{_bindir}/rstpep2html rstpep2html %{_bindir}/rstpep2html-%{py_ver}
|
||||
%{python_install_alternative rst2html rst2html5 rst2latex rst2man rst2odt rst2odt_prepstyles
|
||||
rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html}
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
%_sbindir/update-alternatives --remove rst2html %{_bindir}/rst2html-%{py_ver}
|
||||
fi
|
||||
%postun
|
||||
%python_uninstall_alternative rst2html
|
||||
|
||||
%files
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* licenses
|
||||
%{_bindir}/rst2html
|
||||
%{_bindir}/rst2latex
|
||||
%{_bindir}/rst2man
|
||||
%{_bindir}/rst2odt
|
||||
%{_bindir}/rst2odt_prepstyles
|
||||
%{_bindir}/rst2pseudoxml
|
||||
%{_bindir}/rst2s5
|
||||
%{_bindir}/rst2xetex
|
||||
%{_bindir}/rst2xml
|
||||
%{_bindir}/rstpep2html
|
||||
%{_bindir}/rst2html-%{py_ver}
|
||||
%{_bindir}/rst2html5-%{py_ver}
|
||||
%{_bindir}/rst2latex-%{py_ver}
|
||||
%{_bindir}/rst2man-%{py_ver}
|
||||
%{_bindir}/rst2odt-%{py_ver}
|
||||
%{_bindir}/rst2odt_prepstyles-%{py_ver}
|
||||
%{_bindir}/rst2pseudoxml-%{py_ver}
|
||||
%{_bindir}/rst2s5-%{py_ver}
|
||||
%{_bindir}/rst2xetex-%{py_ver}
|
||||
%{_bindir}/rst2xml-%{py_ver}
|
||||
%{_bindir}/rstpep2html-%{py_ver}
|
||||
%ghost %{_sysconfdir}/alternatives/rst2html
|
||||
%ghost %{_sysconfdir}/alternatives/rst2latex
|
||||
%ghost %{_sysconfdir}/alternatives/rst2man
|
||||
%ghost %{_sysconfdir}/alternatives/rst2odt
|
||||
%ghost %{_sysconfdir}/alternatives/rst2odt_prepstyles
|
||||
%ghost %{_sysconfdir}/alternatives/rst2pseudoxml
|
||||
%ghost %{_sysconfdir}/alternatives/rst2s5
|
||||
%ghost %{_sysconfdir}/alternatives/rst2xetex
|
||||
%ghost %{_sysconfdir}/alternatives/rst2xml
|
||||
%ghost %{_sysconfdir}/alternatives/rstpep2html
|
||||
%python_alternative %{_bindir}/rst2html
|
||||
%python_alternative %{_bindir}/rst2html5
|
||||
%python_alternative %{_bindir}/rst2latex
|
||||
%python_alternative %{_bindir}/rst2man
|
||||
%python_alternative %{_bindir}/rst2odt
|
||||
%python_alternative %{_bindir}/rst2odt_prepstyles
|
||||
%python_alternative %{_bindir}/rst2pseudoxml
|
||||
%python_alternative %{_bindir}/rst2s5
|
||||
%python_alternative %{_bindir}/rst2xetex
|
||||
%python_alternative %{_bindir}/rst2xml
|
||||
%python_alternative %{_bindir}/rstpep2html
|
||||
%{python_sitelib}/docutils/
|
||||
%{python_sitelib}/docutils-%{version}-py%{py_ver}.egg-info
|
||||
%{python_sitelib}/docutils-%{version}-py%{python_version}.egg-info
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user