5b98d58e9c623e01426d76f8eb2c6b898531ddc1
[openwrt/svn-archive/archive.git] / utils / smartmontools / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=smartmontools
11 PKG_VERSION:=5.40
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/smartmontools
16 PKG_MD5SUM:=0f0be0239914ad87830a4fff594bda5b
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/smartmontools
21 SECTION:=utils
22 CATEGORY:=Utilities
23 DEPENDS:=+uclibcxx
24 TITLE:=S.M.A.R.T Monitoring Tool
25 URL:=http://smartmontools.sourceforge.net/
26 endef
27
28 define Package/smartmontools/description
29 smartmontools contains utility programs (smartctl, smartd) to
30 control/monitor storage systems using the Self-Monitoring, Analysis
31 and Reporting Technology System (S.M.A.R.T.) built into most modern
32 ATA and SCSI disks. It is derived from smartsuite.
33 endef
34
35 # uses GNU configure
36
37 define Build/Configure
38 (cd $(PKG_BUILD_DIR); \
39 ./autogen.sh \
40 ./configure \
41 CC="$(TARGET_CC)" \
42 CXX="$(TARGET_CXX)" \
43 CPP="$(TARGET_CPP)" \
44 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
45 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \
46 LDFLAGS="$$$$LDFLAGS" \
47 LIBS="-nodefaultlibs -luClibc++ -lm $(LIBGCC_S) -lc" \
48 --prefix=/usr \
49 --build=$(GNU_BUILD_NAME) \
50 --host=$(GNU_HOST_NAME) \
51 --target=$(GNU_TARGET_NAME) \
52 );
53 $(call Build/Configure/Default,, \
54 )
55 endef
56
57 define Build/Compile
58 $(MAKE) -C $(PKG_BUILD_DIR)
59 endef
60
61 define Package/smartmontools/install
62 $(INSTALL_DIR) $(1)/usr/sbin
63 $(INSTALL_BIN) $(PKG_BUILD_DIR)/smartctl $(1)/usr/sbin/
64 $(INSTALL_BIN) $(PKG_BUILD_DIR)/smartd $(1)/usr/sbin/
65 $(INSTALL_DIR) $(1)/etc
66 $(INSTALL_DATA) ./files/smartd.conf $(1)/etc
67 $(INSTALL_DIR) $(1)/etc/init.d
68 $(INSTALL_BIN) ./files/smartd.init $(1)/etc/init.d/smartd
69 endef
70
71 $(eval $(call BuildPackage,smartmontools))