|
| 1 | +%if 0%{?rhel} && 0%{?rhel} <= 6 |
| 2 | +%{!?__python2: %global __python2 /usr/bin/python2} |
| 3 | +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} |
| 4 | +%endif |
| 5 | + |
| 6 | +%global dist_raw %(%{__grep} -oP "release \\K[0-9]+\\.[0-9]+" /etc/system-release | tr -d ".") |
| 7 | + |
| 8 | +%if 0%{?fedora} > 12 || 0%{?rhel} && 0%{?dist_raw} >= 75 |
| 9 | +%bcond_without python3 |
| 10 | +%else |
| 11 | +%bcond_with python3 |
| 12 | +%endif |
| 13 | + |
| 14 | +# centos 7.2 and lower versions don't have %py2_* macros, so define it manually |
| 15 | +%if 0%{?rhel} && 0%{?dist_raw} <= 72 |
| 16 | +%{!?py2_build: %global py2_build %py_build} |
| 17 | +%{!?py2_install: %global py2_install %py_install} |
| 18 | +%endif |
| 19 | + |
| 20 | +%global pkgname jsonrpclib |
| 21 | + |
| 22 | +Name: python-%{pkgname} |
| 23 | +Version: 0.4.0 |
| 24 | +Release: CROC1%{?dist} |
| 25 | +Summary: JSON-RPC v2.0 client library for Python |
| 26 | +License: ASL 2.0 |
| 27 | +URL: http://github.com/tcalmant/jsonrpclib/ |
| 28 | +Source0: %{pkgname}-%{version}.tar.gz |
| 29 | +BuildArch: noarch |
| 30 | + |
| 31 | +%global _description\ |
| 32 | +This project is an implementation of the JSON-RPC v2.0 specification\ |
| 33 | +(backwards-compatible) as a client library, for Python 2.7 and Python 3.\ |
| 34 | +This version is a fork of jsonrpclib by Josh Marshall, usable with Pelix\ |
| 35 | +remote services.\ |
| 36 | + |
| 37 | +%description %_description |
| 38 | + |
| 39 | +%package -n python2-%{pkgname} |
| 40 | +Summary: %summary |
| 41 | +BuildRequires: python2-devel |
| 42 | + |
| 43 | +%description -n python2-%{pkgname} %_description |
| 44 | + |
| 45 | +%if %{with python3} |
| 46 | +%package -n python%{python3_pkgversion}-%{pkgname} |
| 47 | +Summary: %summary |
| 48 | +BuildRequires: python%{python3_pkgversion} |
| 49 | + |
| 50 | +%description -n python%{python3_pkgversion}-%{pkgname} %_description |
| 51 | +%endif |
| 52 | + |
| 53 | + |
| 54 | +%prep |
| 55 | +%setup -q -n %{pkgname}-%{version} |
| 56 | + |
| 57 | + |
| 58 | +%build |
| 59 | +%py2_build |
| 60 | + |
| 61 | +%if %{with python3} |
| 62 | +%py3_build |
| 63 | +%endif |
| 64 | + |
| 65 | + |
| 66 | +%install |
| 67 | +[ %buildroot = "/" ] || rm -rf %buildroot |
| 68 | + |
| 69 | +%py2_install |
| 70 | + |
| 71 | +%if %{with python3} |
| 72 | +%py3_install |
| 73 | +%endif |
| 74 | + |
| 75 | + |
| 76 | +%clean |
| 77 | +rm -rf %{buildroot} |
| 78 | + |
| 79 | + |
| 80 | +%files -n python2-%{pkgname} |
| 81 | +%license LICENSE |
| 82 | +%{python2_sitelib}/* |
| 83 | + |
| 84 | +%if %{with python3} |
| 85 | +%files -n python%{python3_pkgversion}-%{pkgname} |
| 86 | +%license LICENSE |
| 87 | +%{python3_sitelib}/* |
| 88 | +%endif |
| 89 | + |
| 90 | + |
| 91 | +%changelog |
| 92 | +* Mon Sep 30 2019 Croc Cloud Engineering - 0.4.0-1 |
| 93 | +- Build for py2/py3 for Croc cloud |
| 94 | + |
0 commit comments