]> git.pld-linux.org Git - packages/python-pyjwt.git/blob - python-pyjwt.spec
1c9d96d09c518f137d9d6485312d7f000b7c73ca
[packages/python-pyjwt.git] / python-pyjwt.spec
1 #
2 # Conditional build:
3 %bcond_with     doc     # don't build doc
4 %bcond_with     tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  pyjwt
9 Summary:        JSON Web Token implementation in Python
10 Name:           python-%{module}
11 Version:        1.4.0
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 Source0:        https://files.pythonhosted.org/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz
16 # Source0-md5:  2f9bd9226d72b13d19d2c557114d03dc
17 URL:            http://github.com/jpadilla/pyjwt
18 BuildRequires:  rpm-pythonprov
19 BuildRequires:  rpmbuild(macros) >= 1.714
20 %if %{with python2}
21 BuildRequires:  python-modules
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-pytest
25 BuildRequires:  python-pytest-cov
26 BuildRequires:  python-pytest-runner
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-modules
31 BuildRequires:  python3-setuptools
32 %if %{with tests}
33 BuildRequires:  python3-pytest
34 BuildRequires:  python3-pytest-cov
35 BuildRequires:  python3-pytest-runner
36 %endif
37 %endif
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 A Python implementation of RFC 7519. Original implementation was
43 written by @progrium.
44
45 %package -n python3-%{module}
46 Summary:        JSON Web Token implementation in Python
47 Requires:       python3-setuptools
48
49 %description -n python3-%{module}
50 A Python implementation of RFC 7519. Original implementation was
51 written by @progrium.
52
53 %prep
54 %setup -q -n PyJWT-%{version}
55
56 # Remove bundled egg-info
57 %{__rm} -r PyJWT.egg-info
58
59 %build
60 %if %{with python2}
61 %py_build %{?with_tests:test}
62 %endif
63
64 %if %{with python3}
65 %py3_build %{?with_tests:test}
66 %endif
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 %if %{with python2}
71 %py_install
72 %py_postclean
73 mv $RPM_BUILD_ROOT%{_bindir}/jwt{,-2}
74 %endif
75
76 %if %{with python3}
77 %py3_install
78 mv $RPM_BUILD_ROOT%{_bindir}/jwt{,-3}
79 %endif
80
81 %clean
82 rm -rf $RPM_BUILD_ROOT
83
84 %if %{with python2}
85 %files
86 %defattr(644,root,root,755)
87 %doc README.md LICENSE
88 %attr(755,root,root) %{_bindir}/jwt-2
89 %{py_sitescriptdir}/jwt
90 %{py_sitescriptdir}/PyJWT-%{version}-py*.egg-info
91 %endif
92
93 %if %{with python3}
94 %files -n python3-%{module}
95 %defattr(644,root,root,755)
96 %doc README.md LICENSE
97 %attr(755,root,root) %{_bindir}/jwt-3
98 %{py3_sitescriptdir}/jwt
99 %{py3_sitescriptdir}/PyJWT-%{version}-py*.egg-info
100 %endif
This page took 0.051952 seconds and 2 git commands to generate.