046a76e
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
046a76e
# Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs>, the Fedora project.
046a76e
#
046a76e
# This file and all modifications and additions to the pristine
046a76e
# package are under the same license as the package itself.
046a76e
046a76e
Name:           i2c-tools
8ec4588
Version:        3.1.0
00e209e
Release:        7%{?dist}
046a76e
Summary:        A heterogeneous set of I2C tools for Linux
046a76e
Group:          Applications/System
046a76e
License:        GPLv2+
046a76e
URL:            http://www.lm-sensors.org/wiki/I2CTools
046a76e
Source0:        http://dl.lm-sensors.org/i2c-tools/releases/%{name}-%{version}.tar.bz2
Jaromir Capik 1e88b94
Jaromir Capik 1e88b94
# Introducing man pages for binaries in the eepromer subpackage
Jaromir Capik 1e88b94
# Introducing -r switch in the i2cset help
Jaromir Capik 1e88b94
Patch0:         i2c-tools-3.1-man-eeproX.patch
Jaromir Capik 1e88b94
5663fe1
# for /etc/udev/makedev.d resp /etc/modprobe.d ownership
5663fe1
Requires:       udev module-init-tools
Jaromir Capik 1e88b94
BuildRequires:  python-devel
046a76e
ExcludeArch:    s390 s390x
046a76e
046a76e
%description
046a76e
This package contains a heterogeneous set of I2C tools for Linux: a bus
046a76e
probing tool, a chip dumper, register-level access helpers, EEPROM
046a76e
decoding scripts, and more.
046a76e
046a76e
046a76e
%package eepromer
046a76e
Summary:        Programs for reading / writing i2c / smbus eeproms
046a76e
Group:          Applications/System
046a76e
# For the device nodes
046a76e
Requires:       %{name} = %{version}-%{release}
046a76e
046a76e
%description eepromer
046a76e
Programs for reading / writing i2c / smbus eeproms. Notice that writing the
046a76e
eeproms in your system is very dangerous and is likely to render your system
046a76e
unusable. Do not install, let alone use this, unless you really, _really_ know
046a76e
what you are doing.
046a76e
fab5708
%package python
Jaromir Capik 1e88b94
Summary:        Python bindings for Linux SMBus access through i2c-dev
fab5708
Group:          Applications/System
fab5708
fab5708
%description python
046a76e
046a76e
%prep
fab5708
%setup -q
046a76e
Jaromir Capik 1e88b94
%patch0 -p1
046a76e
046a76e
%build
046a76e
make CFLAGS="$RPM_OPT_FLAGS"
046a76e
pushd eepromer
046a76e
make CFLAGS="$RPM_OPT_FLAGS -I../include"
046a76e
popd
fab5708
pushd py-smbus
fab5708
CFLAGS="$RPM_OPT_FLAGS -I../include" %{__python} setup.py build
fab5708
popd
046a76e
046a76e
046a76e
%install
046a76e
rm -rf $RPM_BUILD_ROOT
046a76e
make install DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix}
046a76e
install -m 755 eepromer/{eepromer,eeprom,eeprog} \
046a76e
  $RPM_BUILD_ROOT%{_sbindir}
Jaromir Capik d973368
install -m 644 eepromer/{eepromer,eeprom,eeprog}.8 \
Jaromir Capik d973368
  $RPM_BUILD_ROOT%{_mandir}/man8
