i2c-tools-vl.spec 4.5 KB

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