diff --git a/python-kdcproxy.spec b/python-kdcproxy.spec index bd8e773..32b12fa 100644 --- a/python-kdcproxy.spec +++ b/python-kdcproxy.spec @@ -1,8 +1,20 @@ %global realname kdcproxy +%if 0%{?fedora} || 0%{?rhel} > 7 +%global with_python3 1 +%else +%global with_python3 0 +%endif + +%if 0%{?fedora} || 0%{?rhel} <= 7 +%global with_python2 1 +%else +%global with_python2 0 +%endif + Name: python-%{realname} Version: 0.3.2 -Release: 11%{?dist} +Release: 12%{?dist} Summary: MS-KKDCP (kerberos proxy) WSGI module License: MIT @@ -13,17 +25,19 @@ Source0: https://github.com/npmccallum/%{realname}/archive/v%{version}.ta Patch0: fix-failing-tests.patch BuildArch: noarch -BuildRequires: python2-devel - -%if 0%{?rhel} == 0 BuildRequires: /usr/bin/tox + +%if 0%{?with_python2} > 0 +BuildRequires: python2-devel BuildRequires: python2-pytest BuildRequires: python2-coverage BuildRequires: python2-webtest BuildRequires: python2-pyasn1 BuildRequires: python2-dns BuildRequires: python2-mock +%endif +%if 0%{?with_python3} > 0 BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-coverage @@ -39,6 +53,7 @@ This package contains a Python WSGI module for proxying KDC requests over HTTP by following the MS-KKDCP protocol. It aims to be simple to deploy, with minimal configuration. +%if 0%{?with_python2} > 0 %package -n python2-%{realname} Summary: MS-KKDCP (kerberos proxy) WSGI module Requires: python2-dns @@ -50,8 +65,9 @@ Requires: python2-pyasn1 This package contains a Python 2.x WSGI module for proxying KDC requests over HTTP by following the MS-KKDCP protocol. It aims to be simple to deploy, with minimal configuration. +%endif -%if 0%{?rhel} == 0 +%if 0%{?with_python3} > 0 %package -n python3-%{realname} Summary: MS-KKDCP (kerberos proxy) WSGI module Requires: python3-dns @@ -70,14 +86,18 @@ minimal configuration. %patch0 -p1 %build +%if 0%{?with_python2} > 0 %py2_build -%if 0%{?rhel} == 0 +%endif +%if 0%{?with_python3} > 0 %py3_build %endif %install +%if 0%{?with_python2} > 0 %py2_install -%if 0%{?rhel} == 0 +%endif +%if 0%{?with_python3} > 0 %py3_install %endif @@ -87,13 +107,15 @@ minimal configuration. tox --sitepackages -e py%{python2_version_nodots},py%{python3_version_nodots} || : %endif +%if 0%{?with_python2} > 0 %files -n python2-%{realname} %doc README %license COPYING %{python2_sitelib}/%{realname}/ %{python2_sitelib}/%{realname}-%{version}-*.egg-info +%endif -%if 0%{?rhel} == 0 +%if 0%{?with_python3} > 0 %files -n python3-%{realname} %doc README %license COPYING @@ -102,6 +124,10 @@ tox --sitepackages -e py%{python2_version_nodots},py%{python3_version_nodots} || %endif %changelog +* Thu Mar 22 2018 Troy Dawson - 0.3.2-12 +- Update conditionals. +- Make preperations for non-python2 builds + * Mon Feb 12 2018 Iryna Shcherbina - 0.3.2-11 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)