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.

128 lines
3.1 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.6.0
  10. PKG_RELEASE:=1
  11. PKG_VERSION_SUBST=$(subst .,-,$(PKG_VERSION))
  12. PKG_SOURCE_URL:=https://codeload.github.com/lm-sensors/lm-sensors/tar.gz/V$(PKG_VERSION_SUBST)?
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_HASH:=0591f9fa0339f0d15e75326d0365871c2d4e2ed8aa1ff759b3a55d3734b7d197
  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-or-later LGPL-2.1-or-later
  18. PKG_CPE_ID:=cpe:/a:lm_sensors:lm_sensors
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/lm-sensors/Default
  22. DEPENDS:=+sysfsutils
  23. URL:=https://hwmon.wiki.kernel.org/lm_sensors
  24. endef
  25. define Package/lm-sensors
  26. $(call Package/lm-sensors/Default)
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. TITLE:=lm-sensors
  30. DEPENDS+=+libsensors
  31. endef
  32. define Package/lm-sensors-detect
  33. $(call Package/lm-sensors/Default)
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. TITLE:=lm-sensors-detect
  37. DEPENDS+=+lm-sensors \
  38. +PACKAGE_lm-sensors-detect:perl \
  39. +PACKAGE_lm-sensors-detect:perlbase-essential \
  40. +PACKAGE_lm-sensors-detect:perlbase-fcntl \
  41. +PACKAGE_lm-sensors-detect:perlbase-file \
  42. +PACKAGE_lm-sensors-detect:perlbase-xsloader
  43. endef
  44. define Package/libsensors
  45. $(call Package/lm-sensors/Default)
  46. SECTION:=libs
  47. CATEGORY:=Libraries
  48. TITLE:=libsensors
  49. ABI_VERSION:=5
  50. endef
  51. define Package/lm-sensors/description
  52. utility to read hardware sensor data
  53. endef
  54. define Package/lm-sensors-detect/description
  55. script to autodetect sensor hardware
  56. endef
  57. define Package/libsensors/description
  58. lm-sensors libraries
  59. endef
  60. define Package/lm-sensors/conffiles
  61. /etc/sensors.conf
  62. /etc/sensors3.conf
  63. endef
  64. define Build/Compile
  65. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  66. $(TARGET_CONFIGURE_OPTS) \
  67. KERNELVERSION="$(LINUX_VERSION)" \
  68. LINUX="$(LINUX_DIR)" \
  69. CC="$(TARGET_CC)" \
  70. CFLAGS="$(TARGET_CFLAGS)" \
  71. CPPFLAGS="$(TARGET_CPPFLAGS)" \
  72. STAGING_DIR="$(STAGING_DIR)" \
  73. PREFIX="/usr" \
  74. MACHINE="$(ARCH)" \
  75. EXLDFLAGS="" \
  76. user
  77. endef
  78. define Build/InstallDev
  79. $(INSTALL_DIR) $(1)/usr/include/sensors
  80. $(CP) \
  81. $(PKG_BUILD_DIR)/lib/sensors.h \
  82. $(1)/usr/include/sensors
  83. $(INSTALL_DIR) $(1)/usr/lib
  84. $(CP) \
  85. $(PKG_BUILD_DIR)/lib/libsensors.{a,so*} \
  86. $(1)/usr/lib
  87. endef
  88. define Package/lm-sensors/install
  89. $(INSTALL_DIR) $(1)/usr/sbin
  90. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin
  91. ifeq ($(ARCH),i386)
  92. $(INSTALL_DIR) $(1)/etc
  93. $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
  94. endif
  95. $(INSTALL_DIR) $(1)/etc/init.d
  96. $(INSTALL_BIN) ./files/lm-sensors.init $(1)/etc/init.d/lm-sensors
  97. endef
  98. define Package/lm-sensors-detect/install
  99. $(INSTALL_DIR) $(1)/usr/sbin
  100. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin
  101. endef
  102. define Package/libsensors/install
  103. $(INSTALL_DIR) $(1)/usr/lib
  104. $(CP) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib
  105. endef
  106. $(eval $(call BuildPackage,lm-sensors))
  107. $(eval $(call BuildPackage,lm-sensors-detect))
  108. $(eval $(call BuildPackage,libsensors))