diff --git a/PyJWT-1.1.0.diff b/PyJWT-1.1.0.diff deleted file mode 100644 index 1c2fae5..0000000 --- a/PyJWT-1.1.0.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/setup.py b/setup.py -index 2586c2a..dee928c 100755 ---- a/setup.py -+++ b/setup.py -@@ -62,7 +62,6 @@ - ], - test_suite='tests', - setup_requires=['pytest-runner'], -- tests_require=tests_require, - extras_require=dict( - test=tests_require, - crypto=['cryptography'], diff --git a/python-PyJWT.changes b/python-PyJWT.changes index 199e5a6..93d9224 100644 --- a/python-PyJWT.changes +++ b/python-PyJWT.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Mar 10 08:52:47 UTC 2017 - alarrosa@suse.com + +- Use update-alternatives so it can be co-installable with python3-PyJWT +- Use dos2unix on jwt/__init__.py +- updated source url to files.pythonhosted.org +- Run the spec file through spec-cleaner +- Drop PyJWT-1.1.0.diff which was only used on rhel (?) + ------------------------------------------------------------------- Thu Sep 15 13:52:58 UTC 2016 - rjschwei@suse.com diff --git a/python-PyJWT.spec b/python-PyJWT.spec index cd898e1..12583f7 100644 --- a/python-PyJWT.spec +++ b/python-PyJWT.spec @@ -1,7 +1,7 @@ # # spec file for package python-PyJWT # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,17 +16,20 @@ # +%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%else +BuildArch: noarch +%endif Name: python-PyJWT Version: 1.4.2 Release: 0 -Url: https://github.com/progrium/pyjwt Summary: JSON Web Token implementation in Python License: MIT Group: Development/Languages/Python -Source: https://pypi.io/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz -# PATCH-FIX-CENTOS PyJWT-1.1.0.diff -- without this, the centos build %%check will try to download stuff from pypi --seife -Patch1: PyJWT-1.1.0.diff -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Url: https://github.com/progrium/pyjwt +Source: https://files.pythonhosted.org/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz +BuildRequires: dos2unix BuildRequires: python-cryptography BuildRequires: python-devel BuildRequires: python-ecdsa @@ -38,20 +41,17 @@ BuildRequires: python-setuptools Requires: python-cryptography Requires: python-ecdsa Requires: python-pycrypto -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch -%endif +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description A Python implementation of JSON Web Token draft 01. %prep %setup -q -n PyJWT-%{version} -%if 0%{?rhel} -%patch1 -p1 -%endif +dos2unix jwt/__main__.py +sed -i -e "s/jwt = jwt.__main__:main/jwt-%{py_ver} = jwt.__main__:main/" setup.py %build python setup.py build @@ -59,6 +59,19 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/jwt +ln -sf %{_sysconfdir}/alternatives/jwt %{buildroot}/%{_bindir}/jwt + +%post +update-alternatives \ + --install %{_bindir}/jwt jwt %{_bindir}/jwt-%{py_ver} 30 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove jwt %{_bindir}/jwt-%{py_ver} +fi + %check PYTHONPATH=%{buildroot}%{python_sitelib} py.test -k "not test_verify_false_deprecated" @@ -67,5 +80,7 @@ PYTHONPATH=%{buildroot}%{python_sitelib} py.test -k "not test_verify_false_depre %doc AUTHORS CHANGELOG.md LICENSE README.md %{python_sitelib}/* %{_bindir}/jwt +%{_bindir}/jwt-%{py_ver} +%ghost %{_sysconfdir}/alternatives/jwt %changelog