Blame SPECS/python-sphinx.spec

56bdea
%{?scl:%scl_package python-sphinx}
56bdea
%{!?scl:%global pkg_name %{name}}
56bdea
56bdea
%global upstream_name Sphinx
56bdea
%global enable_test 1
56bdea
56bdea
Name:       %{?scl_prefix}python-sphinx
56bdea
Version:    1.2.2
56bdea
Release:    1%{?dist}
56bdea
Summary:    Python documentation generator
56bdea
56bdea
Group:      Development/Tools
56bdea
BuildRoot:  %{_tmppath}/%{pkg_name}-%{version}-%{release}-root-%(%{__id_u} -n)
56bdea
56bdea
# Unless otherwise noted, the license for code is BSD
56bdea
# sphinx/util/stemmer.py Public Domain
56bdea
# sphinx/pycode/pgen2 Python
56bdea
# jquery (MIT or GPLv2)
56bdea
License:    BSD and Public Domain and Python and (MIT or GPLv2)
56bdea
URL:        http://sphinx.pocoo.org/
56bdea
Source0:    http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
56bdea
Patch0:     Sphinx-1.2.1-mantarget.patch
56bdea
56bdea
BuildArch:     noarch
56bdea
BuildRequires: %{?scl_prefix}python-devel
56bdea
BuildRequires: %{?scl_prefix}python-setuptools
56bdea
BuildRequires: %{?scl_prefix}python-docutils
56bdea
BuildRequires: %{?scl_prefix}python-jinja2
56bdea
BuildRequires: %{?scl_prefix}python-nose
56bdea
BuildRequires: %{?scl_prefix}python-pygments
56bdea
%if 0%{?enable_test}
56bdea
# Test dependencies - not available on RHEL 5
56bdea
BuildRequires: texlive-latex
56bdea
%endif
56bdea
56bdea
Requires:      %{?scl_prefix}python-docutils
56bdea
Requires:      %{?scl_prefix}python-jinja2
56bdea
Requires:      %{?scl_prefix}python-pygments
56bdea
# latex builder
56bdea
Requires:      texlive-framed                                                                       
56bdea
Requires:      texlive-threeparttable                                                               
56bdea
Requires:      texlive-titlesec                                                                     
56bdea
Requires:      texlive-wrapfig   
56bdea
56bdea
%description
56bdea
Sphinx is a tool that makes it easy to create intelligent and
56bdea
beautiful documentation for Python projects (or other documents
56bdea
consisting of multiple reStructuredText sources), written by Georg
56bdea
Brandl. It was originally created to translate the new Python
56bdea
documentation, but has now been cleaned up in the hope that it will be
56bdea
useful to many other projects.
56bdea
56bdea
Sphinx uses reStructuredText as its markup language, and many of its
56bdea
strengths come from the power and straightforwardness of
56bdea
reStructuredText and its parsing and translating suite, the Docutils.
56bdea
56bdea
Although it is still under constant development, the following
56bdea
features are already present, work fine and can be seen "in action" in
56bdea
the Python docs:
56bdea
56bdea
    * Output formats: HTML (including Windows HTML Help) and LaTeX,
56bdea
      for printable PDF versions
56bdea
    * Extensive cross-references: semantic markup and automatic links
56bdea
      for functions, classes, glossary terms and similar pieces of
56bdea
      information
56bdea
    * Hierarchical structure: easy definition of a document tree, with
56bdea
      automatic links to siblings, parents and children
56bdea
    * Automatic indices: general index as well as a module index
56bdea
    * Code handling: automatic highlighting using the Pygments highlighter
56bdea
    * Various extensions are available, e.g. for automatic testing of
56bdea
      snippets and inclusion of appropriately formatted docstrings.
