3 %bcond_without python # Python smbus module
5 %include /usr/lib/rpm/macros.perl
6 Summary: I2C tools for Linux
7 Summary(en.UTF-8): I²C tools for Linux
8 Summary(pl.UTF-8): Narzędzia I²C dla Linuksa
13 Group: Applications/System
14 # lm-sensors.org is dead (Jul 2017, since a few months);
15 # now releases are available at https://www.kernel.org/pub/software/utils/i2c-tools/
16 Source0: http://dl.lm-sensors.org/i2c-tools/releases/%{name}-%{version}.tar.bz2
17 # Source0-md5: 7104a1043d11a5e2c7b131614eb1b962
18 Patch0: %{name}-python.patch
19 URL: http://www.lm-sensors.org/wiki/I2CTools
20 BuildRequires: perl-modules >= 1:5.6
21 %{?with_python:BuildRequires: python-devel >= 2}
22 BuildRequires: rpm-perlprov >= 3.0.3-16
23 Requires: dev >= 2.9.0-13
24 Requires: uname(release) >= 2.6.5
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %description -l en.UTF-8
33 %description -l pl.UTF-8
34 Narzędzia I²C dla Linuksa.
36 %package -n python-smbus
37 Summary: Python SMBus module
38 Summary(pl.UTF-8): Moduł Pythona SMBus
39 Group: Libraries/Python
41 %description -n python-smbus
42 Python bindings for Linux SMBus access through i2c-dev.
44 %description -n python-smbus -l pl.UTF-8
45 Wiązania Pythona służące do dostępu do szyny SMBus spod Linuksa
52 %{__mv} eepromer/{README,README.eeproms}
57 CFLAGS="%{rpmcflags}" \
58 %{?with_python:EXTRA=py-smbus}
60 %{__make} -C eepromer \
62 CFLAGS="%{rpmcflags} -I../include -Wall"
65 rm -rf $RPM_BUILD_ROOT
68 DESTDIR=$RPM_BUILD_ROOT \
69 %{?with_python:EXTRA=py-smbus} \
73 install eepromer/{eeprog,eeprom,eepromer} $RPM_BUILD_ROOT%{_sbindir}
74 cp -p eepromer/{eeprog,eeprom,eepromer}.8 $RPM_BUILD_ROOT%{_mandir}/man8
76 # enhanced (more 2.4-compatible) private copy; public header already in llh
77 %{__rm} $RPM_BUILD_ROOT%{_includedir}/linux/i2c-dev.h
80 rm -rf $RPM_BUILD_ROOT
83 %defattr(644,root,root,755)
84 %doc CHANGES README eepromer/README.ee*
85 %attr(755,root,root) %{_bindir}/ddcmon
86 %attr(755,root,root) %{_bindir}/decode-dimms
87 %attr(755,root,root) %{_bindir}/decode-edid
88 %attr(755,root,root) %{_bindir}/decode-vaio
89 %attr(755,root,root) %{_sbindir}/eeprog
90 %attr(755,root,root) %{_sbindir}/eeprom
91 %attr(755,root,root) %{_sbindir}/eepromer
92 %attr(755,root,root) %{_sbindir}/i2cdetect
93 %attr(755,root,root) %{_sbindir}/i2cdump
94 %attr(755,root,root) %{_sbindir}/i2cget
95 %attr(755,root,root) %{_sbindir}/i2cset
96 %attr(755,root,root) %{_sbindir}/i2c-stub-from-dump
97 %{_mandir}/man1/decode-dimms.1*
98 %{_mandir}/man1/decode-vaio.1*
99 %{_mandir}/man8/i2cdetect.8*
100 %{_mandir}/man8/eeprog.8*
101 %{_mandir}/man8/eeprom.8*
102 %{_mandir}/man8/eepromer.8*
103 %{_mandir}/man8/i2cdump.8*
104 %{_mandir}/man8/i2cget.8*
105 %{_mandir}/man8/i2cset.8*
106 %{_mandir}/man8/i2c-stub-from-dump.8*
109 %files -n python-smbus
110 %defattr(644,root,root,755)
112 %attr(755,root,root) %{py_sitedir}/smbus.so
113 %{py_sitedir}/smbus-1.1-py*.egg-info