Blob Blame History Raw
%global module cornice

%{!?py2ver: %global py2ver %(%{__python2} -c "import sys ; print(sys.version[:3])")}
%{!?py3ver: %global py3ver %(%{__python3} -c "import sys ; print(sys.version[:3])")}

%if 0%{?fedora}
%global with_python3 1
# EL doesn't have Python 3
%global with_python3 0

%if 0%{?rhel} || 0%{?rhel} < 7
# EL 6 doesn't have this macro
%global __python2       %{__python}
%global python2_sitelib %{python_sitelib}

Name:             python-cornice
Summary:          Define Web Services in Pyramid
Version:          1.1.0
Release:          3%{?dist}

License:          MPLv2.0
Patch0:           0000-New-setting-in-latest-docutils.patch
Patch1:           0001-Initialize-the-ref_context-as-a-dictionary.patch

# This file is missing from the tarball
Source1:          spore_validation.rx

BuildArch:        noarch

BuildRequires:    python-colander
BuildRequires:    python-coverage
BuildRequires:    python2-devel
BuildRequires:    python-docutils
BuildRequires:    python-mock
BuildRequires:    python-pyramid
BuildRequires:    python-rxjson
BuildRequires:    python-setuptools
BuildRequires:    python-simplejson
BuildRequires:    python-venusian
BuildRequires:    python-webtest
BuildRequires:    python-nose

Requires:         python-colander
Requires:         python-docutils
Requires:         python-pyramid
Requires:         python-simplejson
Requires:         python-venusian

Helpers to build & document Web Services with Pyramid.

%package sphinx
Summary:          Generate documentation for Web Services

BuildRequires:    python-sphinx

Requires:         %{name} = %{version}-%{release}
Requires:         python-sphinx

%description sphinx
Generate documentation for Web Services.

%if %{with_python3}
%package -n python3-cornice
Summary:          Define Web Services in Pyramid

BuildRequires:    python3-colander
BuildRequires:    python3-coverage
BuildRequires:    python3-devel
BuildRequires:    python3-docutils
BuildRequires:    python3-mock
BuildRequires:    python3-pyramid
BuildRequires:    python3-rxjson
BuildRequires:    python3-setuptools
BuildRequires:    python3-simplejson
BuildRequires:    python3-venusian
BuildRequires:    python3-webtest
BuildRequires:    python3-nose

Requires:         python3-colander
Requires:         python3-docutils
Requires:         python3-pyramid
Requires:         python3-simplejson
Requires:         python3-venusian

%description -n python3-cornice
Helpers to build & document Web Services with Pyramid.

%package -n python3-cornice-sphinx
Summary:          Generate documentation for Web Services

BuildRequires:    python3-sphinx

Requires:         python3-cornice = %{version}-%{release}
Requires:         python3-sphinx

%description -n python3-cornice-sphinx
Generate documentation for Web Services.

%setup -q -n %{module}-%{version}

%patch0 -p1
%patch1 -p1

# This file is missing from the tarball
cp -p %{SOURCE1} ./cornice/tests/ext/

%if %{with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

CFLAGS="$RPM_OPT_FLAGS" %{__python2} build

%if %{with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} build

%if %{with_python3}
pushd %{py3dir}
%{__python3} install --skip-build --root %{buildroot}

%{__python2} install --skip-build --root %{buildroot}


%if %{with_python3}
pushd %{py3dir}

%exclude %{python2_sitelib}/%{module}/ext/sphinxext*

%files sphinx

%if %{with_python3}
%files -n python3-cornice
%exclude %{python3_sitelib}/%{module}/ext/sphinxext*
%exclude %{python3_sitelib}/%{module}/ext/__pycache__/sphinxext*

%files -n python3-cornice-sphinx

* Tue Mar 07 2017 Randy Barlow <> - 1.1.0-3
- Apply two patches to allow autodoc generation to work again (#1430185, #1430186).

* Thu Feb 04 2016 Fedora Release Engineering <> - 1.1.0-2
- Rebuilt for

* Wed Jan 13 2016 Luke Macken <> - 1.1.0-1
- Update to 1.1.0
- Get the test suite running again with nose

* Tue Nov 10 2015 Fedora Release Engineering <> - 1.0.0-3
- Rebuilt for

* Thu Jun 18 2015 Fedora Release Engineering <> - 1.0.0-2
- Rebuilt for

* Fri Jun 05 2015 Luke Macken <> - 1.0.0-1
- Update to 1.0.0

* Sat Jun 07 2014 Fedora Release Engineering <> - 0.16.2-2
- Rebuilt for

* Sun Jun 01 2014 Mathieu Bridon <> - 0.16.2-1
- Initial package for Fedora.