56bdea
56bdea
56bdea
%package doc
56bdea
Summary:    Documentation for %{pkg_name}
56bdea
Group:      Documentation
56bdea
License:    BSD
56bdea
Requires:   %{?scl_prefix}%{pkg_name} = %{version}-%{release}
56bdea
56bdea
56bdea
%description doc
56bdea
Sphinx is a tool that makes it easy to create intelligent and
56bdea
beautiful documentation for Python projects (or other documents
56bdea
consisting of multiple reStructuredText sources), written by Georg
56bdea
Brandl. It was originally created to translate the new Python
56bdea
documentation, but has now been cleaned up in the hope that it will be
56bdea
useful to many other projects.
56bdea
56bdea
This package contains documentation in reST and HTML formats.
56bdea
56bdea
56bdea
%prep
56bdea
%setup -q -n %{upstream_name}-%{version}%{?prerel}
56bdea
sed '1d' -i sphinx/pycode/pgen2/token.py
56bdea
56bdea
%patch0 -p1
56bdea
56bdea
%build
56bdea
%{?scl:scl enable %{scl} "}
56bdea
%{__python3} setup.py build
56bdea
%{?scl:"}
56bdea
56bdea
# move the Python2 installation out of the way, so that it's not loaded by Python 3
56bdea
mv sphinx spinx-go-here
56bdea
56bdea
pushd doc
56bdea
%{?scl:scl enable %{scl} - << \EOF}
56bdea
export PYTHONPATH=$(pwd)/../build/lib
56bdea
make html
56bdea
make man
56bdea
%{?scl:EOF}
56bdea
rm -rf _build/html/.buildinfo
56bdea
mv _build/html ..
56bdea
popd
56bdea
56bdea
mv spinx-go-here sphinx
56bdea
56bdea
%install
56bdea
rm -rf %{buildroot}
56bdea
56bdea
%{?scl:scl enable %{scl} "}
56bdea
%{__python3} setup.py install --skip-build --root %{buildroot}
56bdea
%{?scl:"}
56bdea
56bdea
pushd doc
56bdea
# Deliver man pages
56bdea
install -d %{buildroot}%{_mandir}/man1
56bdea
mv _build/man/sphinx-*.1 %{buildroot}%{_mandir}/man1/
56bdea
popd
56bdea
56bdea
# Deliver rst files
56bdea
rm -rf doc/_build
56bdea
sed -i 's|python ../sphinx-build.py|%{_bindir}/sphinx-build|' doc/Makefile
56bdea
mv doc reST
56bdea
56bdea
# Move language files to /usr/share;
56bdea
# patch to support this incorporated in 0.6.6
56bdea
pushd %{buildroot}%{python3_sitelib}
56bdea
56bdea
for lang in `find sphinx/locale ! \( -name __pycache__ \) -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -printf "%f "`;
56bdea
do
56bdea
  install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
56bdea
  install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
56bdea
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
56bdea
     %{buildroot}%{_datadir}/sphinx/locale/$lang/
56bdea
  mv sphinx/locale/$lang/LC_MESSAGES/sphinx.mo \
56bdea
    %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
56bdea
  rm -rf sphinx/locale/$lang
56bdea
done
56bdea
popd
56bdea
%find_lang sphinx
56bdea
56bdea
# Language files; Since these are javascript, it's not immediately obvious to
56bdea
# find_lang that they need to be marked with a language.
56bdea
(cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
56bdea
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
56bdea
  >> sphinx.lang
56bdea
56bdea
%clean
56bdea
rm -rf %{buildroot}
56bdea
56bdea
%check
56bdea
%if 0%{?enable_test}
56bdea
%{?scl:scl enable %{scl} - << \EOF}
56bdea
# we need to export LC_TYPE because of TPS tests, see rhbz#971422
56bdea
export LC_CTYPE="en_US.utf8"
56bdea
make test
56bdea
%{?scl:EOF}
56bdea
%endif
56bdea
56bdea
%files -f sphinx.lang
56bdea
%defattr(-,root,root,-)
56bdea
%doc AUTHORS CHANGES EXAMPLES LICENSE README.rst TODO
56bdea
%{_bindir}/sphinx-*
56bdea
%{python3_sitelib}/*
56bdea
%dir %{_datadir}/sphinx/
56bdea
%dir %{_datadir}/sphinx/locale
56bdea
%dir %{_datadir}/sphinx/locale/*
56bdea
%{_mandir}/man1/*
56bdea
56bdea
%files doc
56bdea
%defattr(-,root,root,-)
56bdea
%doc html reST
56bdea
56bdea
%changelog
56bdea
* Wed Jan 21 2015 Matej Stuchlik <mstuchli@redhat.com> - 1.2.2-1
56bdea
- Update to 1.2.2
56bdea
56bdea
* Mon Jul 15 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.3-8
56bdea
- Fix TPS rebuild failure as reported in rhbz#971422.
56bdea
56bdea
* Thu May 09 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.3-7
56bdea
- Rebuild to generate bytecode properly after fixing rhbz#956289
56bdea
56bdea
* Wed Jan 09 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.3-6
56bdea
- Rebuilt for SCL.
56bdea
56bdea
* Tue Aug 21 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.3-5
56bdea
- Fix for use of sphinx's manpage writer with docutils-0.10
56bdea
56bdea
* Mon Aug  6 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.3-4
56bdea
- Rebuild for Python 3.3
56bdea
56bdea
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 1.1.3-3
56bdea
- remove rhel logic from with_python3 conditional
56bdea
56bdea
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-2
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
56bdea
56bdea
* Thu Apr  5 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.3-1
56bdea
- Update to 1.1.3
56bdea
56bdea
* Sun Feb  5 2012 Michel Salim <salimma@fedoraproject.org> - 1.1.2-5
56bdea
- Move python3 runtime dependencies to the right subpackage
56bdea
- Properly exclude python3 binaries
56bdea
56bdea
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-4
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
56bdea
56bdea
* Sat Dec 17 2011 Michel Salim <salimma@fedoraproject.org> - 1.1.2-3
56bdea
- BR on texlive-latex for LaTeX tests
56bdea
56bdea
* Thu Dec  8 2011 Michel Salim <salimma@fedoraproject.org> - 1.1.2-2
56bdea
- Enable python3 subpackage
56bdea
56bdea
* Mon Nov 28 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.2-1
56bdea
- Update to upstream 1.1.2
56bdea
56bdea
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-2
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
56bdea
56bdea
* Tue Jan 18 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0.7-1
56bdea
- Update to upstream 1.0.7
56bdea
56bdea
* Mon Jan 17 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0.6-1
56bdea
- Update to upstream 1.0.6
56bdea
56bdea
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-3
56bdea
- Fix -doc Makefile to allow regeneration of .rst files
56bdea
56bdea
* Mon Nov  1 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-2
56bdea
- Actually include *.js locale files
56bdea
- Generate manpages
56bdea
56bdea
* Fri Sep 17 2010 Michel Salim <salimma@fedoraproject.org> - 1.0.4-1
56bdea
- Update to 1.0.4
56bdea
- Remove BuildRoot and %%clean declarations
56bdea
56bdea
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.0-0.1.b2.1
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
56bdea
56bdea
* Mon May 31 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.2.b2
56bdea
- Update to 1.0 beta 2
56bdea
- Fixes problem building html documentation in non-English locales
56bdea
56bdea
* Wed May 26 2010 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.b1
56bdea
- Update to 1.0 beta 1
56bdea
56bdea
* Tue May 25 2010 Michel Salim <salimma@fedoraproject.org> - 0.6.6-1
56bdea
- Update to 0.6.6
56bdea
56bdea
* Fri May 21 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.5-2
56bdea
- Few minor tweaks to Gareth's spec file update
56bdea
56bdea
* Mon May 10 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 0.6.5-1.hp
56bdea
- Update to 0.6.5
56bdea
- Initial import of python-sphinx from Fedora Rawhide for use in HP CMS
56bdea
- Enforce that Sphinx requires Python 2.4 or later via an explicit BR
56bdea
- Minor tweaks to spec file
56bdea
- Move language files to %%{_datadir}, idea borrowed from Debian's sphinx
56bdea
  package
56bdea
- Deliver man pages for sphinx-build & sphinx-quickstart
56bdea
- Deliver rst documentation files to reST directory in doc sub-package
56bdea
- Add %%check section for Python2 and add BR on python-nose
56bdea
56bdea
* Wed Jan 13 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
56bdea
- Update to 0.6.4
56bdea
- Fixes a problem using autodoc with pylons projects.
56bdea
56bdea
* Fri Sep  4 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.3-1
56bdea
- Update to 0.6.3
56bdea
56bdea
* Mon Aug 17 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.2-1
56bdea
- Update to 0.6.2 -- upstream bugfix requested inside bz#512438
56bdea
56bdea
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
56bdea
56bdea
* Fri Jun 05 2009 Luke Macken <lmacken@redhat.com> - 0.6.1-2
56bdea
- Add a patch to use our own setuptools package
56bdea
56bdea
* Fri Apr 17 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1-1
56bdea
- Update to 0.6.1
56bdea
56bdea
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
56bdea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
56bdea
56bdea
* Fri Jan  2 2009 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
56bdea
- Update to 0.5.1
56bdea
56bdea
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
56bdea
- Rebuild for Python 2.6
56bdea
56bdea
* Mon Nov 24 2008 Michel Salim <salimma@fedoraproject.org> - 0.5-1
56bdea
- Update to 0.5
56bdea
56bdea
* Fri Oct 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.3-1
56bdea
- Update to 0.4.3
56bdea
56bdea
* Wed Aug 27 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1.1
56bdea
- Fix for EL-5 build.
56bdea
56bdea
* Mon Aug 25 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.2-1
56bdea
- Update to 0.4.2
56bdea
56bdea
* Mon May 26 2008 Michel Salim <salimma@fedoraproject.org> - 0.3-1
56bdea
- Update to 0.3
56bdea
56bdea
* Fri May  2 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.61950-3
56bdea
- Split documentation into subpackage
56bdea
- Exclude C files (not built by default anyway)
56bdea
56bdea
* Wed Apr 16 2008 José Matos <jamatos@fc.up.pt> - 0.1.61950-2
56bdea
- Build html documentation, include it and include the rst
56bdea
  documentation.
56bdea
56bdea
* Thu Mar 27 2008 Michel Salim <michel.sylvan@gmail.com> 0.1.61950-1
56bdea
- Initial package