Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname pyramid
%global sum The Pyramid web application framework, a Pylons project
%global desc Pyramid is a small, fast, down-to-earth, open source Python web development\
framework. It makes real-world web application development and deployment more\
fun, more predictable, and more productive.


Name:           python-%{modname}
Version:        1.9.2
Release:        1%{?dist}
Summary:        %{sum}

Group:          Development/Libraries
License:        BSD
URL:            https://trypyramid.com/
Source0:        %pypi_source %{modname}
BuildArch:      noarch

BuildRequires:  python2-chameleon >= 1.2.3
BuildRequires:  python2-mako >= 0.3.6
BuildRequires:  python2-repoze-lru
BuildRequires:  python2-venusian >= 1.0
BuildRequires:  python2-webtest
BuildRequires:  python2-zope-deprecation >= 3.5.0
BuildRequires:  python2-devel
BuildRequires:  python2-docutils
BuildRequires:  python2-hupper
BuildRequires:  python2-paste-deploy >= 1.5.0
BuildRequires:  python2-plaster
BuildRequires:  python2-plaster-pastedeploy
BuildRequires:  python2-setuptools
BuildRequires:  python2-sphinx
BuildRequires:  python2-translationstring
BuildRequires:  python2-zope-component >= 3.6.0
BuildRequires:  python2-zope-configuration
BuildRequires:  python2-zope-interface >= 3.8.0

%if 0%{?fedora}
BuildRequires:  python2-webob >= 1.7.0
%else
BuildRequires:  python-webob1.4
%endif


%if 0%{?with_python3}
BuildRequires:  python3-chameleon >= 1.2.3
BuildRequires:  python3-devel
BuildRequires:  python3-docutils
BuildRequires:  python3-hupper
BuildRequires:  python3-mako
BuildRequires:  python3-paste-deploy
BuildRequires:  python3-plaster
BuildRequires:  python3-plaster-pastedeploy
BuildRequires:  python3-repoze-lru
BuildRequires:  python3-setuptools
BuildRequires:  python3-sphinx
BuildRequires:  python3-translationstring
BuildRequires:  python3-venusian >= 1.0
BuildRequires:  python3-webtest
BuildRequires:  python3-zope-component >= 3.6.0
BuildRequires:  python3-zope-configuration
BuildRequires:  python3-zope-deprecation >= 3.5.0
BuildRequires:  python3-zope-interface

%if 0%{?fedora}
BuildRequires:  python3-webob >= 1.7.0
%else
BuildRequires:  python3-webob1.2
%endif
%endif

%description
%{desc}


%package -n python2-pyramid
Summary:        %{sum}
Group:          Development/Libraries

Requires:       python2-chameleon >= 1.2.3
Requires:       python2-mako >= 0.3.6
Requires:       python2-repoze-lru
Requires:       python2-venusian >= 1.0
Requires:       python2-zope-deprecation >= 3.5.0
Requires:       python2-hupper
Requires:       python2-paste-deploy >= 1.5.0
Requires:       python2-plaster
Requires:       python2-plaster-pastedeploy
Requires:       python2-setuptools
Requires:       python2-translationstring
Requires:       python2-zope-component >= 3.6.0
Requires:       python2-zope-configuration
Requires:       python2-zope-interface >= 3.8.0

%if 0%{?fedora}
Requires:       python2-webob >= 1.7.0
%else
Requires:       python-webob1.4
%endif

%{?python_provide:%python_provide python2-pyramid}


%description -n python2-pyramid
%{desc}


%if 0%{?with_python3}
%package -n python3-pyramid
Summary:        %{sum}
Group:          Development/Libraries

Requires:       python3-chameleon >= 1.2.3
Requires:       python3-hupper
Requires:       python3-mako >= 0.3.6
Requires:       python3-paste-deploy >= 1.5.0
Requires:       python3-plaster
Requires:       python3-plaster-pastedeploy
Requires:       python3-repoze-lru
Requires:       python3-setuptools
Requires:       python3-translationstring
Requires:       python3-venusian >= 1.0
Requires:       python3-zope-component >= 3.6.0
Requires:       python3-zope-configuration
Requires:       python3-zope-deprecation >= 3.5.0
Requires:       python3-zope-interface >= 3.8.0

%if 0%{?fedora} && 0%{?fedora} >= 19
Requires:       python3-webob >= 1.7.0
%else
Requires:       python3-webob1.2
%endif

%{?python_provide:%python_provide python3-pyramid}


%description -n python3-pyramid
%{desc}
%endif


%prep
%autosetup -n pyramid-%{version} -p1

# Remove bundled egg info
rm -rf %{modname}.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%if 0%{?with_python3}
pushd %{py3dir}
%py3_build
popd
%endif

%py2_build


%install
%if 0%{?with_python3}
pushd %{py3dir}
%py3_install
cp -r pyramid/scaffolds/alchemy %{buildroot}/%{python3_sitelib}/pyramid/scaffolds/.
cp -r pyramid/scaffolds/starter %{buildroot}/%{python3_sitelib}/pyramid/scaffolds/.
cp -r pyramid/scaffolds/zodb %{buildroot}/%{python3_sitelib}/pyramid/scaffolds/.

