diff --git a/i2c-tools.changes b/i2c-tools.changes index b5e5f9f..04d77fe 100644 --- a/i2c-tools.changes +++ b/i2c-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 31 09:23:26 UTC 2019 - Guillaume GARDET + +- Enable python binding python3-smbus for openSUSE Leap 15+ + and SLE15+ + ------------------------------------------------------------------- Tue Dec 4 11:08:28 UTC 2018 - Jan Engelhardt diff --git a/i2c-tools.spec b/i2c-tools.spec index 63fd098..bbab967 100644 --- a/i2c-tools.spec +++ b/i2c-tools.spec @@ -1,7 +1,7 @@ # # spec file for package i2c-tools # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,13 @@ # +# Python build is broken on SLE12 / Leap 42.x +%if 0%{?sle_version} >= 150000 || 0%{?suse_version} >= 1500 +%bcond_without i2ctools_python_binding +%else +%bcond_with i2ctools_python_binding +%endif + Name: i2c-tools Version: 4.1 Release: 0 @@ -28,6 +35,8 @@ Url: https://i2c.wiki.kernel.org/index.php/I2C_Tools Source0: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.xz Source1: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.sign BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: python3-devel +BuildRequires: python3-setuptools ExcludeArch: s390 s390x %description @@ -56,16 +65,40 @@ Provides: /usr/include/i2c/smbus.h libi2c offers a way for applications to interact with the devices connected to the I2C or SMBus buses of the system. +%if %{with i2ctools_python_binding} +%package -n python3-smbus +Summary: Python binding for Device Tree +License: GPL-2.0-or-later +Group: Development/Tools/Other + +%description -n python3-smbus +libi2c offers a way for applications to interact with the devices +connected to the I2C or SMBus buses of the system. + +Python binding part. +%endif + %prep %setup -q %build make %{?_smp_mflags} CFLAGS="%{optflags}" CC="%{__cc}" BUILD_STATIC_LIB:=0 +%if %{with i2ctools_python_binding} +cd py-smbus +python3 setup.py build_ext +%py3_build +cd .. +%endif %install %make_install PREFIX=/usr libdir=%{_libdir} BUILD_STATIC_LIB:=0 # cleanup rm -f "%{buildroot}/usr/bin/decode-edid" +%if %{with i2ctools_python_binding} +cd py-smbus +%python3_install +cd .. +%endif %post -n libi2c0 -p /sbin/ldconfig @@ -86,4 +119,10 @@ rm -f "%{buildroot}/usr/bin/decode-edid" %dir %{_includedir}/i2c %{_includedir}/i2c/smbus.h +%if %{with i2ctools_python_binding} +%files -n python3-smbus +%{python3_sitearch}/*.so +%{python3_sitearch}/*.egg-info +%endif + %changelog