forked from pool/python-PyJWT
Accepting request 491801 from home:xenonpk:python
Proper fix for tests with different python versions OBS-URL: https://build.opensuse.org/request/show/491801 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyJWT?expand=0&rev=23
This commit is contained in:
7
_service
Normal file
7
_service
Normal file
@@ -0,0 +1,7 @@
|
||||
<services>
|
||||
<service name="download_files" mode="localonly">
|
||||
<param name="enforceupstream">yes</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="set_version" mode="localonly"/>
|
||||
</services>
|
@@ -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
|
||||
|
||||
|
@@ -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,19 +25,27 @@ 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
|
||||
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: python-cryptography
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-ecdsa
|
||||
BuildRequires: python-pytest
|
||||
BuildRequires: python-pytest-cov >= 1.7
|
||||
BuildRequires: python-pytest-runner
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
|
||||
Requires: python-cryptography
|
||||
Requires: python-ecdsa
|
||||
Requires: python-setuptools
|
||||
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
A Python implementation of JSON Web Token draft 01.
|
||||
@@ -49,36 +53,32 @@ 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
|
||||
|
Reference in New Issue
Block a user