# Create the Python 3 executables.
for e in pcreate pserve prequest proutes pshell ptweens pviews pdistreport; do
    mv %{buildroot}/%{_bindir}/$e %{buildroot}/%{_bindir}/$e-%{python3_version};
    ln -s %{_bindir}/$e-%{python3_version} %{buildroot}/%{_bindir}/$e-3;
done;

popd
%endif

%py2_install
cp -r pyramid/scaffolds/alchemy %{buildroot}/%{python2_sitelib}/pyramid/scaffolds/.
cp -r pyramid/scaffolds/starter %{buildroot}/%{python2_sitelib}/pyramid/scaffolds/.
cp -r pyramid/scaffolds/zodb %{buildroot}/%{python2_sitelib}/pyramid/scaffolds/.

# Create the Python 2 executables.
for e in pcreate pserve prequest proutes pshell ptweens pviews pdistreport; do
    mv %{buildroot}/%{_bindir}/$e %{buildroot}/%{_bindir}/$e-%{python2_version};
    ln -s %{_bindir}/$e-%{python2_version} %{buildroot}/%{_bindir}/$e-2;
    ln -s %{_bindir}/$e-%{python2_version} %{buildroot}/%{_bindir}/$e
done;


%check
%if 0%{?with_python3}
pushd %{py3dir}

%{__python3} setup.py test
popd
%endif

%if 0%{?rhel} && 0%{?rhel} <= 6
# Tests on el6 fail for unknown reasons.
%else
%{__python2} setup.py test
%endif

%files -n python2-pyramid
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*.egg-info
%{_bindir}/pcreate
%{_bindir}/pcreate-%{python2_version}
%{_bindir}/pcreate-2
%{_bindir}/pdistreport
%{_bindir}/pdistreport-%{python2_version}
%{_bindir}/pdistreport-2
%{_bindir}/prequest
%{_bindir}/prequest-%{python2_version}
%{_bindir}/prequest-2
%{_bindir}/proutes
%{_bindir}/proutes-%{python2_version}
%{_bindir}/proutes-2
%{_bindir}/pserve
%{_bindir}/pserve-%{python2_version}
%{_bindir}/pserve-2
%{_bindir}/pshell
%{_bindir}/pshell-%{python2_version}
%{_bindir}/pshell-2
%{_bindir}/ptweens
%{_bindir}/ptweens-%{python2_version}
%{_bindir}/ptweens-2
%{_bindir}/pviews
%{_bindir}/pviews-%{python2_version}
%{_bindir}/pviews-2

%if 0%{?with_python3}
%files -n python3-pyramid
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}*.egg-info
%{_bindir}/pcreate-%{python3_version}
%{_bindir}/pcreate-3
%{_bindir}/pdistreport-%{python3_version}
%{_bindir}/pdistreport-3
%{_bindir}/prequest-%{python3_version}
%{_bindir}/prequest-3
%{_bindir}/proutes-%{python3_version}
%{_bindir}/proutes-3
%{_bindir}/pserve-%{python3_version}
%{_bindir}/pserve-3
%{_bindir}/pshell-%{python3_version}
%{_bindir}/pshell-3
%{_bindir}/ptweens-%{python3_version}
%{_bindir}/ptweens-3
%{_bindir}/pviews-%{python3_version}
%{_bindir}/pviews-3
%endif

%changelog
* Wed Jul 25 2018 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.9.2-1
- Update to 1.9.2
- Require webob >= 1.7.0

* Wed Jul 25 2018 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.9.1-7
- Use the py2 version of the macros

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Mon Jun 18 2018 Miro HronĨok <mhroncok@redhat.com> - 1.9.1-5
- Rebuilt for Python 3.7

* Wed Feb 28 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.9.1-4
- Use /usr/bin/python2 instead of /usr/bin/python when building.

* Tue Feb 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.9.1-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Sep 16 2017 Kevin Fenzi <kevin@scrye.com> - 1.9.1-1
- Update to 1.9.1. Fixes bug #1471097

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon Jul 03 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.9-1
- Update to 1.9 (#1465428).
- https://docs.pylonsproject.org/projects/pyramid/en/1.9-branch/changes.html
- Remove deprecated python3-* executables.
- Refactor the symlink code to use a for loop for simplicity.

* Sat Jul 01 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.8.4-2
- Use python2- versions of dependencies, where available.

* Sat Jul 01 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.8.4-1
- Update to 1.8.4.
- https://docs.pylonsproject.org/projects/pyramid/en/1.8-branch/changes.html#id1
- Mark the LICENSE.txt with the license macro.
- Spice up the Source0 URL so it puts the name in the source tarball.
- Use the correct URL.
- Provide a python2-pyramid package.
- Provide the correct executable names for the python2- and python3- subpackages.
- Leave old python3- executables for the time being, even though they are not the correct names.
- Sort dependencies lexigraphically.

* Sat Mar 25 2017 Kevin Fenzi <kevin@scrye.com> - 1.8.3-1
- Update to 1.8.3. Fixes bug #1431609

* Fri Mar 10 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.8.2-2
- Depend on python{2,3}-hupper (#1431289).