Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / utils / smartmontools / Makefile
1 #
2 # Copyright (C) 2006-2016 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.5
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/smartmontools
17 PKG_HASH:=89e8bb080130bc6ce148573ba5bb91bfe30236b64b1b5bbca26515d4b5c945bc
18 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
19 PKG_LICENSE:=GPL-2.0+
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_FIXUP:=autoreconf
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/smartmontools/Default
27 SECTION:=utils
28 CATEGORY:=Utilities
29 DEPENDS:=$(CXX_DEPENDS)
30 TITLE:=S.M.A.R.T Monitoring
31 URL:=http://smartmontools.sourceforge.net/
32 endef
33
34 define Package/smartmontools
35 $(call Package/smartmontools/Default)
36 TITLE+= Tool
37 endef
38
39 define Package/smartmontools/description
40 smartmontools contains utility programs (smartctl) to
41 control/monitor storage systems using the Self-Monitoring, Analysis
42 and Reporting Technology System (S.M.A.R.T.) built into most modern
43 ATA and SCSI disks. It is derived from smartsuite.
44 endef
45
46 define Package/smartd
47 $(call Package/smartmontools/Default)
48 TITLE+= Daemon
49 endef
50
51 define Package/smartd/description
52 smartmontools contains utility programs (smartd) to
53 control/monitor storage systems using the Self-Monitoring, Analysis
54 and Reporting Technology System (S.M.A.R.T.) built into most modern
55 ATA and SCSI disks. It is derived from smartsuite.
56 endef
57
58 ifeq ($(CONFIG_USE_UCLIBCXX),y)
59 UCXXCFLAGS:=-fno-builtin -fno-rtti -nostdinc++
60 UCXXCPPFLAGS:=-I$(STAGING_DIR)/usr/include/uClibc++
61 UCXXLIBS:=-nodefaultlibs -lc -luClibc++
62 endif
63
64 CONFIGURE_VARS += \
65 CXXFLAGS="$$$$CXXFLAGS $(UCXXCFLAGS)" \
66 CPPFLAGS="$$$$CPPFLAGS $(UCXXCPPFLAGS) -I$(LINUX_DIR)/include" \
67 LDFLAGS="$$$$LDFLAGS" \
68 LIBS="$(UCXXLIBS) -lm $(LIBGCC_S) -lc" \
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))