#1 Add python 3 support.
Closed 4 years ago by olysonek. Opened 4 years ago by troycurtisjr.
https://gitlab.com/troycurtisjr/fedora-pkg-i2c-tools.git python3-support  into  master

Add a python3 subpackage.
Troy Curtis Jr • 4 years ago  
i2c-tools.spec
file modified
+24 -8
@@ -6,7 +6,7 @@

  

  Name:           i2c-tools

  Version:        3.1.2

- Release:        6%{?dist}

+ Release:        7%{?dist}

  Summary:        A heterogeneous set of I2C tools for Linux

  License:        GPLv2+

  URL:            https://i2c.wiki.kernel.org/index.php/I2C_Tools
@@ -15,7 +15,7 @@

  # for /etc/udev/makedev.d resp /etc/modprobe.d ownership

  Requires:       udev module-init-tools

  BuildRequires:  perl-generators

- BuildRequires:  python-devel

+ BuildRequires:  python2-devel python3-devel

  ExcludeArch:    s390 s390x

  

  %description
@@ -41,14 +41,23 @@

  Provides: %{name}-python = %{version}-%{release}

  Provides: %{name}-python%{?_isa} = %{version}-%{release}

  Obsoletes: %{name}-python < %{version}-%{release}

- Summary:        Python bindings for Linux SMBus access through i2c-dev

+ Summary:        Python 2 bindings for Linux SMBus access through i2c-dev

  

  %description -n python2-i2c-tools

+ Python 2 bindings for Linux SMBus access through i2c-dev

+ 

+ %package -n python3-i2c-tools

+ %{?python_provide:%python_provide python3-i2c-tools}

+ Summary:        Python 3 bindings for Linux SMBus access through i2c-dev

+ 

+ %description -n python3-i2c-tools

+ Python 3 bindings for Linux SMBus access through i2c-dev

  

  %package perl

  Summary:        i2c tools written in Perl

  

  %description perl

+ A collection of tools written in perl for use with i2c devices.

  

  %package devel

  Summary:        Header files for i2c-tools
@@ -65,7 +74,8 @@

  make CFLAGS="$RPM_OPT_FLAGS -I../include"

  popd

  pushd py-smbus

- CFLAGS="$RPM_OPT_FLAGS -I../include" %{__python} setup.py build

+ CFLAGS="$RPM_OPT_FLAGS -I../include" %{__python2} setup.py build -b build-py2

+ CFLAGS="$RPM_OPT_FLAGS -I../include" %{__python3} setup.py build -b build-py3

  popd

  

  
@@ -76,7 +86,8 @@

  install -m 644 eepromer/{eepromer,eeprom,eeprog}.8 \

    $RPM_BUILD_ROOT%{_mandir}/man8

  pushd py-smbus

- %{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT

+ %{__python2} setup.py build -b build-py2 install --skip-build --root=$RPM_BUILD_ROOT

+ %{__python3} setup.py build -b build-py3 install --skip-build --root=$RPM_BUILD_ROOT

  popd

  # cleanup

  rm -f $RPM_BUILD_ROOT%{_bindir}/decode-edid.pl
@@ -127,9 +138,11 @@

  

  %files -n python2-i2c-tools

  %doc py-smbus/README

- #/usr/lib64/python2.7/site-packages/smbus-1.1-py2.7.egg-info

- #/usr/lib64/python2.7/site-packages/smbus.so

- %{python_sitearch}/*

+ %{python2_sitearch}/*

+ 

+ %files -n python3-i2c-tools

+ %doc py-smbus/README

+ %{python3_sitearch}/*

  

  %files perl

  %{_bindir}/decode-*
@@ -142,6 +155,9 @@

  

  

  %changelog

+ * Sat Oct 7 2017 Troy Curtis, Jr <troycurtisjr@gmail.com> - 3.1.2-7

+ - Add Python3 subpackage.

+ 

  * Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.1.2-6

  - Add Provides for the old name without %%_isa

  

no initial comment

Updated the spec to also build the python bindings for python3, and put them into a python3 subpackage.

Successful copr build can be found here.

Merged. Thanks for the contribution!

Pull-Request has been closed by olysonek

4 years ago
Metadata