1 | # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. |
---|
2 | # Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs>, the Fedora project. |
---|
3 | # |
---|
4 | # This file and all modifications and additions to the pristine |
---|
5 | # package are under the same license as the package itself. |
---|
6 | |
---|
7 | Name: i2c-tools |
---|
8 | Version: 3.0.2 |
---|
9 | Release: 2%{?_dist_release} |
---|
10 | Summary: A heterogeneous set of I2C tools for Linux |
---|
11 | Group: Applications/System |
---|
12 | License: GPLv2+ |
---|
13 | URL: http://www.lm-sensors.org/wiki/I2CTools |
---|
14 | Source0: http://dl.lm-sensors.org/i2c-tools/releases/%{name}-%{version}.tar.bz2 |
---|
15 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
---|
16 | # for /etc/udev/makedev.d resp /etc/modprobe.d ownership |
---|
17 | Requires: udev module-init-tools |
---|
18 | ExcludeArch: s390 s390x |
---|
19 | |
---|
20 | %description |
---|
21 | This package contains a heterogeneous set of I2C tools for Linux: a bus |
---|
22 | probing tool, a chip dumper, register-level access helpers, EEPROM |
---|
23 | decoding scripts, and more. |
---|
24 | |
---|
25 | |
---|
26 | %package eepromer |
---|
27 | Summary: Programs for reading / writing i2c / smbus eeproms |
---|
28 | Group: Applications/System |
---|
29 | # For the device nodes |
---|
30 | Requires: %{name} = %{version}-%{release} |
---|
31 | |
---|
32 | %description eepromer |
---|
33 | Programs for reading / writing i2c / smbus eeproms. Notice that writing the |
---|
34 | eeproms in your system is very dangerous and is likely to render your system |
---|
35 | unusable. Do not install, let alone use this, unless you really, _really_ know |
---|
36 | what you are doing. |
---|
37 | |
---|
38 | %package -n smbus-python |
---|
39 | Summary: Python module for SMBus access via I2C |
---|
40 | Group: Development/Languages |
---|
41 | BuildRequires: python-devel |
---|
42 | BuildRequires: python-setuptools |
---|
43 | Requires: python |
---|
44 | |
---|
45 | %description -n smbus-python |
---|
46 | This Python module allows SMBus access through the I2C /dev interface |
---|
47 | on Linux hosts. The host kernel must have I2C support, I2C device |
---|
48 | interface support, and a bus adapter driver. |
---|
49 | |
---|
50 | |
---|
51 | %prep |
---|
52 | %setup -q |
---|
53 | |
---|
54 | |
---|
55 | %build |
---|
56 | make CFLAGS="$RPM_OPT_FLAGS" |
---|
57 | pushd eepromer |
---|
58 | make CFLAGS="$RPM_OPT_FLAGS -I../include" |
---|
59 | popd |
---|
60 | |
---|
61 | pushd py-smbus |
---|
62 | CFLAGS="%{optflags} -I../include" python setup.py build |
---|
63 | popd |
---|
64 | |
---|
65 | %install |
---|
66 | rm -rf $RPM_BUILD_ROOT |
---|
67 | make install DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} |
---|
68 | install -m 755 eepromer/{eepromer,eeprom,eeprog} \ |
---|
69 | $RPM_BUILD_ROOT%{_sbindir} |
---|
70 | |
---|
71 | pushd py-smbus |
---|
72 | python setup.py install --root=%{buildroot} --compile --optimize=2 |
---|
73 | popd |
---|
74 | |
---|
75 | # cleanup |
---|
76 | rm -f $RPM_BUILD_ROOT%{_bindir}/decode-edid.pl |
---|
77 | # Remove userland kernel headers, belong in glibc-kernheaders. |
---|
78 | rm -rf $RPM_BUILD_ROOT%{_includedir}/linux |
---|
79 | # for i2c-dev ondemand loading through kmod |
---|
80 | mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d |
---|
81 | echo "alias char-major-89-* i2c-dev" > \ |
---|
82 | $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/i2c-dev.conf |
---|
83 | # for /dev/i2c-# creation (which are needed for kmod i2c-dev autoloading) |
---|
84 | mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d |
---|
85 | for (( i = 0 ; i < 8 ; i++ )) do |
---|
86 | echo "i2c-$i" >> $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes |
---|
87 | done |
---|
88 | |
---|
89 | |
---|
90 | %clean |
---|
91 | rm -rf $RPM_BUILD_ROOT |
---|
92 | |
---|
93 | |
---|
94 | %files |
---|
95 | %defattr(-,root,root,-) |
---|
96 | %doc CHANGES COPYING README |
---|
97 | %config(noreplace) %{_sysconfdir}/modprobe.d/i2c-dev.conf |
---|
98 | %config(noreplace) %{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes |
---|
99 | %{_bindir}/* |
---|
100 | %{_sbindir}/* |
---|
101 | %exclude %{_sbindir}/eepro* |
---|
102 | %{_mandir}/man8/*.8.gz |
---|
103 | |
---|
104 | %files eepromer |
---|
105 | %defattr(-,root,root,-) |
---|
106 | %doc eepromer/README* |
---|
107 | %{_sbindir}/eepro* |
---|
108 | |
---|
109 | %files -n smbus-python |
---|
110 | %defattr(0644,root,root,0755) |
---|
111 | %doc py-smbus/README |
---|
112 | %{python_sitearch}/smbus* |
---|
113 | |
---|
114 | |
---|
115 | %changelog |
---|
116 | * Sun Feb 06 2011 Munehiro Yamamoto <munepi@vinelinux.org> 3.0.2-2 |
---|
117 | - added smbus-python package |
---|
118 | |
---|
119 | * Tue Mar 16 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 3.0.2-1 |
---|
120 | - initial build for Vine Linux |
---|
121 | |
---|
122 | * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-4 |
---|
123 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild |
---|
124 | |
---|
125 | * Mon Apr 13 2009 Adam Jackson <ajax@redhat.com> 3.0.2-3 |
---|
126 | - mv /etc/modprobe.d/i2c-dev /etc/modprobe.d/i2c-dev.conf (#495455) |
---|
127 | |
---|
128 | * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-2 |
---|
129 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild |
---|
130 | |
---|
131 | * Thu Dec 11 2008 Adam Jackson <ajax@redhat.com> 3.0.2-1 |
---|
132 | - i2c-tools 3.0.2 |
---|
133 | |
---|
134 | * Wed Mar 5 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-3 |
---|
135 | - Change /dev/i2c-# creation from /lib/udev/devices to /etc/udev/makedev.d |
---|
136 | usage |
---|
137 | - Add an /etc/modprobe.d/i2c-dev file to work around bug 380971 |
---|
138 | |
---|
139 | * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 3.0.0-2 |
---|
140 | - Autorebuild for GCC 4.3 |
---|
141 | |
---|
142 | * Tue Nov 13 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-1 |
---|
143 | - Initial Fedora package, based on Suse specfile |
---|
144 | |
---|
145 | * Mon Oct 15 2007 - jdelvare@suse.de |
---|
146 | - Initial release. |
---|