# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define name python3-jsonpatch %define srcname jsonpatch %define version 1.24 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: Applying JSON Patches in Python Name: %{name} Version: %{version} Release: %{release} Source0: https://pypi.python.org/packages/source/j/%{srcname}/%{srcname}-%{version}.tar.gz Url: https://github.com/stefankoegl/python-json-patch License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch BuildRequires: python3 >= 3.7.4 BuildRequires: python3-devel >= 3.7.4 BuildRequires: python3-jsonpointer Requires: python3-jsonpointer Requires: python3 >= 3.7.4 %description Library to apply JSON Patches according to RFC 6902 - Python 2 build %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then python3 setup.py test fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS COPYING PKG-INFO README.md %{python_sitelib}/* #### %{python_sitelib64}/* %changelog * Wed Jan 08 2020 Harshita Jain - 1.24-1 - Update with latest version - Build with python3 * Thu May 12 2016 Ravi hirekurabar - 1.8-1 - first version for AIX V6.1 and higher