Browse Source

smartmontools: import from packages, update to the latest release

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
Maxim Storchak 10 years ago
parent
commit
4be8af07c2

+ 95
- 0
utils/smartmontools/Makefile View File

@@ -0,0 +1,95 @@
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
+include $(INCLUDE_DIR)/uclibc++.mk
10
+
11
+PKG_NAME:=smartmontools
12
+PKG_VERSION:=6.2
13
+PKG_RELEASE:=1
14
+
15
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16
+PKG_SOURCE_URL:=@SF/smartmontools
17
+PKG_MD5SUM:=d44f84081a12cef79cd17f78044351fc
18
+PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/smartmontools/Default
23
+  SECTION:=utils
24
+  CATEGORY:=Utilities
25
+  DEPENDS:=$(CXX_DEPENDS)
26
+  TITLE:=S.M.A.R.T Monitoring
27
+  URL:=http://smartmontools.sourceforge.net/
28
+endef
29
+
30
+define Package/smartmontools
31
+  $(call Package/smartmontools/Default)
32
+  TITLE+= Tool
33
+endef
34
+
35
+define Package/smartmontools/description
36
+  smartmontools contains utility programs (smartctl) to
37
+  control/monitor storage systems using the Self-Monitoring, Analysis
38
+  and Reporting Technology System (S.M.A.R.T.) built into most modern
39
+  ATA and SCSI disks. It is derived from smartsuite.
40
+endef
41
+
42
+define Package/smartd
43
+  $(call Package/smartmontools/Default)
44
+  DEPENDS+= +rsync
45
+  TITLE+= Daemon
46
+endef
47
+
48
+define Package/smartd/description
49
+  smartmontools contains utility programs (smartd) to
50
+  control/monitor storage systems using the Self-Monitoring, Analysis
51
+  and Reporting Technology System (S.M.A.R.T.) built into most modern
52
+  ATA and SCSI disks. It is derived from smartsuite.
53
+endef
54
+
55
+# uses GNU configure
56
+
57
+CONFIGURE_VARS += \
58
+	CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
59
+	CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \
60
+	LDFLAGS="$$$$LDFLAGS" \
61
+	LIBS="-nodefaultlibs -lc -luClibc++ -lm $(LIBGCC_S) -lc" \
62
+
63
+define Build/Configure
64
+	(cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
65
+		./autogen.sh \
66
+	);
67
+	$(call Build/Configure/Default)
68
+endef
69
+
70
+define Build/Compile
71
+	$(MAKE) -C $(PKG_BUILD_DIR) \
72
+		BUILD_INFO='"(localbuild)"' \
73
+		LD="$(TARGET_CXX)"
74
+endef
75
+
76
+define Package/smartmontools/install
77
+	$(INSTALL_DIR) $(1)/usr/sbin
78
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/smartctl $(1)/usr/sbin/
79
+endef
80
+
81
+define Package/smartd/install
82
+	$(INSTALL_DIR) $(1)/usr/sbin
83
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/smartd $(1)/usr/sbin/
84
+	$(INSTALL_DIR) $(1)/etc
85
+	$(INSTALL_DATA) ./files/smartd.conf $(1)/etc/
86
+	$(INSTALL_DIR) $(1)/etc/init.d
87
+	$(INSTALL_BIN) ./files/smartd.init $(1)/etc/init.d/smartd
88
+endef
89
+
90
+define Package/smartd/conffiles
91
+/etc/smartd.conf
92
+endef
93
+
94
+$(eval $(call BuildPackage,smartmontools))
95
+$(eval $(call BuildPackage,smartd))

+ 1
- 0
utils/smartmontools/files/smartd.conf View File

@@ -0,0 +1 @@
1
+/dev/hdb -H

+ 16
- 0
utils/smartmontools/files/smartd.init View File

@@ -0,0 +1,16 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=95
5
+
6
+start() {
7
+	service_start /usr/sbin/smartd -q never
8
+}
9
+
10
+stop() {
11
+	service_stop /usr/sbin/smartd
12
+}
13
+
14
+reload() {
15
+	service_reload /usr/sbin/smartd
16
+}