You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lm-sensors
  9. PKG_VERSION:=3.5.0
  10. PKG_RELEASE:=1
  11. PKG_VERSION_SUBST=$(subst .,-,$(PKG_VERSION))
  12. PKG_SOURCE_URL:=https://github.com/lm-sensors/lm-sensors/archive/V$(PKG_VERSION_SUBST)/lm-sensors
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_HASH:=f671c1d63a4cd8581b3a4a775fd7864a740b15ad046fe92038bcff5c5134d7e0
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION_SUBST)
  16. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  17. PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/lm-sensors/Default
  21. DEPENDS:=+sysfsutils
  22. URL:=https://hwmon.wiki.kernel.org/lm_sensors
  23. endef
  24. define Package/lm-sensors
  25. $(call Package/lm-sensors/Default)
  26. SECTION:=utils
  27. CATEGORY:=Utilities
  28. TITLE:=lm-sensors
  29. DEPENDS+=+libsensors
  30. endef
  31. define Package/lm-sensors-detect
  32. $(call Package/lm-sensors/Default)
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE:=lm-sensors-detect
  36. DEPENDS+=+lm-sensors +perl +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-xsloader
  37. endef
  38. define Package/libsensors
  39. $(call Package/lm-sensors/Default)
  40. SECTION:=libs
  41. CATEGORY:=Libraries
  42. TITLE:=libsensors
  43. endef
  44. define Package/lm-sensors/description
  45. utility to read hardware sensor data
  46. endef
  47. define Package/lm-sensors-detect/description
  48. script to autodetect sensor hardware
  49. endef
  50. define Package/libsensors/description
  51. lm-sensors libraries
  52. endef
  53. define Package/lm-sensors/conffiles
  54. /etc/sensors.conf
  55. /etc/sensors3.conf
  56. endef
  57. define Build/Compile
  58. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  59. $(TARGET_CONFIGURE_OPTS) \
  60. KERNELVERSION="$(LINUX_VERSION)" \
  61. LINUX="$(LINUX_DIR)" \
  62. CC="$(TARGET_CC)" \
  63. CFLAGS="$(TARGET_CFLAGS)" \
  64. CPPFLAGS="$(TARGET_CPPFLAGS)" \
  65. STAGING_DIR="$(STAGING_DIR)" \
  66. PREFIX="/usr" \
  67. MACHINE="$(ARCH)" \
  68. EXLDFLAGS="" \
  69. user
  70. endef
  71. define Build/InstallDev
  72. $(INSTALL_DIR) $(1)/usr/include/sensors
  73. $(CP) \
  74. $(PKG_BUILD_DIR)/lib/sensors.h \
  75. $(1)/usr/include/sensors
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) \
  78. $(PKG_BUILD_DIR)/lib/libsensors.{a,so*} \
  79. $(1)/usr/lib
  80. endef
  81. define Package/lm-sensors/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin
  84. ifeq ($(ARCH),i386)
  85. $(INSTALL_DIR) $(1)/etc
  86. $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
  87. endif
  88. $(INSTALL_DIR) $(1)/etc/init.d
  89. $(INSTALL_BIN) ./files/lm-sensors.init $(1)/etc/init.d/lm-sensors
  90. endef
  91. define Package/lm-sensors-detect/install
  92. $(INSTALL_DIR) $(1)/usr/sbin
  93. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin
  94. endef
  95. define Package/libsensors/install
  96. $(INSTALL_DIR) $(1)/usr/lib
  97. $(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib
  98. endef
  99. $(eval $(call BuildPackage,lm-sensors))
  100. $(eval $(call BuildPackage,lm-sensors-detect))
  101. $(eval $(call BuildPackage,libsensors))