]> git.pld-linux.org Git - packages/python-pyjwt.git/blame - python-pyjwt.spec
- release 2 (by relup.sh)
[packages/python-pyjwt.git] / python-pyjwt.spec
CommitLineData
afd691c4 1# NOTE: for versions >= 2.0.0 (for python 3.6+) see python3-pyjwt.spec
f455e9d6
ER
2#
3# Conditional build:
d749d6e4 4%bcond_with tests # unit tests
f455e9d6 5%bcond_without python2 # CPython 2.x module
afd691c4 6%bcond_with python3 # CPython 3.x module (built from python3-pyjwt.spec)
f455e9d6
ER
7
8%define module pyjwt
d749d6e4
JB
9Summary: JSON Web Token implementation in Python 2
10Summary(pl.UTF-8): Implementacja JSON Web Token w Pythonie 2
f455e9d6 11Name: python-%{module}
d749d6e4
JB
12# keep 1.x here for python2 support
13Version: 1.7.1
c949f3c1 14Release: 2
f455e9d6
ER
15License: MIT
16Group: Libraries/Python
d749d6e4 17#Source0Download: https://pypi.org/simple/pyjwt/
f455e9d6 18Source0: https://files.pythonhosted.org/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz
d749d6e4
JB
19# Source0-md5: a4712f980c008696e13e09504120b2a0
20Patch0: %{name}-tests.patch
f455e9d6
ER
21URL: http://github.com/jpadilla/pyjwt
22BuildRequires: rpm-pythonprov
23BuildRequires: rpmbuild(macros) >= 1.714
24%if %{with python2}
d749d6e4 25BuildRequires: python-modules >= 1:2.7
f455e9d6
ER
26BuildRequires: python-setuptools
27%if %{with tests}
d749d6e4
JB
28BuildRequires: python-Crypto
29BuildRequires: python-ecdsa
30BuildRequires: python-pytest >= 4.0.1
31BuildRequires: python-pytest-cov >= 2.6.0
32BuildRequires: python-pytest-runner >= 4.2
f455e9d6
ER
33%endif
34%endif
35%if %{with python3}
d749d6e4 36BuildRequires: python3-modules >= 1:3.4
f455e9d6
ER
37BuildRequires: python3-setuptools
38%if %{with tests}
d749d6e4
JB
39BuildRequires: python3-Crypto
40BuildRequires: python3-ecdsa
41BuildRequires: python3-pytest >= 4.0.1
42BuildRequires: python3-pytest-cov >= 2.6.0
43BuildRequires: python3-pytest-runner >= 4.2
f455e9d6
ER
44%endif
45%endif
d749d6e4
JB
46# file and namespace conflict
47Conflicts: python-jwt
f455e9d6
ER
48BuildArch: noarch
49BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51%description
52A Python implementation of RFC 7519. Original implementation was
53written by @progrium.
54
d749d6e4
JB
55%description -l pl.UTF-8
56Pythonowa implementacja RFC 7519. Oryginalna implementacja została
57napisana przez @progrium.
58
f455e9d6 59%package -n python3-%{module}
d749d6e4
JB
60Summary: JSON Web Token implementation in Python 3
61Summary(pl.UTF-8): Implementacja JSON Web Token w Pythonie 3
62Group: Libraries/Python
f455e9d6 63Requires: python3-setuptools
d749d6e4
JB
64# file and namespace conflict
65Conflicts: python3-jwt
f455e9d6
ER
66
67%description -n python3-%{module}
68A Python implementation of RFC 7519. Original implementation was
69written by @progrium.
70
d749d6e4
JB
71%description -n python3-%{module} -l pl.UTF-8
72Pythonowa implementacja RFC 7519. Oryginalna implementacja została
73napisana przez @progrium.
74
f455e9d6
ER
75%prep
76%setup -q -n PyJWT-%{version}
d749d6e4 77%patch0 -p1
f455e9d6
ER
78
79# Remove bundled egg-info
80%{__rm} -r PyJWT.egg-info
81
82%build
83%if %{with python2}
d749d6e4 84%py_build %{?with_tests:pytest}
f455e9d6
ER
85%endif
86
87%if %{with python3}
d749d6e4 88%py3_build %{?with_tests:pytest}
f455e9d6
ER
89%endif
90
91%install
92rm -rf $RPM_BUILD_ROOT
93%if %{with python2}
94%py_install
95%py_postclean
d749d6e4 96%{__mv} $RPM_BUILD_ROOT%{_bindir}/pyjwt{,-2}
f455e9d6
ER
97%endif
98
99%if %{with python3}
100%py3_install
d749d6e4 101%{__mv} $RPM_BUILD_ROOT%{_bindir}/pyjwt{,-3}
f455e9d6
ER
102%endif
103
104%clean
105rm -rf $RPM_BUILD_ROOT
106
107%if %{with python2}
108%files
109%defattr(644,root,root,755)
d749d6e4
JB
110%doc AUTHORS CHANGELOG.md LICENSE README.rst
111%attr(755,root,root) %{_bindir}/pyjwt-2
f455e9d6
ER
112%{py_sitescriptdir}/jwt
113%{py_sitescriptdir}/PyJWT-%{version}-py*.egg-info
114%endif
115
116%if %{with python3}
117%files -n python3-%{module}
118%defattr(644,root,root,755)
d749d6e4
JB
119%doc AUTHORS CHANGELOG.md LICENSE README.rst
120%attr(755,root,root) %{_bindir}/pyjwt-3
f455e9d6
ER
121%{py3_sitescriptdir}/jwt
122%{py3_sitescriptdir}/PyJWT-%{version}-py*.egg-info
123%endif
This page took 0.086662 seconds and 4 git commands to generate.