aboutsummaryrefslogtreecommitdiff
path: root/utils/smartmontools/Makefile
blob: 6a5198eb2751a37fdc4a629c9f93b001c29cc28b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=smartmontools
PKG_VERSION:=7.2
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/smartmontools
PKG_HASH:=5cd98a27e6393168bc6aaea070d9e1cd551b0f898c52f66b2ff2e5d274118cd6

PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING

PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/smartmontools/Default
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=S.M.A.R.T Monitoring
  URL:=https://www.smartmontools.org/
endef

define Package/smartmontools
  $(call Package/smartmontools/Default)
  DEPENDS:=+libstdcpp
  TITLE+= Tool
endef

define Package/smartmontools/description
  smartmontools contains utility programs (smartctl) to
  control/monitor storage systems using the Self-Monitoring, Analysis
  and Reporting Technology System (S.M.A.R.T.) built into most modern
  ATA and SCSI disks. It is derived from smartsuite.
endef

define Package/smartd
  $(call Package/smartmontools/Default)
  DEPENDS:=+libstdcpp
  TITLE+= Daemon
endef

define Package/smartd/description
  smartmontools contains utility programs (smartd) to
  control/monitor storage systems using the Self-Monitoring, Analysis
  and Reporting Technology System (S.M.A.R.T.) built into most modern
  ATA and SCSI disks. It is derived from smartsuite.
endef

define Package/smartmontools-drivedb
  $(call Package/smartmontools/Default)
  TITLE+= Drive database
  PKGARCH=all
endef

define Package/smartmontools-drivedb/description
  Database of known drives and USB bridges for smartctl and smartd.
endef

define Package/smartd-mail
  $(call Package/smartmontools/Default)
  TITLE+= Email notifications
  PKGARCH=all
  DEPENDS+= +smartd +nail +msmtp-mta
endef

define Package/smartd-mail/description
  A script for mailing about SMART issues
endef

TARGET_LDFLAGS += -flto

TARGET_CXXFLAGS +=-fno-rtti -flto
MAKE_FLAGS +=BUILD_INFO='"(localbuild)"'

CONFIGURE_ARGS += \
	--disable-fast-lebe \
	--without-gnupg \
	--without-libcap-ng \
	--without-libsystemd

#lower file size vs. CONFIGURE_ARGS
CONFIGURE_VARS += \
	with_cxx11_regex=yes \
	with_smartdplugindir=no \
	with_systemdenvfile=no \
	with_systemdsystemunitdir=no \
	with_update_smart_drivedb=no

define Package/smartmontools/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smartctl $(1)/usr/sbin/
endef

define Package/smartd/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smartd $(1)/usr/sbin/
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_DATA) ./files/smartd.conf $(1)/etc/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/smartd.init $(1)/etc/init.d/smartd
endef

define Package/smartmontools-drivedb/install
	$(INSTALL_DIR) $(1)/usr/share/smartmontools/
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/smartmontools/drivedb.h $(1)/usr/share/smartmontools/
endef

define Package/smartd-mail/install
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/smartd_warning.sh $(1)/etc
endef

define Package/smartd/conffiles
/etc/smartd.conf
endef

$(eval $(call BuildPackage,smartmontools))
$(eval $(call BuildPackage,smartd))
$(eval $(call BuildPackage,smartmontools-drivedb))
$(eval $(call BuildPackage,smartd-mail))