1 |
%define srcname docutils |
2 |
%define enable_tests 0 |
3 |
|
4 |
Name: python-%{srcname} |
5 |
Summary: Python Documentation Utilities |
6 |
Version: 0.15.2 |
7 |
Release: %mkrel 2 |
8 |
URL: http://docutils.sourceforge.net/ |
9 |
License: Public Domain and BSD and Python and GPLv3+ |
10 |
Group: Development/Python |
11 |
# Sometimes we need snapshots. Instructions below: |
12 |
# svn co -r 7747 https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils |
13 |
# cd docutils |
14 |
# python setup.py sdist |
15 |
# The tarball is in dist/docutils-VERSION.tar.gz |
16 |
#Source0: %%{srcname}-%%{version}.tar.gz |
17 |
Source0: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz |
18 |
BuildArch: noarch |
19 |
BuildRequires: emacs |
20 |
|
21 |
%description |
22 |
The Docutils project specifies a plaintext markup language, reStructuredText, |
23 |
which is easy to read and quick to write. The project includes a python |
24 |
library to parse rST files and transform them into other useful formats such |
25 |
as HTML, XML, and TeX as well as commandline tools that give the enduser |
26 |
access to this functionality. |
27 |
|
28 |
Currently, the library supports parsing rST that is in standalone files and |
29 |
PEPs (Python Enhancement Proposals). Work is underway to parse rST from |
30 |
Python inline documentation modules and packages. |
31 |
|
32 |
%package -n python3-%{srcname} |
33 |
Summary: System for processing plaintext documentation for python |
34 |
Group: Development/Python |
35 |
BuildRequires: pkgconfig(python3) |
36 |
BuildRequires: python3dist(setuptools) |
37 |
Recommends: python3dist(pillow) |
38 |
%{?python_provide:%python_provide python3-%{srcname}} |
39 |
Conflicts: python2-docutils < 0.14-3 |
40 |
Provides: rst2html = %{version}-%{release} |
41 |
Provides: rst2man = %{version}-%{release} |
42 |
|
43 |
%description -n python3-%{srcname} |
44 |
The Docutils project specifies a plaintext markup language, reStructuredText, |
45 |
which is easy to read and quick to write. The project includes a python |
46 |
library to parse rST files and transform them into other useful formats such |
47 |
as HTML, XML, and TeX as well as commandline tools that give the enduser |
48 |
access to this functionality. |
49 |
|
50 |
Currently, the library supports parsing rST that is in standalone files and |
51 |
PEPs (Python Enhancement Proposals). Work is underway to parse rST from |
52 |
Python inline documentation modules and packages. |
53 |
|
54 |
%prep |
55 |
%setup -q -n %{srcname}-%{version} |
56 |
|
57 |
# drop bundled egg-info |
58 |
rm -rf docutils.egg-info/ |
59 |
|
60 |
# Remove shebang from library files |
61 |
for file in docutils/utils/{code_analyzer.py,punctuation_chars.py,error_reporting.py} docutils/utils/math/{latex2mathml.py,math2html.py} docutils/writers/xetex/__init__.py; do |
62 |
sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $file |
63 |
done |
64 |
|
65 |
iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp |
66 |
mv tmp tools/editors/emacs/IDEAS.rst |
67 |
|
68 |
%build |
69 |
%py3_build |
70 |
|
71 |
%install |
72 |
%py3_install |
73 |
|
74 |
# docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib. |
75 |
rm -rf %{buildroot}%{python3_sitelib}/test |
76 |
|
77 |
for file in %{buildroot}%_bindir/*.py; do |
78 |
mv $file %{buildroot}%_bindir/`basename $file .py` |
79 |
done |
80 |
|
81 |
# We want the licenses but don't need this build file |
82 |
rm -f licenses/docutils.conf |
83 |
|
84 |
# Make emacs mode available: |
85 |
emacs -batch -f batch-byte-compile tools/editors/emacs/rst.el |
86 |
%__install -d -m 755 %{buildroot}%{_datadir}/emacs/site-lisp |
87 |
%__install -D -m 644 tools/editors/emacs/rst.el* %{buildroot}%{_datadir}/emacs/site-lisp |
88 |
%__rm -rf tools/editors/emacs |
89 |
|
90 |
cat > ./rst.el << EOF |
91 |
(autoload 'rst-mode "rst" "reStructuredText mode" t) |
92 |
(add-to-list 'auto-mode-alist '("\\.rst$" . rst-mode)) |
93 |
EOF |
94 |
emacs -batch -f batch-byte-compile rst.el |
95 |
%__install -d -m 755 %{buildroot}%{_sysconfdir}/emacs/site-start.d |
96 |
%__install -m 644 rst.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d/ |
97 |
|
98 |
%check |
99 |
%if %enable_tests |
100 |
%{__python3} test3/alltests.py |
101 |
rm docs/user/rst/images/biohazard.swf |
102 |
%endif |
103 |
|
104 |
%files -n python3-%{srcname} |
105 |
%doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt |
106 |
%doc THANKS.txt licenses docs tools/editors |
107 |
%{python3_sitelib}/* |
108 |
%{_bindir}/rst2html |
109 |
%{_bindir}/rst2html4 |
110 |
%{_bindir}/rst2html5 |
111 |
%{_bindir}/rst2latex |
112 |
%{_bindir}/rst2man |
113 |
%{_bindir}/rst2odt |
114 |
%{_bindir}/rst2odt_prepstyles |
115 |
%{_bindir}/rst2pseudoxml |
116 |
%{_bindir}/rst2s5 |
117 |
%{_bindir}/rst2xetex |
118 |
%{_bindir}/rst2xml |
119 |
%{_bindir}/rstpep2html |
120 |
%_datadir/emacs/site-lisp/* |
121 |
%_sysconfdir/emacs/site-start.d/* |