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