Blob Blame History Raw
%if ! (0%{?rhel} >= 6 || 0%{?fedora})
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%global upstream_name sphinxcontrib-httpdomain

Name:           python-%{upstream_name}
Version:        1.1.8
Release:        1%{?dist}
Summary:        Sphinx domain for documenting HTTP APIs
License:        BSD
URL:            http://packages.python.org/sphinxcontrib-httpdomain/
Source0:        http://pypi.python.org/packages/source/s/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
%if ! (0%{?rhel} >= 7 || 0%{?fedora})
Patch0:         %{name}-old-python.patch
%endif
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
%if ! (0%{?rhel} >= 6 || 0%{?fedora})
Group:          Development/Libraries
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%endif

# This package is not usable without Sphinx, but EPEL5 and EPEL6 have 
# both python-sphinx and python-sphinx10, and we don't want to require one or 
# the other in particular.
%if 0%{?fedora}
Requires:       python-sphinx
%endif

%description
Using this Sphinx domain you can document your HTTP API. It includes support 
for generating documentation from Flask routing tables.

%if ! (0%{?rhel} >= 6 || 0%{?fedora})
%clean
rm -rf %{buildroot}
%endif

%prep
%setup -q -n %{upstream_name}-%{version}
rm -r *.egg-info
%if ! (0%{?rhel} >= 7 || 0%{?fedora})
%patch0 -p1
%endif

%build
%{__python} setup.py build

%install
%if ! (0%{?rhel} >= 6 || 0%{?fedora})
rm -rf %{buildroot}
%endif
%{__python} setup.py install --skip-build --root %{buildroot}

%files
%doc README.rst LICENSE
%{python_sitelib}/*

%changelog
* Mon Apr 22 2013 Dan Callaghan <dcallagh@redhat.com> - 1.1.8-1
- new upstream release 1.1.8
- require python-sphinx (except on EPEL5/6)

* Mon Mar 04 2013 Dan Callaghan <dcallagh@redhat.com> - 1.1.7-2
- support EPEL5 and EPEL6

* Mon Feb 11 2013 Dan Callaghan <dcallagh@redhat.com> - 1.1.7-1
- initial version