a9aed37
%if 0%{?fedora}
28aca61
%global with_python3 0%{!?_without_python3:1}
9fef409
%endif
9fef409
e53fd83
%global srcname docutils
b9c4331
b9c4331
Name:           python-%{srcname}
0d75c73
Version:        0.13.1
ee1e878
Release:        4%{?dist}
d3e618d
Summary:        System for processing plaintext documentation
b9c4331
b9c4331
Group:          Development/Languages
cecfe5a
# See COPYING.txt for information
5d8b053
License:        Public Domain and BSD and Python and GPLv3+
b9c4331
URL:            http://docutils.sourceforge.net
Orion Poplawski fdfb76f
#Source0:        http://downloads.sourceforge.net/docutils/%{srcname}-%{version}.tar.gz
5d8b053
# Sometimes we need snapshots.  Instructions below:
Matej Stuchlik ae521c8
# svn co -r 7687 svn://svn.code.sf.net/p/docutils/code/trunk/docutils
8cb9a4d
# cd docutils
8cb9a4d
# python setup.py sdist
8cb9a4d
# The tarball is in dist/docutils-VERSION.tar.gz
Orion Poplawski fdfb76f
Source0:        %{srcname}-%{version}.tar.gz
7d581d9
c4aaf28
BuildArch:       noarch
b9c4331
3a1de6d
BuildRequires:  python2-devel
Orion Poplawski b031920
BuildRequires:  python-setuptools
9fef409
%if 0%{?with_python3}
9fef409
BuildRequires:  python3-devel
9fef409
BuildRequires:  python-tools
9fef409
%endif
1115cfe
909612b
%description
909612b
The Docutils project specifies a plaintext markup language, reStructuredText,
909612b
which is easy to read and quick to write.  The project includes a python
909612b
library to parse rST files and transform them into other useful formats such
909612b
as HTML, XML, and TeX as well as commandline tools that give the enduser
909612b
access to this functionality.
909612b
909612b
Currently, the library supports parsing rST that is in standalone files and
909612b
PEPs (Python Enhancement Proposals).  Work is underway to parse rST from
909612b
Python inline documentation modules and packages.
909612b
909612b
%package -n python2-%{srcname}
909612b
Summary:        System for processing plaintext documentation for python2
909612b
%{?python_provide:%python_provide python2-%{srcname}}
b9c4331
Provides: docutils = %{version}-%{release}
b9c4331
Obsoletes: docutils < %{version}-%{release}
b9c4331
909612b
%description -n python2-%{srcname}
b9c4331
The Docutils project specifies a plaintext markup language, reStructuredText,
b9c4331
which is easy to read and quick to write.  The project includes a python
b9c4331
library to parse rST files and transform them into other useful formats such
b9c4331
as HTML, XML, and TeX as well as commandline tools that give the enduser
b9c4331
access to this functionality.
b9c4331
b9c4331
Currently, the library supports parsing rST that is in standalone files and
b9c4331
PEPs (Python Enhancement Proposals).  Work is underway to parse rST from
b9c4331
Python inline documentation modules and packages.
b9c4331
9fef409
%if 0%{?with_python3}
9fef409
%package -n python3-%{srcname}
9fef409
Summary:        System for processing plaintext documentation for python3
Orion Poplawski b031920
%{?python_provide:%python_provide python3-%{srcname}}
9fef409
Group:          Development/Languages
9fef409
9fef409
%description -n python3-%{srcname}
9fef409
The Docutils project specifies a plaintext markup language, reStructuredText,
9fef409
which is easy to read and quick to write.  The project includes a python
9fef409
library to parse rST files and transform them into other useful formats such
9fef409
as HTML, XML, and TeX as well as commandline tools that give the enduser
9fef409
access to this functionality.
9fef409
9fef409
Currently, the library supports parsing rST that is in standalone files and
9fef409
PEPs (Python Enhancement Proposals).  Work is underway to parse rST from
9fef409
Python inline documentation modules and packages.
9fef409
9fef409
This package contains the module, ported to run under python3.
9fef409
%endif # with_python3
9fef409
b9c4331
%prep
b9c4331
%setup -q -n %{srcname}-%{version}
2d2a8c1
9fef409
# Remove shebang from library files
Matej Stuchlik ae521c8
for file in docutils/utils/{code_analyzer.py,punctuation_chars.py,error_reporting.py,smartquotes.py} docutils/utils/math/{latex2mathml.py,math2html.py} docutils/writers/xetex/__init__.py; do
9fef409
sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $file
9fef409
done
8cb9a4d
5d8b053
iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp
5d8b053
mv tmp tools/editors/emacs/IDEAS.rst
5d8b053
9fef409
%if 0%{?with_python3}
9fef409
rm -rf %{py3dir}
9fef409
cp -a . %{py3dir}
9fef409
%endif
0b34bb0
b9c4331
%build
Orion Poplawski b031920
%py2_build
b9c4331
9fef409
%if 0%{?with_python3}
9fef409
pushd %{py3dir}
Orion Poplawski b031920
%py3_build
9fef409
popd
9fef409
%endif # with_python3
9fef409
b9c4331
b9c4331
%install
9fef409
# Must do the python3 install first because the scripts in /usr/bin are
353ad9c
# overwritten by setup.py install (and we want the python2 version to be the
353ad9c
# default for now).
9fef409
%if 0%{?with_python3}
9fef409
pushd %{py3dir}
Orion Poplawski b031920
%py3_install
b1583ba
9fef409
# docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib.
9fef409
rm -rf %{buildroot}%{python3_sitelib}/test
b9c4331
0bc00b8
# Flash file is used for testing docutils but shouldn't be in the installed package.
0bc00b8
mv docs/user/rst/images/biohazard.swf ./biohazard.swf 
9fef409
popd
353ad9c
353ad9c
rm -rf %{buildroot}%{_bindir}/*
9fef409
%endif # with_python3
9fef409
Orion Poplawski b031920
%py2_install
b9c4331
9fef409
for file in %{buildroot}/%{_bindir}/*.py; do
9fef409
    mv $file `dirname $file`/`basename $file .py`
9fef409
done
9fef409
9fef409
# We want the licenses but don't need this build file
9fef409
rm -f licenses/docutils.conf
9fef409
0bc00b8
# Flash file is used for testing docutils but shouldn't be in the installed package.
0bc00b8
mv docs/user/rst/images/biohazard.swf ./biohazard.swf 
0bc00b8
9fef409
%check
0bc00b8
mv  biohazard.swf docs/user/rst/images/biohazard.swf
9fef409
python test/alltests.py
0bc00b8
rm docs/user/rst/images/biohazard.swf
9fef409
9fef409
%if 0%{?with_python3}
9fef409
pushd %{py3dir}
0bc00b8
mv  biohazard.swf docs/user/rst/images/biohazard.swf
e3712d3
python3 test3/alltests.py
0bc00b8
rm docs/user/rst/images/biohazard.swf
9fef409
popd
9fef409
%endif
9fef409
909612b
%files -n python2-%{srcname}
Orion Poplawski b031920
%license COPYING.txt licenses/*
0b34bb0
%doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt 
Orion Poplawski b031920
%doc THANKS.txt docs tools/editors
b9c4331
%{_bindir}/*
Orion Poplawski b031920
%{python2_sitelib}/*
9fef409
53adf25
%if 0%{?with_python3}
9fef409
%files -n python3-%{srcname}
Orion Poplawski b031920
%license COPYING.txt licenses/*
Orion Poplawski b031920
%doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt 
Orion Poplawski b031920
%doc THANKS.txt docs tools/editors
9fef409
%{python3_sitelib}/*
53adf25
%endif
b9c4331
b9c4331
%changelog
ee1e878
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-4
ee1e878
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ee1e878
Orion Poplawski b031920
* Mon Jan 30 2017 Orion Poplawski <orion@cora.nwra.com> - 0.13.1-3
Orion Poplawski b031920
- Fix broken python-docutils provides (bug #1399655)
Orion Poplawski b031920
- Use %%license, python build macro
Orion Poplawski b031920
- Spec cleanup
Orion Poplawski b031920
909612b
* Sun Jan 29 2017 Kevin Fenzi <kevin@scrye.com> - 0.13.1-2
909612b
- Rework packaging to make a python2 package and fix provides
909612b
0d75c73
* Tue Dec 27 2016 Kevin Fenzi <kevin@scrye.com> - 0.13.1-1
0d75c73
- Update to 0.13.1. Fixes bug #1403399
0d75c73
- Provide python2 version. Fixes bug #1399655
0d75c73
5c85656
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.12-0.8.20140510svn7747
5c85656
- Rebuild for Python 3.6
5c85656
- Fix failing tests
5c85656
- Remove runtime requirement for python-imaging
5c85656
fe33132
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-0.7.20140510svn7747
fe33132
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
fe33132
693ea55
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-0.6.20140510svn7747
693ea55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
693ea55
Robert Kuska cdfc475
* Tue Oct 13 2015 Robert Kuska <rkuska@redhat.com> - 0.12-0.5.20140510svn7747
Robert Kuska cdfc475
- Rebuilt for Python3.5 rebuild
Robert Kuska cdfc475
Robert Kuska 98407a3
* Wed Sep 23 2015 Robert Kuska <rkuska@redhat.com> - 0.12-0.3.20140510svn7747
Robert Kuska 98407a3
- Rebuilt for Python3.5 rebuild
Robert Kuska 98407a3
19160f9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-0.3.20140510svn7747
19160f9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
19160f9
719fe07
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-0.2.20140510svn7747
719fe07
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
719fe07
Orion Poplawski fdfb76f
* Sat May 10 2014 Orion Poplawski <orion@cora.nwra.com> - 0.12-0.1.20140510svn7747
Orion Poplawski fdfb76f
- Update to svn snapshot for Python 3.4 support
Orion Poplawski fdfb76f
- Drop unneeded patch
Orion Poplawski fdfb76f
Orion Poplawski 95af725
* Fri May  9 2014 Orion Poplawski <orion@cora.nwra.com> - 0.11-2
Orion Poplawski 95af725
- Rebuild for Python 3.4
Orion Poplawski 95af725
0bc00b8
* Thu Aug 15 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.11-1
0bc00b8
- 0.11 final tarball.
0bc00b8
- Remove flash file from the install (it was only used to run the unittests anyhow)
0bc00b8
a55c99f
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-0.2.20130715svn7687
a55c99f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a55c99f
Matej Stuchlik ae521c8
* Mon Jul 15 2013 Matej Stuchlik <mstuchli@redhat.com> - 0.11-0.1.20130715svn7687
Matej Stuchlik ae521c8
- Rebased to new snapshot
Matej Stuchlik ae521c8
- Removed unnecessary patches
Matej Stuchlik ae521c8
520ba82
* Thu Mar 21 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10-0.8.20120824svn7502
28aca61
- Add python3-imaging support :-)
28aca61
ef45b9c
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-0.7.20120824svn7502
a0f26c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a0f26c9
5cb86be
* Sat Aug 25 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10-0.6.20120824svn7502
5cb86be
- Further fix of places in the code that use__import__
5cb86be
2ebb1af
* Fri Aug 24 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10-0.5.20120824svn7502
2ebb1af
- Rebase to new snapshot with some fixes integrated
2ebb1af
- Reenable one test that I can't replicate the failure with.
2ebb1af
7d581d9
* Fri Aug 24 2012 David Malcolm <dmalcolm@redhat.com> - 0.10-0.4.20120730svn7490
7d581d9
- fix/disable failing tests with python 3.3
7d581d9
53adf25
* Tue Aug 14 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10-0.3.20120730svn7490
53adf25
- PyXML patch from upstream
53adf25
- Fix ability to disable python3 builds
53adf25
a9aed37
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 0.10-0.2.20120730svn7490
a9aed37
- remove rhel logic from with_python3 conditional
a9aed37
179e368
* Mon Jul 30 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10-0.1.20120730svn7490
179e368
- Update to snapshot that's supposed to take care of the date directive unicode
179e368
  problem in a different way
179e368
- Patch to fix PyXML conflict without using rpm conflicts
179e368
e3712d3
* Fri Jul 20 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.9.1-1
e3712d3
- New update from upstream
e3712d3
- Fixes for previous patches incorporated there
e3712d3
- roman.py has been moved into a docutils submodule
e3712d3
- docutils doesn't work with PyXML.  before I poke around for the bug in PyXML,
e3712d3
  seeing if we're going to go through with deprecating it or if we can sanitize
e3712d3
  our python stdlib's handling of it.
e3712d3
- Fix for traceback in https://bugzilla.redhat.com/show_bug.cgi?id=786867
e3712d3
2d2a8c1
* Mon Jan 30 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8.1-2
2d2a8c1
- Fix a unicode traceback https://bugzilla.redhat.com/show_bug.cgi?id=785622
2d2a8c1
18a18b8
* Thu Jan 5 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8.1-1
18a18b8
- Update to new upstream that has properly licensed files and a few bugfixes
18a18b8
- Add a patch to fix tracebacks when wrong values are given to CLI apps
18a18b8
d8c9e6f
* Wed Jul 20 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8-2
d8c9e6f
- Replace the Apache licensed files with BSD licensed versions from upstream
d8c9e6f
5d8b053
* Tue Jul 12 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8-1
5d8b053
- Upgrade to 0.8 final.
5d8b053
- Remove the two remaining Apache licensed files until their license is fixed.
5d8b053
- Patch regressions that we had already submitted upstream -- resubmit
5d8b053
8cb9a4d
* Tue May 17 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8-0.1.20110517svn7036
8cb9a4d
- Ship a snapshot of 0.8 so that we can build on python-3.2.1
8cb9a4d
- Unfortunately, 3.2.1 isn't out yet either.  So also apply a fix for building
8cb9a4d
  with 3.2.0 that we'll need to remove later.
5d8b053
- The new docutils.math module is licensed Apache.  Update the license to reflect this
8cb9a4d
23dfe03
* Wed Mar 16 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7-5
23dfe03
- Fix building with python-3.2 via a workaround.  Sent upstream awaiting
23dfe03
  feedback or a better fix.  Built in rawhide.
23dfe03
6142df8
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-4
6142df8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6142df8
353ad9c
* Sat Jan 1 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7-3
353ad9c
- Fix scripts so they're the python2 versions not the python3 versions
353ad9c
9fef409
* Thu Dec 30 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7-2
9fef409
- Build for python3
9fef409
3a1de6d
* Sun Aug 1 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7-1
3a1de6d
- Update for 0.7 release
3a1de6d
ecfbb75
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6-2
ecfbb75
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
ecfbb75
d3e618d
* Tue Jan 19 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6-1
d3e618d
- Update for 0.6 release.
d3e618d
- Switch from setuptools installed egg-info to distutils egg-info.  Note that
d3e618d
  this works because we're also changing docutils version.  To do this between
d3e618d
  0.5-4 and 0.5-5, for instance, we'd need to have %%preun scriptlet to get rid
d3e618d
  of the egg-info directory.
d3e618d
cef7bdc
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
cef7bdc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
cef7bdc
1e6ab04
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
1e6ab04
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
1e6ab04
1173455
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
1173455
- Rebuild for Python 2.6
1173455
a70e4b1
* Wed Aug 6 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.5-1
a70e4b1
- New upstream version.
a70e4b1
b9ead06
* Mon Mar 3 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4-8
b9ead06
- Use regular Requires syntax for python-imaging as missingok is just wrong.
b9ead06
1115cfe
* Thu Sep 27 2007 Toshio Kuratomi <a.badger@gmail.com> 0.4-7
1115cfe
- Build egg info.
1115cfe
fcf6f21
* Mon Aug 13 2007 Toshio Kuratomi <a.badger@gmail.com> 0.4-6
fcf6f21
- Last version had both the old and new rst.el.  Try again with only
fcf6f21
  the new one.
fcf6f21
cecfe5a
* Sun Aug 12 2007 Toshio Kuratomi <a.badger@gmail.com> 0.4-5
cecfe5a
- Make License tag conform to the new Licensing Policy.
cecfe5a
- Fix the rst emacs mode (RH BZ 250100)
cecfe5a
c4aaf28
* Sat Dec 09 2006 Toshio Kuratomi <toshio-tiki-lounge.com> 0.4-4
c4aaf28
- Bump and rebuild for python 2.5 in devel.
c4aaf28
b1583ba
* Tue Aug 29 2006 Toshio Kuratomi <toshio-tiki-lounge.com> 0.4-3
b1583ba
- Bump for FC6 rebuild.
b1583ba
- Remove python byte compilation as this is handled automatically in FC4+.
b1583ba
- No longer %%ghost .pyo files.
b1583ba
  
2b753c5
* Thu Feb 16 2006 Toshio Kuratomi <toshio-tiki-lounge.com> 0.4-2
2b753c5
- Bump and rebuild for FC5.
2b753c5
  
0b34bb0
* Sun Jan 15 2006 Toshio Kuratomi <toshio-tiki-lounge.com> 0.4-1
0b34bb0
- Update to 0.4.
0b34bb0
- Scripted the listing of files in the python module.
0b34bb0
- Add a missingok requirement on python-imaging as docutils can make use of
0b34bb0
  it when converting to formats that have images.
0b34bb0
  
1aa841f
* Tue Jun 7 2005 Toshio Kuratomi <toshio-tiki-lounge.com> 0.3.9-1
1aa841f
- Update to version 0.3.9.
1aa841f
- Use a dist tag as there aren't any differences between supported fc
1aa841f
  releases (FC3, FC4, devel.)
1aa841f
7801948
* Thu May 12 2005 Toshio Kuratomi <toshio-tiki-lounge.com> 0.3.7-7
7801948
- Bump version and rebuild to sync across architectures.
7801948
525e2a8
* Sun Mar 20 2005 Toshio Kuratomi <toshio-tiki-lounge.com> 0.3.7-6
525e2a8
- Rebuild for FC4t1
525e2a8
b9c4331
* Sat Mar 12 2005 Toshio Kuratomi <toshio.tiki-lounge.com> 0.3.7-5
b9c4331
- Add GPL as a license (mschwendt)
b9c4331
- Use versioned Obsoletes and Provides (mschwendt)
b9c4331
b9c4331
* Fri Mar 04 2005 Toshio Kuratomi <toshio.tiki-lounge.com> 0:0.3.7-4
b9c4331
- Rename to python-docutils per the new packaging guidelines.
b9c4331
b9c4331
* Wed Jan 12 2005 Toshio Kuratomi <toshio.tiki-lounge.com> 0:0.3.7-0.fdr.3
b9c4331
- Really install roman.py and build roman.py[co].  Needed to make sure I have
b9c4331
  docutils installed to test that it builds roman.py fine in that case.
b9c4331
b9c4331
* Tue Jan 11 2005 Toshio Kuratomi <toshio.tiki-lounge.com> 0:0.3.7-0.fdr.2
b9c4331
- Special case roman.py to always install.  This is the behaviour we want
b9c4331
  unless something else provides it.  Will need to watch out for this in
b9c4331
  future Core and Extras packages, but the auto detection code makes it
b9c4331
  possible that builds will not be reproducible if roman.py were installed
b9c4331
  from another package.... Lesser of two evils here.
b9c4331
- Provide python-docutils in case that package were preinstalled from
b9c4331
  another repository.
b9c4331
  
b9c4331
* Fri Dec 31 2004 Toshio Kuratomi <toshio.tiki-lounge.com> 0:0.3.7-0.fdr.1
b9c4331
- Update to 0.3.7
b9c4331
- Rename from python-docutils to docutils.
b9c4331
- Make roman.py optionally a part of the files list.  In FC2, this will be
b9c4331
  included.  In FC3, this won't.
b9c4331
- BuildConflict with self since the docutils build detects the presence
b9c4331
  of roman.py and doesn't reinstall itself.
b9c4331
  
b9c4331
* Mon Aug 9 2004 Toshio Kuratomi <toshio.tiki-lounge.com> 0:0.3.5-0.fdr.1
b9c4331
- Update to 0.3.5.
b9c4331
- Update spec style to latest fedora-rpmdevtools.
b9c4331
- Merge everything into a single package.  There isn't very much space
b9c4331
  advantage to having separate packages in a package this small and in
b9c4331
  this case, the documentation on using docutils as a library is also a
b9c4331
  good example of how to write in ReSructuredText.
b9c4331
b9c4331
* Sat Jan 10 2004 Michel Alexandre Salim <salimma[AT]users.sf.net> 0:0.3-0.fdr.1
b9c4331
- Initial RPM release.