From 5a2eb38c24c3ab924c3c204a0efed68af8e1e8ab Mon Sep 17 00:00:00 2001 From: Michel Salim Date: Mon, 1 Nov 2010 20:34:06 +0100 Subject: queue python-sphinx10 for review --- python/python-sphinx10.spec | 171 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 python/python-sphinx10.spec (limited to 'python/python-sphinx10.spec') diff --git a/python/python-sphinx10.spec b/python/python-sphinx10.spec new file mode 100644 index 0000000..f4337dc --- /dev/null +++ b/python/python-sphinx10.spec @@ -0,0 +1,171 @@ +%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 + +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} +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 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 - 1.0.4-1 +- Initial package, based on python-sphinx-1.0.4-2 -- cgit