fab5708
pushd py-smbus
fab5708
%{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT
fab5708
popd
046a76e
# cleanup
c3d5883
rm -f $RPM_BUILD_ROOT%{_bindir}/decode-edid.pl
046a76e
# Remove userland kernel headers, belong in glibc-kernheaders.
046a76e
rm -rf $RPM_BUILD_ROOT%{_includedir}/linux
8ec4588
# Remove unpleasant DDC tools.  KMS already exposes the EDID block in sysfs,
8ec4588
# and edid-decode is a more complete tool than decode-edid.
8ec4588
rm -f $RPM_BUILD_ROOT%{_bindir}/{ddcmon,decode-edid}
5663fe1
# for i2c-dev ondemand loading through kmod
5663fe1
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d 
5663fe1
echo "alias char-major-89-* i2c-dev" > \
858d379
  $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/i2c-dev.conf
5663fe1
# for /dev/i2c-# creation (which are needed for kmod i2c-dev autoloading)
5663fe1
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d
5663fe1
for (( i = 0 ; i < 8 ; i++ )) do
5663fe1
  echo "i2c-$i" >> $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes
5663fe1
done
046a76e
046a76e
046a76e
%clean
046a76e
rm -rf $RPM_BUILD_ROOT
046a76e
046a76e
046a76e
%files
046a76e
%defattr(-,root,root,-)
046a76e
%doc CHANGES COPYING README
858d379
%config(noreplace) %{_sysconfdir}/modprobe.d/i2c-dev.conf
5663fe1
%config(noreplace) %{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes
046a76e
%{_bindir}/*
046a76e
%{_sbindir}/*
046a76e
%exclude %{_sbindir}/eepro*
046a76e
%{_mandir}/man8/*.8.gz
Jaromir Capik d973368
%exclude %{_mandir}/man8/eepro*
046a76e
046a76e
%files eepromer
046a76e
%defattr(-,root,root,-)
046a76e
%doc eepromer/README*
046a76e
%{_sbindir}/eepro*
Jaromir Capik d973368
%{_mandir}/man8/eepro*.8.gz
046a76e
fab5708
%files python
fab5708
%defattr(-,root,root,-)
fab5708
%doc py-smbus/README
fab5708
#/usr/lib64/python2.7/site-packages/smbus-1.1-py2.7.egg-info
fab5708
#/usr/lib64/python2.7/site-packages/smbus.so
fab5708
%{python_sitearch}/*
fab5708
fab5708
046a76e
046a76e
%changelog
00e209e
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 3.1.0-7
00e209e
- Perl 5.18 rebuild
00e209e
Jaromir Capik d973368
* Wed Jul 03 2013 Jaromir Capik <jcapik@redhat.com> - 3.1.0-6
Jaromir Capik d973368
- Installing the man pages and putting them in the files section
Jaromir Capik d973368
Jaromir Capik 1e88b94
* Wed Jul 03 2013 Jaromir Capik <jcapik@redhat.com> - 3.1.0-5
Jaromir Capik 1e88b94
- Introducing man pages for binaries in the eepromer subpackage
Jaromir Capik 1e88b94
- Introducing -r switch in the i2cset help
Jaromir Capik 1e88b94
fab5708
* Sat Jun  1 2013 Henrik Nordstrom <henrik@henriknordstrom.net> - 3.1.0-4
fab5708
- Package python interface
fab5708
c970191
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.0-3
c970191
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c970191
0c1091d
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.0-2
0c1091d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
0c1091d
8ec4588
* Mon Feb 20 2012 Adam Jackson <ajax@redhat.com> 3.1.0-1
8ec4588
- i2c-tools 3.1.0
8ec4588
233ce52
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-2
233ce52
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
233ce52
84bddbb
* Tue Jul 05 2011 Adam Jackson <ajax@redhat.com> 3.0.3-1
84bddbb
- i2c-tools 3.0.3
84bddbb
3e463e9
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-5
3e463e9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3e463e9
30a33df
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-4
30a33df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
30a33df
858d379
* Mon Apr 13 2009 Adam Jackson <ajax@redhat.com> 3.0.2-3
858d379
- mv /etc/modprobe.d/i2c-dev /etc/modprobe.d/i2c-dev.conf (#495455)
858d379
67019d4
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-2
67019d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
67019d4
c3d5883
* Thu Dec 11 2008 Adam Jackson <ajax@redhat.com> 3.0.2-1
c3d5883
- i2c-tools 3.0.2
c3d5883
5663fe1
* Wed Mar  5 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-3
5663fe1
- Change /dev/i2c-# creation from /lib/udev/devices to /etc/udev/makedev.d
5663fe1
  usage
5663fe1
- Add an /etc/modprobe.d/i2c-dev file to work around bug 380971
5663fe1
838716d
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 3.0.0-2
838716d
- Autorebuild for GCC 4.3
838716d
046a76e
* Tue Nov 13 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-1
046a76e
- Initial Fedora package, based on Suse specfile
046a76e
046a76e
* Mon Oct 15 2007 - jdelvare@suse.de
046a76e
- Initial release.