Modernize spec to comply with new packaging guidelines

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1351090
epel9
Igor Gnatenko 9 years ago
parent c9898ced58
commit 80840b1044

@ -1,91 +1,62 @@
%if 0%{?fedora}
%global with_python3 1
%endif
%global srcname waitress %global srcname waitress
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %global _docdir_fmt %{name}
Name: python-%{srcname} Name: python-%{srcname}
Version: 0.9.0 Version: 0.9.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: Waitress WSGI server Summary: Waitress WSGI server
License: ZPLv2.1 License: ZPLv2.1
URL: https://github.com/Pylons/%{srcname} URL: https://github.com/Pylons/%{srcname}
Source0: https://files.pythonhosted.org/packages/source/w/%{srcname}/%{srcname}-%{version}.tar.gz Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools # No docs as we don't have packaged pylons theme for sphinx
BuildRequires: python-nose
BuildRequires: python-coverage %global _description \
BuildRequires: python-sphinx Waitress is meant to be a production-quality pure-Python WSGI server with\
very acceptable performance. It has no dependencies except ones which live\
%description in the Python standard library. It runs on CPython on Unix and Windows under\
Waitress is meant to be a production-quality pure-Python WSGI server with Python 2.6+ and Python 3.3+. It is also known to run on PyPy 1.6.0+ on UNIX.\
very acceptable performance. It has no dependencies except ones which live
in the Python standard library. It runs on CPython on Unix and Windows under
Python 2.6+ and Python 3.3+. It is also known to run on PyPy 1.6.0+ on UNIX.
It supports HTTP/1.0 and HTTP/1.1. It supports HTTP/1.0 and HTTP/1.1.
For more information, see %{_pkgdocdir}/docs or %description %{_description}
http://docs.pylonsproject.org/projects/waitress/en/latest/ .
%package -n python2-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-nose
BuildRequires: python2-coverage
%description -n python2-%{srcname} %{_description}
Python 2 version.
%if 0%{?with_python3}
%package -n python3-%{srcname} %package -n python3-%{srcname}
Summary: Waitress WSGI server Summary: Waitress WSGI server
Requires: python3
BuildArch: noarch
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-nose BuildRequires: python3-nose
BuildRequires: python3-coverage BuildRequires: python3-coverage
BuildRequires: python3-sphinx
%description -n python3-%{srcname} %description -n python3-%{srcname} %{_description}
Waitress is meant to be a production-quality pure-Python WSGI server with
very acceptable performance. It has no dependencies except ones which live
in the Python standard library. It runs on CPython on Unix and Windows under
Python 2.6+ and Python 3.3+. It is also known to run on PyPy 1.6.0+ on UNIX.
It supports HTTP/1.0 and HTTP/1.1.
For more information, see %{_pkgdocdir}/docs or Python 3 version.
http://docs.pylonsproject.org/projects/waitress/en/latest/ .
%endif
%prep %prep
%setup -q -n %{srcname}-%{version} %autosetup -n %{srcname}-%{version}
rm -rf waitress.egg-info
rm -f .gitignore docs/.gitignore
# this script has devel paths, not useful in a user system
rm -f docs/rebuild
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%{__python2} setup.py build %py2_build
%py3_build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install %install
# Run the Python 3 install first so that the Python 2 version %py2_install
# of /usr/bin/waitress-server "wins": %py3_install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
%check %check
# by setting the PYTHONPATH to the current dir # by setting the PYTHONPATH to the current dir
@ -93,30 +64,26 @@ popd
# Usually the testsuite is run after installing # Usually the testsuite is run after installing
# the package in develop mode but we can't install # the package in develop mode but we can't install
# in develop mode here. # in develop mode here.
PYTHONPATH=. %{__python2} setup.py nosetests PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} setup.py nosetests
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} setup.py nosetests
%if 0%{?with_python3}
pushd %{py3dir} %files -n python2-%{srcname}
PYTHONPATH=. %{__python3} setup.py nosetests %license COPYRIGHT.txt LICENSE.txt
popd %doc README.rst CHANGES.txt
%endif %{python2_sitelib}/%{srcname}/
%{python2_sitelib}/%{srcname}-*.egg-info/
%files %files -n python3-%{srcname}
%doc README.rst CHANGES.txt COPYRIGHT.txt LICENSE.txt docs %license COPYRIGHT.txt LICENSE.txt
%doc README.rst CHANGES.txt
%{_bindir}/waitress-serve %{_bindir}/waitress-serve
%{python2_sitelib}/waitress %{python3_sitelib}/%{srcname}/
%{python2_sitelib}/waitress-%{version}-py2.?.egg-info %{python3_sitelib}/%{srcname}-*.egg-info/
%if 0%{?with_python3}
%files -n python3-waitress
%doc README.rst CHANGES.txt COPYRIGHT.txt LICENSE.txt docs
%{python3_sitelib}/waitress
%{python3_sitelib}/waitress-%{version}-py3.?.egg-info
%endif
%changelog %changelog
* Wed Jun 29 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.9.0-3
- Modernize spec to comply with new packaging guidelines
* Thu May 26 2016 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> - 0.9.0-2 * Thu May 26 2016 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> - 0.9.0-2
- Fixed Source0 to point to new PyPi predictable URL format - Fixed Source0 to point to new PyPi predictable URL format

@ -1 +1 @@
88eccb32edec524c4d7fa03dfbed9cb1 waitress-0.9.0.tar.gz 9c5bf5414031ca0b9f98305db62fdc10 waitress-0.9.0.tar.gz

Loading…
Cancel
Save