Mathieu Bridon 98e1e33
%global module cornice
Mathieu Bridon 98e1e33
Luke Macken 21c251a
%{!?py2ver: %global py2ver %(%{__python2} -c "import sys ; print(sys.version[:3])")}
Luke Macken 21c251a
%{!?py3ver: %global py3ver %(%{__python3} -c "import sys ; print(sys.version[:3])")}
Luke Macken 21c251a
Mathieu Bridon 98e1e33
%if 0%{?fedora}
Mathieu Bridon 98e1e33
%global with_python3 1
Mathieu Bridon 98e1e33
%else
Mathieu Bridon 98e1e33
# EL doesn't have Python 3
Mathieu Bridon 98e1e33
%global with_python3 0
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if 0%{?rhel} || 0%{?rhel} < 7
Mathieu Bridon 98e1e33
# EL 6 doesn't have this macro
Mathieu Bridon 98e1e33
%global __python2       %{__python}
Mathieu Bridon 98e1e33
%global python2_sitelib %{python_sitelib}
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Name:             python-cornice
Mathieu Bridon 98e1e33
Summary:          Define Web Services in Pyramid
Luke Macken 21c251a
Version:          1.1.0
e20d80c
Release:          3%{?dist}
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
License:          MPLv2.0
Mathieu Bridon 98e1e33
URL:              https://pypi.python.org/pypi/cornice
Luke Macken 6adddb4
Source0:          https://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz
Mathieu Bridon 98e1e33
# This file is missing from the tarball
Mathieu Bridon 98e1e33
#     https://github.com/mozilla-services/cornice/pull/240
Mathieu Bridon 98e1e33
Source1:          spore_validation.rx
e20d80c
Patch0:           %{name}-webob.patch
Mathieu Bridon 98e1e33
Luke Macken 4dc99ab
Mathieu Bridon 98e1e33
BuildArch:        noarch
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
BuildRequires:    python-colander
Mathieu Bridon 98e1e33
BuildRequires:    python-coverage
Mathieu Bridon 98e1e33
BuildRequires:    python2-devel
Mathieu Bridon 98e1e33
BuildRequires:    python-docutils
Mathieu Bridon 98e1e33
BuildRequires:    python-mock
Mathieu Bridon 98e1e33
BuildRequires:    python-pyramid
Mathieu Bridon 98e1e33
BuildRequires:    python-rxjson
Mathieu Bridon 98e1e33
BuildRequires:    python-setuptools
Mathieu Bridon 98e1e33
BuildRequires:    python-simplejson
Mathieu Bridon 98e1e33
BuildRequires:    python-venusian
Mathieu Bridon 98e1e33
BuildRequires:    python-webtest
Luke Macken 21c251a
BuildRequires:    python-nose
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Requires:         python-colander
Mathieu Bridon 98e1e33
Requires:         python-docutils
Mathieu Bridon 98e1e33
Requires:         python-pyramid
Mathieu Bridon 98e1e33
Requires:         python-simplejson
Mathieu Bridon 98e1e33
Requires:         python-venusian
Mathieu Bridon 98e1e33
Luke Macken 4dc99ab
%if 0%{?rhel} <= 7
Luke Macken 4dc99ab
BuildRequires:    python-webob1.4
Luke Macken 4dc99ab
Requires:         python-webob1.4
Luke Macken 4dc99ab
%endif
Luke Macken 4dc99ab
Mathieu Bridon 98e1e33
%description
Mathieu Bridon 98e1e33
Helpers to build & document Web Services with Pyramid.
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%package sphinx
Mathieu Bridon 98e1e33
Summary:          Generate documentation for Web Services
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
BuildRequires:    python-sphinx
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Requires:         %{name} = %{version}-%{release}
Mathieu Bridon 98e1e33
Requires:         python-sphinx
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%description sphinx
Mathieu Bridon 98e1e33
Generate documentation for Web Services.
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
%package -n python3-cornice
Mathieu Bridon 98e1e33
Summary:          Define Web Services in Pyramid
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
BuildRequires:    python3-colander
Mathieu Bridon 98e1e33
BuildRequires:    python3-coverage
Mathieu Bridon 98e1e33
BuildRequires:    python3-devel
Mathieu Bridon 98e1e33
BuildRequires:    python3-docutils
Mathieu Bridon 98e1e33
BuildRequires:    python3-mock
Mathieu Bridon 98e1e33
BuildRequires:    python3-pyramid
Mathieu Bridon 98e1e33
BuildRequires:    python3-rxjson
Mathieu Bridon 98e1e33
BuildRequires:    python3-setuptools
Mathieu Bridon 98e1e33
BuildRequires:    python3-simplejson
Mathieu Bridon 98e1e33
BuildRequires:    python3-venusian
Mathieu Bridon 98e1e33
BuildRequires:    python3-webtest
Luke Macken 21c251a
BuildRequires:    python3-nose
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Requires:         python3-colander
Mathieu Bridon 98e1e33
Requires:         python3-docutils
Mathieu Bridon 98e1e33
Requires:         python3-pyramid
Mathieu Bridon 98e1e33
Requires:         python3-simplejson
Mathieu Bridon 98e1e33
Requires:         python3-venusian
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%description -n python3-cornice
Mathieu Bridon 98e1e33
Helpers to build & document Web Services with Pyramid.
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%package -n python3-cornice-sphinx
Mathieu Bridon 98e1e33
Summary:          Generate documentation for Web Services
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
BuildRequires:    python3-sphinx
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Requires:         python3-cornice = %{version}-%{release}
Mathieu Bridon 98e1e33
Requires:         python3-sphinx
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%description -n python3-cornice-sphinx
Mathieu Bridon 98e1e33
Generate documentation for Web Services.
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%prep
Mathieu Bridon 98e1e33
%setup -q -n %{module}-%{version}
Mathieu Bridon 98e1e33
Luke Macken 4dc99ab
%if 0%{?rhel} <= 7
e20d80c
%patch0 -p0 -b .webob
Luke Macken 4dc99ab
%endif
Luke Macken 4dc99ab
Mathieu Bridon 98e1e33
# This file is missing from the tarball
Mathieu Bridon 98e1e33
#     https://github.com/mozilla-services/cornice/pull/240
Mathieu Bridon 98e1e33
cp -p %{SOURCE1} ./cornice/tests/ext/
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
rm -rf %{py3dir}
Mathieu Bridon 98e1e33
cp -a . %{py3dir}
Mathieu Bridon 98e1e33
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%build
Mathieu Bridon 98e1e33
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
pushd %{py3dir}
Mathieu Bridon 98e1e33
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
Mathieu Bridon 98e1e33
popd
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%install
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
pushd %{py3dir}
Mathieu Bridon 98e1e33
%{__python3} setup.py install --skip-build --root %{buildroot}
Mathieu Bridon 98e1e33
popd
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%{__python2} setup.py install --skip-build --root %{buildroot}
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%check
Luke Macken 21c251a
python2 setup.py nosetests
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
pushd %{py3dir}
Luke Macken 21c251a
python3 setup.py nosetests
Mathieu Bridon 98e1e33
popd
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%files
Mathieu Bridon 98e1e33
%doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.rst
Mathieu Bridon 98e1e33
%{python2_sitelib}/%{module}*
Mathieu Bridon 98e1e33
%exclude %{python2_sitelib}/%{module}/ext/sphinxext*
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%files sphinx
Mathieu Bridon 98e1e33
%{python2_sitelib}/%{module}/ext/sphinxext*
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%if %{with_python3}
Mathieu Bridon 98e1e33
%files -n python3-cornice
Mathieu Bridon 98e1e33
%doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.rst
Mathieu Bridon 98e1e33
%{python3_sitelib}/%{module}*
Mathieu Bridon 98e1e33
%exclude %{python3_sitelib}/%{module}/ext/sphinxext*
Mathieu Bridon 98e1e33
%exclude %{python3_sitelib}/%{module}/ext/__pycache__/sphinxext*
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%files -n python3-cornice-sphinx
Mathieu Bridon 98e1e33
%{python3_sitelib}/%{module}/ext/sphinxext*
Mathieu Bridon 98e1e33
%{python3_sitelib}/%{module}/ext/__pycache__/sphinxext*
Mathieu Bridon 98e1e33
%endif
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
Mathieu Bridon 98e1e33
%changelog
e20d80c
* Thu Mar 09 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.1.0-3
e20d80c
- Further inspection revealed that the two patches were not needed for EL 7.
e20d80c
e2e83b2
* Tue Mar 07 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.1.0-2
e2e83b2
- Apply two patches to allow autodoc generation to work again (#1430185, #1430186).
e2e83b2
Luke Macken 21c251a
* Wed Jan 13 2016 Luke Macken <lmacken@redhat.com> - 1.1.0-1
Luke Macken 21c251a
- Update to 1.1.0
Luke Macken 21c251a
- Get the test suite running again with nose
Luke Macken 21c251a
Luke Macken e1e7c5d
* Tue Nov 17 2015 Luke Macken <lmacken@redhat.com> - 1.0.0-3
Luke Macken e1e7c5d
- Rebuild for Python 3.5
Luke Macken e1e7c5d
Luke Macken 4dc99ab
* Fri Jun 05 2015 Luke Macken <lmacken@redhat.com> - 1.0.0-2
Luke Macken 4dc99ab
- Patched to use python-webob1.4 on RHEL7
Luke Macken 4dc99ab
Luke Macken 6adddb4
* Fri Jun 05 2015 Luke Macken <lmacken@redhat.com> - 1.0.0-1
Luke Macken 6adddb4
- Update to 1.0.0
Luke Macken 6adddb4
3c60e63
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16.2-2
3c60e63
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
3c60e63
Mathieu Bridon 98e1e33
* Sun Jun 01 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 0.16.2-1
Mathieu Bridon 98e1e33
- Initial package for Fedora.