diff --git a/Make-webtest-an-optional-dependency.patch b/Make-webtest-an-optional-dependency.patch new file mode 100644 index 0000000..dac556a --- /dev/null +++ b/Make-webtest-an-optional-dependency.patch @@ -0,0 +1,36 @@ +From 903d77cb73bd6713279f1d9920f5f665293a26c2 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 9 Aug 2018 14:57:56 -0400 +Subject: [PATCH] Make webtest an optional dependency + +Resolves: #38 +(cherry picked from commit c0bee88c60deb176d420d90447d24c370d70727a) +--- + tests.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests.py b/tests.py +index 992529f..c2b1fc0 100644 +--- a/tests.py ++++ b/tests.py +@@ -33,7 +33,11 @@ from dns.rdataclass import IN as RDCLASS_IN + from dns.rdatatype import SRV as RDTYPE_SRV + from dns.rdtypes.IN.SRV import SRV + +-from webtest import TestApp as WebTestApp ++try: ++ from webtest import TestApp as WebTestApp ++except ImportError: ++ print("webtest not installed! Tests will be skipped") ++ WebTestApp = "skip" + + import kdcproxy + from kdcproxy import codec +@@ -45,6 +49,7 @@ HERE = os.path.dirname(os.path.abspath(__file__)) + KRB5_CONFIG = os.path.join(HERE, 'tests.krb5.conf') + + ++@unittest.skipIf(WebTestApp == "skip", "webtest not installed") + class KDCProxyWSGITests(unittest.TestCase): + addrinfo = [ + (2, 1, 6, '', ('128.66.0.2', 88)), diff --git a/kdcproxy-0.4.tar.gz b/kdcproxy-0.4.tar.gz new file mode 100644 index 0000000..49e6ad9 Binary files /dev/null and b/kdcproxy-0.4.tar.gz differ diff --git a/python-kdcproxy.spec b/python-kdcproxy.spec new file mode 100644 index 0000000..24a0aad --- /dev/null +++ b/python-kdcproxy.spec @@ -0,0 +1,63 @@ +Name: python-kdcproxy +Version: 0.4 +Release: 3 +Summary: A kerberos KDC HTTP/HTTPS proxy Python WSGI module +License: MIT +URL: https://github.com/npmccallum/kdcproxy +Source0: https://github.com/latchset/kdcproxy/releases/download/v0.4/kdcproxy-%{version}.tar.gz + +Patch0000: Make-webtest-an-optional-dependency.patch + +BuildArch: noarch + +BuildRequires: python2-devel python2-pytest python2-coverage python2-asn1crypto python2-dns python2-mock +BuildRequires: python3-devel python3-pytest python3-coverage python3-asn1crypto python3-dns python3-mock +BuildRequires: git + +%description +A kerberos KDC HTTP/HTTPS proxy Python WSGI module. + +%package -n python2-kdcproxy +Summary: A kerberos KDC HTTP/HTTPS proxy Python 2.x WSGI module +Requires: python2-dns python2-asn1crypto +%{?python_provide:%python_provide python2-kdcproxy} + +%description -n python2-kdcproxy +A kerberos KDC HTTP/HTTPS proxy Python 2.x WSGI module. + +%package -n python3-kdcproxy +Summary: A kerberos KDC HTTP/HTTPS proxy Python 3.x WSGI module +Requires: python3-dns python3-asn1crypto +%{?python_provide:%python_provide python3-kdcproxy} + +%description -n python3-kdcproxy +A kerberos KDC HTTP/HTTPS proxy Python 3.x WSGI module. + +%prep +%autosetup -n kdcproxy-%{version} -p1 -S git + +%build +%py2_build +%py3_build + +%install +%py2_install +%py3_install + +%check +KDCPROXY_ASN1MOD=asn1crypto %{__python2} -m pytest +KDCPROXY_ASN1MOD=asn1crypto %{__python3} -m pytest + +%files -n python2-kdcproxy +%doc README COPYING +%{python2_sitelib}/kdcproxy/ +%{python2_sitelib}/kdcproxy-%{version}-*.egg-info + +%files -n python3-kdcproxy +%doc README COPYING +%{python3_sitelib}/kdcproxy/ +%{python3_sitelib}/kdcproxy-%{version}-*.egg-info + +%changelog +* Wed Apr 22 2020 leiju - 0.4-3 +- Package init diff --git a/python-kdcproxy.yaml b/python-kdcproxy.yaml new file mode 100644 index 0000000..c7de366 --- /dev/null +++ b/python-kdcproxy.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: latchset/kdcproxy +tag_prefix: ^v +seperator: .