1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
%global upstream_name Sphinx
Name: python-sphinx10
Version: 1.0.4
Release: 1%{?dist}
Summary: Python documentation generator
Group: Development/Tools
# Unless otherwise noted, the license for code is BSD
# sphinx/util/stemmer.py Public Domain
# sphinx/pycode/pgen2 Python
# jquery (MIT or GPLv2)
License: BSD and Public Domain and Python and (MIT or GPLv2)
URL: http://sphinx.pocoo.org/
Source0: http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
Source1: README.Fedora
BuildArch: noarch
BuildRequires: python2-devel >= 2.4
BuildRequires: python-setuptools
BuildRequires: python-docutils
BuildRequires: python-jinja2
BuildRequires: python-nose
Requires: python-docutils
Requires: python-jinja2
Requires: python-pygments
# Require setuptools as the consumer will need pkg_resources to use this module
Requires: python-setuptools
%description
Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.
Although it is still under constant development, the following
features are already present, work fine and can be seen "in action" in
the Python docs:
* Output formats: HTML (including Windows HTML Help) and LaTeX,
for printable PDF versions
* Extensive cross-references: semantic markup and automatic links
for functions, classes, glossary terms and similar pieces of
information
* Hierarchical structure: easy definition of a document tree, with
automatic links to siblings, parents and children
* Automatic indices: general index as well as a module index
* Code handling: automatic highlighting using the Pygments highlighter
* Various extensions are available, e.g. for automatic testing of
snippets and inclusion of appropriately formatted docstrings.
%package doc
Summary: Documentation for %{name}
Group: Documentation
License: BSD
Requires: %{name} = %{version}-%{release}
%description doc
Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
This package contains documentation in reST and HTML formats.
%prep
%setup -q -n %{upstream_name}-%{version}%{?prerel}
cp -p %{SOURCE1} .
sed '1d' -i sphinx/pycode/pgen2/token.py
%build
%{__python} setup.py bdist_egg
pushd doc
make html
make man
rm -rf _build/html/.buildinfo
mv _build/html ..
popd
%install
rm -rf %{buildroot}
easy_install -m --prefix %{buildroot}%{_usr} dist/*.egg
# permission fix
find %{buildroot}%{python_sitelib}/Sphinx-%{version}-py*.egg -name '*.py*' \
-exec chmod -x {} \;
# rename binaries for parallel-installability
pushd %{buildroot}%{_bindir}
for b in sphinx-*; do
mv $b `echo $b | sed -e "s|^sphinx-|sphinx-1.0-|g"`
done
popd
pushd doc/_build/man
# Deliver man pages
install -d %{buildroot}%{_mandir}/man1
for manpage in sphinx-*.1; do
mv $manpage %{buildroot}%{_mandir}/man1/`echo $manpage | sed -e "s|^sphinx-|sphinx-1.0-|g"`
done
popd
# Deliver rst files
rm -rf doc/_build
sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-1.0-build|' doc/Makefile
mv doc reST
%find_lang sphinx
# Language files; Since these are javascript, it's not immediately obvious to
# find_lang that they need to be marked with a language.
(cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
>> sphinx.lang
%check
make test
%files -f sphinx.lang
%defattr(-,root,root,-)
%doc AUTHORS CHANGES EXAMPLES LICENSE README README.Fedora TODO
%{_bindir}/sphinx-*
%dir %{python_sitelib}/Sphinx-%{version}-py*.egg
%{python_sitelib}/Sphinx-%{version}-py*.egg/EGG-INFO
%dir %{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/*.py*
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/builders
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/directives
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/domains
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/ext
%dir %{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/locale
# this includes locale/__init.py*; looks like %%dir just means
# not recursing
%dir %{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/locale/*
%dir %{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/locale/*/LC_MESSAGES
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/locale/*/LC_MESSAGES/*.po
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/pycode
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/texinputs
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/themes
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/util
%{python_sitelib}/Sphinx-%{version}-py*.egg/sphinx/writers
%{_mandir}/man1/*
%files doc
%defattr(-,root,root,-)
%doc html reST
%changelog
* Mon Nov 1 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-1
- Initial package, based on python-sphinx-1.0.4-2
|