diff --git a/_service b/_service new file mode 100644 index 0000000..790feac --- /dev/null +++ b/_service @@ -0,0 +1,7 @@ + + + yes + enable + + + diff --git a/python-PyJWT.changes b/python-PyJWT.changes index 081add2..148d6ed 100644 --- a/python-PyJWT.changes +++ b/python-PyJWT.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 26 18:03:53 UTC 2017 - pousaduarte@gmail.com + +- Convert to singlespec +- Remove unneeded dependency python-ecdsa +- Use "download_files" in _service file to automate source fetching + ------------------------------------------------------------------- Fri Mar 17 18:58:52 UTC 2017 - rjschwei@suse.com diff --git a/python-PyJWT.spec b/python-PyJWT.spec index 9b29e65..8cc056f 100644 --- a/python-PyJWT.spec +++ b/python-PyJWT.spec @@ -16,11 +16,7 @@ # -%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 +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-PyJWT Version: 1.4.2 Release: 0 @@ -29,56 +25,60 @@ License: MIT Group: Development/Languages/Python 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 -BuildRequires: python-pytest -BuildRequires: python-pytest-cov >= 1.7 -BuildRequires: python-pytest-runner -BuildRequires: python-setuptools -Requires: python-cryptography -Requires: python-ecdsa -Requires(post): update-alternatives -Requires(postun): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: %{python_module cryptography} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pytest-cov >= 1.7} +BuildRequires: %{python_module pytest-runner} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: dos2unix +BuildRequires: fdupes +BuildRequires: python-rpm-macros + +Requires: python-cryptography +Requires: python-setuptools + +Requires(post): update-alternatives +Requires(postun): update-alternatives + +BuildArch: noarch + +%python_subpackages + %description A Python implementation of JSON Web Token draft 01. %prep %setup -q -n PyJWT-%{version} 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 +%python_build +#remove shebang from all non executable files +find ./ -type f -name "*.py" -perm 644 -exec sed -i -e '1{\@^#!/usr/bin/env python@d}' {} \; %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_clone -a %{buildroot}%{_bindir}/jwt -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -touch %{buildroot}%{_sysconfdir}/alternatives/jwt -ln -sf %{_sysconfdir}/alternatives/jwt %{buildroot}/%{_bindir}/jwt +#hardlink duplicated files +%fdupes %{buildroot} %post -update-alternatives \ - --install %{_bindir}/jwt jwt %{_bindir}/jwt-%{py_ver} 30 +%python_install_alternative jwt %postun -if [ $1 -eq 0 ] ; then - update-alternatives --remove jwt %{_bindir}/jwt-%{py_ver} -fi +%python_uninstall_alternative jwt %check -PYTHONPATH=%{buildroot}%{python_sitelib} py.test -k "not test_verify_false_deprecated" +%{python_expand PYTHONPATH=%{buildroot}%{python_sitelib} py.test-%{py_ver} -k "not test_verify_false_deprecated" } -%files +%files %python_files %defattr(-,root,root,-) %doc AUTHORS CHANGELOG.md LICENSE README.md %{python_sitelib}/* -%{_bindir}/jwt -%{_bindir}/jwt-%{py_ver} -%ghost %{_sysconfdir}/alternatives/jwt +%python_alternative %{_bindir}/jwt %changelog