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.

127 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.5.0
  10. PKG_RELEASE:=3
  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:=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 \
  37. +PACKAGE_lm-sensors-detect:perl \
  38. +PACKAGE_lm-sensors-detect:perlbase-essential \
  39. +PACKAGE_lm-sensors-detect:perlbase-fcntl \
  40. +PACKAGE_lm-sensors-detect:perlbase-file \
  41. +PACKAGE_lm-sensors-detect:perlbase-xsloader
  42. endef
  43. define Package/libsensors
  44. $(call Package/lm-sensors/Default)
  45. SECTION:=libs
  46. CATEGORY:=Libraries
  47. TITLE:=libsensors
  48. ABI_VERSION:=5
  49. endef
  50. define Package/lm-sensors/description
  51. utility to read hardware sensor data
  52. endef
  53. define Package/lm-sensors-detect/description
  54. script to autodetect sensor hardware
  55. endef
  56. define Package/libsensors/description
  57. lm-sensors libraries
  58. endef
  59. define Package/lm-sensors/conffiles
  60. /etc/sensors.conf
  61. /etc/sensors3.conf
  62. endef
  63. define Build/Compile
  64. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  65. $(TARGET_CONFIGURE_OPTS) \
  66. KERNELVERSION="$(LINUX_VERSION)" \
  67. LINUX="$(LINUX_DIR)" \
  68. CC="$(TARGET_CC)" \
  69. CFLAGS="$(TARGET_CFLAGS)" \
  70. CPPFLAGS="$(TARGET_CPPFLAGS)" \
  71. STAGING_DIR="$(STAGING_DIR)" \
  72. PREFIX="/usr" \
  73. MACHINE="$(ARCH)" \
  74. EXLDFLAGS="" \
  75. user
  76. endef
  77. define Build/InstallDev
  78. $(INSTALL_DIR) $(1)/usr/include/sensors
  79. $(CP) \
  80. $(PKG_BUILD_DIR)/lib/sensors.h \
  81. $(1)/usr/include/sensors
  82. $(INSTALL_DIR) $(1)/usr/lib
  83. $(CP) \
  84. $(PKG_BUILD_DIR)/lib/libsensors.{a,so*} \
  85. $(1)/usr/lib
  86. endef
  87. define Package/lm-sensors/install
  88. $(INSTALL_DIR) $(1)/usr/sbin
  89. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin
  90. ifeq ($(ARCH),i386)
  91. $(INSTALL_DIR) $(1)/etc
  92. $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
  93. endif
  94. $(INSTALL_DIR) $(1)/etc/init.d
  95. $(INSTALL_BIN) ./files/lm-sensors.init $(1)/etc/init.d/lm-sensors
  96. endef
  97. define Package/lm-sensors-detect/install
  98. $(INSTALL_DIR) $(1)/usr/sbin
  99. $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin
  100. endef
  101. define Package/libsensors/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib
  104. endef
  105. $(eval $(call BuildPackage,lm-sensors))
  106. $(eval $(call BuildPackage,lm-sensors-detect))
  107. $(eval $(call BuildPackage,libsensors))