2011-09-21 12:04:49 +02:00
|
|
|
#
|
2011-09-23 12:27:18 +02:00
|
|
|
# spec file for package python-docutils
|
2011-09-21 12:04:49 +02:00
|
|
|
#
|
2014-07-15 12:47:40 +02:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-09-21 12:04:49 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2012-04-24 11:02:56 +02:00
|
|
|
|
2011-09-21 12:04:49 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-10-29 16:35:43 +01:00
|
|
|
|
2012-11-20 20:35:54 +01:00
|
|
|
Name: python-docutils
|
2014-07-15 12:47:40 +02:00
|
|
|
Version: 0.12
|
2011-09-21 12:04:49 +02:00
|
|
|
Release: 0
|
2012-02-28 09:59:33 +01:00
|
|
|
Summary: Python Documentation Utilities
|
2012-04-30 16:30:08 +02:00
|
|
|
License: Python-2.0 and BSD-2-Clause and GPL-2.0+ and GPL-3.0+ and SUSE-Public-Domain
|
2011-09-21 12:04:49 +02:00
|
|
|
Group: Development/Languages/Python
|
2013-09-24 12:54:44 +02:00
|
|
|
Url: https://pypi.python.org/pypi/docutils/
|
|
|
|
Source: https://pypi.python.org/packages/source/d/docutils/docutils-%{version}.tar.gz
|
2011-09-21 12:04:49 +02:00
|
|
|
BuildRequires: python-devel
|
2012-11-20 20:35:54 +01:00
|
|
|
BuildRequires: python-nose
|
2011-09-21 12:04:49 +02:00
|
|
|
BuildRequires: python-xml
|
|
|
|
Requires: python-xml
|
|
|
|
Provides: docutils = %{version}
|
|
|
|
Obsoletes: docutils < %{version}
|
2012-11-20 20:35:54 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-02-28 09:59:33 +01:00
|
|
|
%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
|
2013-09-17 13:59:09 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Docutils is a modular system for processing documentation into useful formats,
|
|
|
|
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.
|
|
|
|
|
|
|
|
%prep
|
2012-11-20 20:35:54 +01:00
|
|
|
%setup -n docutils-%{version}
|
|
|
|
# Remove useless ".py" ending from executables:
|
2013-09-17 13:59:09 +02:00
|
|
|
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
|
2013-09-24 12:54:44 +02:00
|
|
|
# Remove shebang from non-executable files
|
|
|
|
for i in {'code_analyzer','error_reporting','punctuation_chars','smartquotes','math/latex2mathml','math/math2html'}; do
|
|
|
|
sed -i -e "1d" "docutils/utils/$i.py"
|
|
|
|
done
|
|
|
|
sed -i -e "1d" "docutils/writers/xetex/__init__.py"
|
|
|
|
|
2011-09-21 12:04:49 +02:00
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
2013-09-17 13:59:09 +02:00
|
|
|
binaries="rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html"
|
|
|
|
for i in $binaries; do
|
|
|
|
ln -s %{_bindir}/${i}-%{py_ver} %{buildroot}%{_bindir}/${i}
|
|
|
|
done
|
2012-11-20 20:35:54 +01:00
|
|
|
|
|
|
|
%check
|
|
|
|
nosetests
|
2011-09-21 12:04:49 +02:00
|
|
|
|
2013-09-17 13:59:09 +02:00
|
|
|
%pre
|
|
|
|
# Since binaries became ghosted to be used with update-alternatives,
|
|
|
|
# we have to get rid of the old binary resulting from the
|
|
|
|
# non-update-alternativies-ified package.
|
|
|
|
binaries="rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html"
|
|
|
|
for i in $binaries; do
|
|
|
|
[[ ! -L %{_bindir}/${i} ]] && rm -f %{_bindir}/${i}
|
|
|
|
done
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%post
|
|
|
|
update-alternatives \
|
|
|
|
--install %{_bindir}/rst2html rst2html %{_bindir}/rst2html-%{py_ver} 20 \
|
|
|
|
--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}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
update-alternatives --remove rst2html %{_bindir}/rst2html-%{py_ver}
|
|
|
|
fi
|
|
|
|
|
2011-09-21 12:04:49 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc COPYING.txt FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/* licenses
|
2013-09-17 13:59:09 +02:00
|
|
|
%ghost %{_bindir}/rst2html
|
|
|
|
%ghost %{_bindir}/rst2latex
|
|
|
|
%ghost %{_bindir}/rst2man
|
|
|
|
%ghost %{_bindir}/rst2odt
|
|
|
|
%ghost %{_bindir}/rst2odt_prepstyles
|
|
|
|
%ghost %{_bindir}/rst2pseudoxml
|
|
|
|
%ghost %{_bindir}/rst2s5
|
|
|
|
%ghost %{_bindir}/rst2xetex
|
|
|
|
%ghost %{_bindir}/rst2xml
|
|
|
|
%ghost %{_bindir}/rstpep2html
|
|
|
|
%{_bindir}/rst*-%{py_ver}
|
2012-11-20 20:35:54 +01:00
|
|
|
%{python_sitelib}/docutils/
|
|
|
|
%{python_sitelib}/docutils-%{version}-py%{py_ver}.egg-info
|
2011-09-21 12:04:49 +02:00
|
|
|
|
|
|
|
%changelog
|