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.

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