* Move eeprog to i2c-tools (shouldn't have been in eepromer sub package)

* Drop/obsolete eepromer subpackage, deprecated for 6 years, long unmaintained upstream and being dropped
  https://www.spinics.net/lists/linux-i2c/msg49657.html
* Drop python2 conditionals
* Minor cleanups
This commit is contained in:
Peter Robinson 2021-01-16 19:34:41 +00:00
parent c7cdfbee5a
commit ae524fb126

View File

@ -4,15 +4,9 @@
# This file and all modifications and additions to the pristine
# 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
Version: 4.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A heterogeneous set of I2C tools for Linux
License: GPLv2+
URL: https://i2c.wiki.kernel.org/index.php/I2C_Tools
@ -22,14 +16,12 @@ Source0: https://www.kernel.org/pub/software/utils/i2c-tools/%{name}-%{ve
# for /etc/udev/makedev.d resp /usr/lib/modprobe.d ownership
Requires: systemd-udev kmod
Requires: libi2c%{?_isa} = %{version}-%{release}
BuildRequires: perl-generators
%if %{with python2}
BuildRequires: python2-devel
%endif
BuildRequires: python3-devel
BuildRequires: gcc
BuildRequires: make
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: python3-devel
ExcludeArch: s390 s390x
Obsoletes: i2c-tools-eepromer < 4.2-2
%description
This package contains a heterogeneous set of I2C tools for Linux: a bus
@ -37,35 +29,6 @@ probing tool, a chip dumper, register-level access helpers, EEPROM
decoding scripts, and more.
%package eepromer
Summary: Programs for reading / writing i2c / smbus eeproms
# /usr/sbin/eeprom is Public Domain, the rest is GPLv2+
License: GPLv2+ and Public Domain
Requires: libi2c%{?_isa} = %{version}-%{release}
# For the device nodes
Requires: %{name} = %{version}-%{release}
%description eepromer
Programs for reading / writing i2c / smbus eeproms. Notice that writing the
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
what you are doing.
%if %{with python2}
%package -n python2-i2c-tools
Summary: Python 2 bindings for Linux SMBus access through i2c-dev
License: GPLv2
%{?python_provide:%python_provide python2-i2c-tools}
Requires: libi2c%{?_isa} = %{version}-%{release}
# Remove before F30
Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < 4.0-4
%description -n python2-i2c-tools
Python 2 bindings for Linux SMBus access through i2c-dev
%endif
%package -n python3-i2c-tools
Summary: Python 3 bindings for Linux SMBus access through i2c-dev
License: GPLv2
@ -112,14 +75,7 @@ Obsoletes: i2c-tools-devel < 4.0-1
%build
make CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" BUILD_STATIC_LIB=0 EXTRA=eeprog
pushd eepromer
make CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS"
popd
pushd py-smbus
%if %{with python2}
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
%{__python2} setup.py build -b build-py2
%endif
CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
%{__python3} setup.py build -b build-py3
popd
@ -128,14 +84,7 @@ popd
%install
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} BUILD_STATIC_LIB=0 \
EXTRA=eeprog libdir=%{_libdir}
install -m 755 eepromer/{eepromer,eeprom} \
$RPM_BUILD_ROOT%{_sbindir}
install -m 644 eepromer/{eepromer,eeprom}.8 \
$RPM_BUILD_ROOT%{_mandir}/man8
pushd py-smbus
%if %{with python2}
%{__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
popd
@ -177,23 +126,13 @@ exit 0
%config(noreplace) %{_prefix}/lib/modprobe.d/i2c-dev.conf
%config(noreplace) %{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes
%{_sbindir}/i2c*
%{_sbindir}/eeprog
%exclude %{_sbindir}/i2c-stub*
%{_mandir}/man8/i2c*.8.gz
%exclude %{_mandir}/man8/i2c-stub-from-dump.8.gz
%{_mandir}/man8/i2c*.8.*
%{_mandir}/man8/eeprog.8.*
%exclude %{_mandir}/man8/i2c-stub-from-dump.8.*
%{_prefix}/lib/modules-load.d/%{name}.conf
%files eepromer
%doc eepromer/README*
%doc eeprog/README.eeprog
%{_sbindir}/eepro*
%{_mandir}/man8/eepro*.8.gz
%if %{with python2}
%files -n python2-i2c-tools
%doc py-smbus/README
%{python2_sitearch}/*
%endif
%files -n python3-i2c-tools
%doc py-smbus/README
%{python3_sitearch}/*
@ -202,8 +141,8 @@ exit 0
%doc eeprom/README
%{_bindir}/decode-*
%{_sbindir}/i2c-stub*
%{_mandir}/man1/decode-*.1.gz
%{_mandir}/man8/i2c-stub-from-dump.8.gz
%{_mandir}/man1/decode-*.1.*
%{_mandir}/man8/i2c-stub-from-dump.8.*
%files -n libi2c
%license COPYING.LGPL
@ -213,9 +152,15 @@ exit 0
%dir %{_includedir}/i2c
%{_includedir}/i2c/smbus.h
%{_libdir}/libi2c.so
%{_mandir}/man3/libi2c.3.gz
%{_mandir}/man3/libi2c.3.*
%changelog
* Sat Jan 16 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 4.2-2
- Move eeprog to i2c-tools (shouldn't have been in eepromer sub package)
- Drop/obsolete eepromer subpackage, deprecated for 6 years
- Drop python2 conditionals
- Minor cleanups
* Thu Jan 07 2021 Artem Egorenkov <aegorenk@redhat.com> - 4.2-1
- Version 4.2