Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.3.5
  10. PKG_RELEASE:=4
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/groeck/lm-sensors.git
  13. PKG_SOURCE_VERSION:=f8cdcc35bff0785aecf49d9a8484a71ce3ebee4f
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  16. PKG_MIRROR_HASH:=892e9e2eed78e27fb7a08e8ce78b1164a3d101ba79a9e04f1c1273940d48cf17
  17. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  18. PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/lm-sensors/Default
  22. DEPENDS:=+sysfsutils
  23. URL:=http://www.lm-sensors.org/
  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 +perl +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-xsloader
  38. endef
  39. define Package/libsensors
  40. $(call Package/lm-sensors/Default)
  41. SECTION:=libs
  42. CATEGORY:=Libraries
  43. TITLE:=libsensors
  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))