%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")

Summary: Automatic API documentation generation tool for Python
Summary(ja): Python 用の自動 API ドキュメント生成ツール
Name: epydoc
Version: 3.0.1
Release: 3%{?_dist_release}
Group: Development/Tools
License: MIT
URL: http://epydoc.sourceforge.net/
Source0: http://dl.sf.net/epydoc/epydoc-%{version}.tar.gz
Source1: epydocgui.desktop
Patch0: epydoc-3.0.1-nohashbang.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: tkinter
BuildRequires: python-devel
BuildRequires: desktop-file-utils
BuildArch: noarch

%description
Epydoc  is a tool for generating API documentation for Python modules,
based  on their docstrings. For an example of epydoc's output, see the
API  documentation for epydoc itself (html, pdf). A lightweight markup
language  called  epytext can be used to format docstrings, and to add
information  about  specific  fields,  such as parameters and instance
variables.    Epydoc    also   understands   docstrings   written   in
ReStructuredText, Javadoc, and plaintext.


%prep
%setup -q
%patch0 -p1 -b .nohashbang


%build
%{__python} setup.py build


%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

desktop-file-install \
    --vendor="" \
    --dir=%{buildroot}%{_datadir}/applications \
    --mode=0644 \
    %{SOURCE1}

# Also install the man pages
%{__mkdir_p} %{buildroot}%{_mandir}/man1
%{__install} -p -m 0644 man/*.1 %{buildroot}%{_mandir}/man1/

# Prevent having *.pyc and *.pyo in _bindir
%{__mv} %{buildroot}%{_bindir}/apirst2html.py %{buildroot}%{_bindir}/apirst2html


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt doc/
%{_bindir}/apirst2html
%{_bindir}/epydoc
%{_bindir}/epydocgui
%{python_sitelib}/epydoc/
%{python_sitelib}/epydoc-*.egg-info
%{_datadir}/applications/epydocgui.desktop
%{_mandir}/man1/*.1*


%changelog
* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.1-3
- rebuild with python-2.7.2

* Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 3.0.1-2
- rebuilt with python-2.6.4

* Tue Sep 09 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 3.0.1-1
- initial build for Vine Linux

* Sat Mar 22 2008 Matthias Saou <http://freshrpms.net/> 3.0.1-1
- Update to 3.0.1.
- Update nohashbang patch.
- Include new apirst2html script, but remove .py extension to avoid .pyc/pyo.
- Include egg-info file.

* Tue Jun 19 2007 Matthias Saou <http://freshrpms.net/> 2.1-8
- Remove desktop file prefix and X-Fedora category.
- Include patch to remove #! python from files only meant to be included.

* Mon Dec 11 2006 Matthias Saou <http://freshrpms.net/> 2.1-7
- Rebuild against python 2.5.
- Remove no longer needed explicit python-abi requirement.
- Change python build requirement to python-devel, as it's needed now.

* Wed Sep  6 2006 Matthias Saou <http://freshrpms.net/> 2.1-6
- No longer ghost the .pyo files, as per new python guidelines (#205374).

* Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 2.1-5
- FC6 rebuild.
- Add %%{?dist} tag.
- Update summary line.

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Mon Dec 20 2004 Ville Skyttä <ville.skytta at iki.fi> - 2.1-3
- Change to noarch.
- Get Python site-packages dir from distutils, should fix x86_64 build.
- Require python-abi and tkinter.
- %%ghost'ify *.pyo.
- Fix man page permissions.
- Add menu entry for epydocgui.

* Tue Nov 16 2004 Matthias Saou <http://freshrpms.net/> 2.1-2
- Bump release to provide Extras upgrade path.

* Thu Oct 21 2004 Matthias Saou <http://freshrpms.net/> 2.1-1
- Picked up and rebuilt.
- Added doc and man pages.

* Fri May 07 2004 Thomas Vander Stichele <thomas at apestaart dot org>
- 2.1-0.fdr.1: Initial package

