Don't build Python 2 subpackage on EL > 7 and Fedora > 28
This commit is contained in:
parent
1b89de6317
commit
34942f699a
@ -4,9 +4,15 @@
|
|||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
# package are under the same license as the package itself.
|
# package are under the same license as the package itself.
|
||||||
|
|
||||||
|
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: i2c-tools
|
Name: i2c-tools
|
||||||
Version: 4.0
|
Version: 4.0
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: A heterogeneous set of I2C tools for Linux
|
Summary: A heterogeneous set of I2C tools for Linux
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://i2c.wiki.kernel.org/index.php/I2C_Tools
|
URL: https://i2c.wiki.kernel.org/index.php/I2C_Tools
|
||||||
@ -21,7 +27,10 @@ Patch2: 0003-py-smbus-Fix-FSF-address-in-smbusmodule.c.patch
|
|||||||
# for /etc/udev/makedev.d resp /etc/modprobe.d ownership
|
# for /etc/udev/makedev.d resp /etc/modprobe.d ownership
|
||||||
Requires: udev module-init-tools
|
Requires: udev module-init-tools
|
||||||
BuildRequires: perl-generators
|
BuildRequires: perl-generators
|
||||||
BuildRequires: python2-devel python3-devel
|
%if %{with python2}
|
||||||
|
BuildRequires: python2-devel
|
||||||
|
%endif
|
||||||
|
BuildRequires: python3-devel
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
ExcludeArch: s390 s390x
|
ExcludeArch: s390 s390x
|
||||||
|
|
||||||
@ -42,6 +51,7 @@ eeproms in your system is very dangerous and is likely to render your system
|
|||||||
unusable. Do not install, let alone use this, unless you really, _really_ know
|
unusable. Do not install, let alone use this, unless you really, _really_ know
|
||||||
what you are doing.
|
what you are doing.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-i2c-tools
|
%package -n python2-i2c-tools
|
||||||
%{?python_provide:%python_provide python2-i2c-tools}
|
%{?python_provide:%python_provide python2-i2c-tools}
|
||||||
# Remove before F30
|
# Remove before F30
|
||||||
@ -52,9 +62,16 @@ Summary: Python 2 bindings for Linux SMBus access through i2c-dev
|
|||||||
|
|
||||||
%description -n python2-i2c-tools
|
%description -n python2-i2c-tools
|
||||||
Python 2 bindings for Linux SMBus access through i2c-dev
|
Python 2 bindings for Linux SMBus access through i2c-dev
|
||||||
|
%endif
|
||||||
|
|
||||||
%package -n python3-i2c-tools
|
%package -n python3-i2c-tools
|
||||||
%{?python_provide:%python_provide python3-i2c-tools}
|
%{?python_provide:%python_provide python3-i2c-tools}
|
||||||
|
%if %{without python2}
|
||||||
|
# Remove before F30
|
||||||
|
Obsoletes: %{name}-python < 4.0-4
|
||||||
|
# Remove before F31
|
||||||
|
Obsoletes: python2-i2c-tools < 4.0-5
|
||||||
|
%endif
|
||||||
Summary: Python 3 bindings for Linux SMBus access through i2c-dev
|
Summary: Python 3 bindings for Linux SMBus access through i2c-dev
|
||||||
|
|
||||||
%description -n python3-i2c-tools
|
%description -n python3-i2c-tools
|
||||||
@ -96,8 +113,10 @@ pushd eepromer
|
|||||||
make CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS"
|
make CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS"
|
||||||
popd
|
popd
|
||||||
pushd py-smbus
|
pushd py-smbus
|
||||||
|
%if %{with python2}
|
||||||
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
|
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
|
||||||
%{__python2} setup.py build -b build-py2
|
%{__python2} setup.py build -b build-py2
|
||||||
|
%endif
|
||||||
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
|
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
|
||||||
%{__python3} setup.py build -b build-py3
|
%{__python3} setup.py build -b build-py3
|
||||||
popd
|
popd
|
||||||
@ -111,7 +130,9 @@ install -m 755 eepromer/{eepromer,eeprom} \
|
|||||||
install -m 644 eepromer/{eepromer,eeprom}.8 \
|
install -m 644 eepromer/{eepromer,eeprom}.8 \
|
||||||
$RPM_BUILD_ROOT%{_mandir}/man8
|
$RPM_BUILD_ROOT%{_mandir}/man8
|
||||||
pushd py-smbus
|
pushd py-smbus
|
||||||
|
%if %{with python2}
|
||||||
%{__python2} setup.py build -b build-py2 install --skip-build --root=$RPM_BUILD_ROOT
|
%{__python2} setup.py build -b build-py2 install --skip-build --root=$RPM_BUILD_ROOT
|
||||||
|
%endif
|
||||||
%{__python3} setup.py build -b build-py3 install --skip-build --root=$RPM_BUILD_ROOT
|
%{__python3} setup.py build -b build-py3 install --skip-build --root=$RPM_BUILD_ROOT
|
||||||
popd
|
popd
|
||||||
# cleanup
|
# cleanup
|
||||||
@ -163,9 +184,11 @@ exit 0
|
|||||||
%{_sbindir}/eepro*
|
%{_sbindir}/eepro*
|
||||||
%{_mandir}/man8/eepro*.8.gz
|
%{_mandir}/man8/eepro*.8.gz
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-i2c-tools
|
%files -n python2-i2c-tools
|
||||||
%doc py-smbus/README
|
%doc py-smbus/README
|
||||||
%{python2_sitearch}/*
|
%{python2_sitearch}/*
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n python3-i2c-tools
|
%files -n python3-i2c-tools
|
||||||
%doc py-smbus/README
|
%doc py-smbus/README
|
||||||
@ -189,6 +212,9 @@ exit 0
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Mar 22 2018 Ondřej Lysoněk <olysonek@redhat.com> - 4.0-5
|
||||||
|
- Don't build Python 2 subpackage on EL > 7 and Fedora > 28
|
||||||
|
|
||||||
* Mon Feb 19 2018 Ondřej Lysoněk <olysonek@redhat.com> - 4.0-4
|
* Mon Feb 19 2018 Ondřej Lysoněk <olysonek@redhat.com> - 4.0-4
|
||||||
- Add gcc to BuildRequires
|
- Add gcc to BuildRequires
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user