support EPEL5 and EPEL6

This commit is contained in:
Dan Callaghan 2013-03-04 13:32:01 +10:00
parent 5649a4781f
commit 0453584acc
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,21 @@
diff -ur sphinxcontrib-httpdomain-1.1.7.orig/sphinxcontrib/httpdomain.py sphinxcontrib-httpdomain-1.1.7/sphinxcontrib/httpdomain.py
--- sphinxcontrib-httpdomain-1.1.7.orig/sphinxcontrib/httpdomain.py 2012-03-28 16:10:58.000000000 +1000
+++ sphinxcontrib-httpdomain-1.1.7/sphinxcontrib/httpdomain.py 2013-03-04 13:20:09.941831182 +1000
@@ -44,7 +44,7 @@
location of the RFC which defines some HTTP method.
"""
- return '{}#{}{}'.format(self.base_url, self.anchor, self.section)
+ return '%s#%s%s' % (self.base_url, self.anchor, self.section)
#: The URL of the HTTP/1.1 RFC which defines the HTTP methods OPTIONS, GET,
@@ -319,7 +319,7 @@
for prefix in self.ignore:
if letters[:len(prefix)] == prefix:
return '/' + '/'.join(letters[:len(prefix) + 1])
- return '/%s' % (letters[0] if letters else '',)
+ return '/%s' % (letters and letters[0] or '',)
def generate(self, docnames=None):
content = {}

View File

@ -1,27 +1,50 @@
%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.7
Release: 1%{?dist}
Release: 2%{?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
%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}
%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
@ -29,5 +52,8 @@ for generating documentation from Flask routing tables.
%{python_sitelib}/*
%changelog
* 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