lm_sensors-3.3.4-r1.ebuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils linux-info multilib systemd toolchain-funcs
  5. DESCRIPTION="Hardware Monitoring user-space utilities"
  6. HOMEPAGE="http://www.lm-sensors.org/"
  7. SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2"
  8. LICENSE="GPL-2 LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 ~arm ~mips ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
  11. IUSE="sensord static-libs"
  12. RDEPEND="
  13. dev-lang/perl
  14. sensord? (
  15. net-analyzer/rrdtool
  16. virtual/logger
  17. )"
  18. DEPEND="${RDEPEND}
  19. sys-devel/bison
  20. sys-devel/flex"
  21. CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
  22. WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use."
  23. WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled."
  24. WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors."
  25. src_prepare() {
  26. epatch "${FILESDIR}"/${P}-sensors-detect-gentoo.patch
  27. use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; }
  28. # Respect LDFLAGS
  29. sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die
  30. # Fix shipped unit file paths
  31. sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \
  32. prog/init/lm_sensors.service || die
  33. use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; }
  34. }
  35. src_compile() {
  36. einfo
  37. einfo "You may safely ignore any errors from compilation"
  38. einfo "that contain \"No such file or directory\" references."
  39. einfo
  40. emake CC="$(tc-getCC)"
  41. }
  42. src_install() {
  43. emake \
  44. DESTDIR="${D}" \
  45. PREFIX="${EPREFIX}/usr" \
  46. MANDIR="${EPREFIX}/usr/share/man" \
  47. ETCDIR="${EPREFIX}/etc" \
  48. LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
  49. install
  50. newinitd "${FILESDIR}"/${PN}-3-init.d ${PN}
  51. systemd_dounit prog/init/lm_sensors.service
  52. newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol
  53. systemd_dounit "${FILESDIR}"/fancontrol.service
  54. if use sensord; then
  55. newconfd "${FILESDIR}"/sensord-conf.d sensord
  56. newinitd "${FILESDIR}"/sensord-4-init.d sensord
  57. systemd_dounit "${FILESDIR}"/sensord.service
  58. fi
  59. dodoc CHANGES CONTRIBUTORS INSTALL README \
  60. doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid}
  61. docinto developers
  62. dodoc doc/developers/applications
  63. }
  64. pkg_postinst() {
  65. echo
  66. elog "Please run \`/usr/sbin/sensors-detect' in order to setup"
  67. elog "/etc/conf.d/${PN}."
  68. echo
  69. elog "/etc/conf.d/${PN} is vital to the init-script."
  70. elog "Please make sure you also add ${PN} to the desired"
  71. elog "runlevel. Otherwise your I2C modules won't get loaded"
  72. elog "on the next startup."
  73. echo
  74. elog "You will also need to run the above command if you're upgrading from"
  75. elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has"
  76. elog "changed."
  77. echo
  78. elog "Be warned, the probing of hardware in your system performed by"
  79. elog "sensors-detect could freeze your system. Also make sure you read"
  80. elog "the documentation before running ${PN} on IBM ThinkPads."
  81. echo
  82. elog "Also make sure you have read:"
  83. elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31"
  84. echo
  85. elog "Please refer to the ${PN} documentation for more information."
  86. elog "(http://www.lm-sensors.org/wiki/Documentation)"
  87. echo
  88. }