i2c-tools-vl.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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: 4.3
  8. Release: 1%{?_dist_release}
  9. Summary: A heterogeneous set of I2C tools for Linux
  10. Group: system
  11. Vendor: Project Vine
  12. Distribution: Vine Linux
  13. License: GPLv2+
  14. URL: https://i2c.wiki.kernel.org/index.php/I2C_Tools
  15. Source0: https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/%{name}-%{version}.tar.xz
  16. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  17. # for /etc/udev/makedev.d resp /etc/modprobe.d ownership
  18. Requires: udev kmod
  19. ExcludeArch: s390 s390x
  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. %package -n python3-smbus
  25. Summary: Python module for SMBus access via I2C
  26. Group: programming
  27. BuildRequires: python-rpm-macros
  28. BuildRequires: python3-rpm-macros
  29. BuildRequires: python3-devel
  30. BuildRequires: python3-setuptools
  31. Requires: python3
  32. %description -n python3-smbus
  33. This Python module allows SMBus access through the I2C /dev interface
  34. on Linux hosts. The host kernel must have I2C support, I2C device
  35. interface support, and a bus adapter driver.
  36. %debug_package
  37. %prep
  38. %setup -q
  39. %build
  40. make CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" BUILD_STATIC_LIB=0 EXTRA=eeprog
  41. pushd py-smbus
  42. CFLAGS="$RPM_OPT_FLAGS -I../include" LDFLAGS="$RPM_LD_FLAGS" \
  43. %{__python3} setup.py build -b build-py3
  44. popd
  45. %install
  46. make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} BUILD_STATIC_LIB=0 \
  47. EXTRA=eeprog libdir=%{_libdir}
  48. pushd py-smbus
  49. %{__python3} setup.py build -b build-py3 install --skip-build --root=$RPM_BUILD_ROOT
  50. popd
  51. # cleanup
  52. rm -f $RPM_BUILD_ROOT%{_bindir}/decode-edid.pl
  53. # Remove unpleasant DDC tools. KMS already exposes the EDID block in sysfs,
  54. # and edid-decode is a more complete tool than decode-edid.
  55. rm -f $RPM_BUILD_ROOT%{_bindir}/{ddcmon,decode-edid}
  56. # for i2c-dev ondemand loading through kmod
  57. mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d
  58. echo "alias char-major-89-* i2c-dev" > \
  59. $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d/i2c-dev.conf
  60. # for /dev/i2c-# creation (which are needed for kmod i2c-dev autoloading)
  61. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d
  62. for (( i = 0 ; i < 8 ; i++ )) do
  63. echo "i2c-$i" >> $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes
  64. done
  65. # auto-load i2c-dev after reboot
  66. mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modules-load.d
  67. echo 'i2c-dev' > $RPM_BUILD_ROOT%{_prefix}/lib/modules-load.d/%{name}.conf
  68. %clean
  69. rm -rf $RPM_BUILD_ROOT
  70. %files
  71. %defattr(-,root,root,-)
  72. %license COPYING*
  73. %doc CHANGES README
  74. %config(noreplace) %{_prefix}/lib/modprobe.d/i2c-dev.conf
  75. %config(noreplace) %{_sysconfdir}/udev/makedev.d/99-i2c-dev.nodes
  76. %{_sbindir}/i2c*
  77. %{_sbindir}/eeprog
  78. %exclude %{_sbindir}/i2c-stub*
  79. %{_mandir}/man8/i2c*.8.*
  80. %{_mandir}/man8/eeprog.8.*
  81. %exclude %{_bindir}/decode-*
  82. %exclude %{_mandir}/man1/decode-*.1.*
  83. %exclude %{_mandir}/man8/i2c-stub-from-dump.8.*
  84. %{_prefix}/lib/modules-load.d/%{name}.conf
  85. %{_libdir}/libi2c.so.0*
  86. %dir %{_includedir}/i2c
  87. %{_includedir}/i2c/smbus.h
  88. %{_libdir}/libi2c.so
  89. %{_mandir}/man3/libi2c.3.*
  90. %files -n python3-smbus
  91. %defattr(0644,root,root,0755)
  92. %doc py-smbus/README
  93. %{python3_sitearch}/*
  94. %changelog
  95. * Tue Oct 03 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.3-1
  96. - new upstream release.
  97. * Sun Feb 06 2011 Munehiro Yamamoto <munepi@vinelinux.org> 3.0.2-2
  98. - added smbus-python package
  99. * Tue Mar 16 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 3.0.2-1
  100. - initial build for Vine Linux
  101. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-4
  102. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  103. * Mon Apr 13 2009 Adam Jackson <ajax@redhat.com> 3.0.2-3
  104. - mv /etc/modprobe.d/i2c-dev /etc/modprobe.d/i2c-dev.conf (#495455)
  105. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-2
  106. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  107. * Thu Dec 11 2008 Adam Jackson <ajax@redhat.com> 3.0.2-1
  108. - i2c-tools 3.0.2
  109. * Wed Mar 5 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-3
  110. - Change /dev/i2c-# creation from /lib/udev/devices to /etc/udev/makedev.d
  111. usage
  112. - Add an /etc/modprobe.d/i2c-dev file to work around bug 380971
  113. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 3.0.0-2
  114. - Autorebuild for GCC 4.3
  115. * Tue Nov 13 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 3.0.0-1
  116. - Initial Fedora package, based on Suse specfile
  117. * Mon Oct 15 2007 - jdelvare@suse.de
  118. - Initial release.