# Not building for EPEL 6 or 7 at present due to issues building # python-httpbin; see that package's spec for details %global github_owner kevin1024 %global github_name pytest-httpbin %global modname pytest_httpbin %global github_commit e4ffbae0a44895ae8ddfdffdebd1b5e062d1d743 %global desc Pytest-httpbin creates a pytest fixture that is dependency-injected into your \ tests. It automatically starts up a HTTP server in a separate thread running \ a local instance of httpbin (a web service for testing HTTP libraries) and \ provides your test with the URL in the fixture. %global sum Fixture providing local instance of httpbin test service %global t_requires python-flask python-decorator python-httpbin python-six python-pytest %global t3_requires python3-flask python3-decorator python3-httpbin python3-six python3-pytest # Enable Python 3 builds for Fedora + EPEL >7 # httpbin is missing deps on EPEL 6 and 7 %if 0%{?fedora} || 0%{?rhel} > 7 # If the definition isn't available for python3_pkgversion, define it %{?!python3_pkgversion:%global python3_pkgversion 3} %bcond_without python3 %else %bcond_with python3 %endif Name: python-%{github_name} Version: 0.2.3 Release: 3%{?dist} Summary: %{sum} # License is included in-line in README.md License: MIT URL: https://github.com/%{github_owner}/%{github_name} # NOTE: the source includes a CA trust bundle (certs/cacert.pem). We # don't replace it with the system-wide trust bundle because it's only # used for httpbin itself and contains only the self-signed cert, # valid only for 127.0.0.1, that the test server uses. We can't # replace it because we can't actually securely have the test server # use a cert that would be trusted by the system-wide trust bundle. Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-setuptools BuildRequires: python2-devel # For tests BuildRequires: python2-requests BuildRequires: %{t_requires} BuildRequires: ca-certificates %if %{with python3} # Required for Python 3 pkgversion macros to work BuildRequires: python3-pkgversion-macros BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel # For tests BuildRequires: python3-requests BuildRequires: %{t3_requires} %if 0%{?with_python3_other} BuildRequires: python%{python3_other_pkgversion}-setuptools BuildRequires: python%{python3_other_pkgversion}-devel %endif %endif %description %{desc} ################################################################################# %package -n python2-%{github_name} Summary: %{sum} %{?python_provide:%python_provide python2-%{github_name}} Requires: %{t_requires} %description -n python2-%{github_name} %{desc} This package provides the Python 2 implementation. %if %{with python3} %package -n python%{python3_pkgversion}-%{github_name} Summary: %{sum} %{?python_provide:%python_provide python%{python3_pkgversion}-%{github_name}} Requires: %{t3_requires} %description -n python%{python3_pkgversion}-%{github_name} %{desc} This package provides the Python 3 implementation. %if 0%{?with_python3_other} %package -n python%{python3_other_pkgversion}-%{github_name} Summary: %{sum} %{?python_provide:%python_provide python%{python3_other_pkgversion}-%{github_name}} %description -n python%{python3_other_pkgversion}-%{github_name} %{desc} This package provides the Python 3 implementation. %endif %endif ################################################################################# %prep %autosetup -n %{github_name}-%{github_commit} -p1 %build %py2_build %if %{with python3} %py3_build %if 0%{?with_python3_other} %py3_other_build %endif %endif %install %py2_install %if %{with python3} %py3_install %if 0%{?with_python3_other} %py3_other_install %endif %endif ################################################################################# %check PYTHONPATH=./ py.test %if %{with python3} PYTHONPATH=./ py.test-%{python3_pkgversion} %if 0%{?with_python3_other} PYTHONPATH=./ py.test-%{python3_other_pkgversion} %endif %endif ################################################################################# %files -n python2-%{github_name} %{python2_sitelib}/%{modname}* %doc DESCRIPTION.rst README.md %if %{with python3} %files -n python%{python3_pkgversion}-%{github_name} %{python3_sitelib}/%{modname}* %doc DESCRIPTION.rst README.md %if 0%{?with_python3_other} %files -n python%{python3_other_pkgversion}-%{github_name} %{python3_other_sitelib}/%{modname}* %doc DESCRIPTION.rst README.md %endif %endif ################################################################################# %changelog * Thu Dec 29 2016 Adam Williamson - 0.2.3-3 - Ensure we own all packaged dirs * Thu Dec 29 2016 Adam Williamson - 0.2.3-2 - Fix subpackage names * Thu Dec 29 2016 Adam Williamson - 0.2.3-1 - Initial package