[packages] lm-sensors: update to 3.3.2
[openwrt/svn-archive/archive.git] / utils / lm-sensors / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lm-sensors
11 PKG_VERSION:=3.3.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=lm_sensors-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://dl.lm-sensors.org/lm-sensors/releases
16 PKG_MD5SUM:=f357ba00b080ab102a170f7bf8bb2578
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/lm_sensors-$(PKG_VERSION)
19 PKG_BUILD_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/lm-sensors/Default
24 DEPENDS:=+sysfsutils
25 URL:=http://www.lm-sensors.org/
26 endef
27
28 define Package/lm-sensors
29 $(call Package/lm-sensors/Default)
30 SECTION:=utils
31 CATEGORY:=Utilities
32 TITLE:=lm-sensors
33 DEPENDS+=+libsensors
34 endef
35
36 define Package/lm-sensors-detect
37 $(call Package/lm-sensors/Default)
38 SECTION:=utils
39 CATEGORY:=Utilities
40 TITLE:=lm-sensors-detect
41 DEPENDS+=+lm-sensors +perl +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-xsloader
42 endef
43
44 define Package/libsensors
45 $(call Package/lm-sensors/Default)
46 SECTION:=libs
47 CATEGORY:=Libraries
48 TITLE:=libsensors
49 endef
50
51 define Package/lm-sensors/description
52 utility to read hardware sensor data
53 endef
54
55 define Package/lm-sensors-detect/description
56 script to autodetect sensor hardware
57 endef
58
59 define Package/libsensors/description
60 lm-sensors libraries
61 endef
62
63 define Package/lm-sensors/conffiles
64 /etc/sensors.conf
65 endef
66
67 define Build/Compile
68 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
69 $(TARGET_CONFIGURE_OPTS) \
70 KERNELVERSION="$(LINUX_VERSION)" \
71 LINUX="$(LINUX_DIR)" \
72 CC="$(TARGET_CC)" \
73 STAGING_DIR="$(STAGING_DIR)" \
74 PREFIX="/usr" \
75 MACHINE="$(ARCH)" \
76 user
77 endef
78
79 define Build/InstallDev
80 $(INSTALL_DIR) $(1)/usr/include/sensors
81 $(CP) \
82 $(PKG_BUILD_DIR)/lib/sensors.h \
83 $(1)/usr/include/sensors
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) \
86 $(PKG_BUILD_DIR)/lib/libsensors.{a,so*} \
87 $(1)/usr/lib
88 endef
89
90 define Package/lm-sensors/install
91 $(INSTALL_DIR) $(1)/usr/sbin
92 $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin
93 ifeq ($(ARCH),i386)
94 $(INSTALL_DIR) $(1)/etc
95 $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
96 endif
97 endef
98
99 define Package/lm-sensors-detect/install
100 $(INSTALL_DIR) $(1)/usr/sbin
101 $(INSTALL_BIN) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin
102 endef
103
104 define Package/libsensors/install
105 $(INSTALL_DIR) $(1)/usr/lib
106 $(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib
107 endef
108
109 $(eval $(call BuildPackage,lm-sensors))
110 $(eval $(call BuildPackage,lm-sensors-detect))
111 $(eval $(call BuildPackage,libsensors))