replace lots of manual install commands with INSTALL_* variables
[packages.git] / utils / collectd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=collectd
12 PKG_VERSION:=3.5.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://verplant.org/collectd/files
17 PKG_MD5SUM:=46a4b81e46d3bb58faab1d603649d737
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/collectd
26   SECTION:=utils
27   CATEGORY:=Utilities
28   TITLE:=Lightweight system statistics collection daemon
29   URL:=http://verplant.org/collectd/
30 endef
31
32 define Build/Compile
33         $(call Build/Configure/Default, \
34                 --disable-debug \
35                 --enable-cpu \
36                 --enable-load \
37                 --enable-memory \
38                 --enable-ping \
39                 --enable-traffic \
40                 --disable-cpufreq \
41                 --disable-disk \
42                 --disable-hddtemp \
43                 --disable-nfs \
44                 --disable-processes \
45                 --disable-sensors \
46                 --disable-serial \
47                 --disable-swap \
48                 --disable-tape \
49                 --disable-users \
50         )
51 endef
52
53 define Build/Compile
54         $(MAKE) -C $(PKG_BUILD_DIR) \
55                 DESTDIR="$(PKG_INSTALL_DIR)" \
56                 all install
57 endef
58
59 define Package/collectd/install
60         $(INSTALL_DIR) $(1)/usr/sbin
61         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
62         $(INSTALL_DIR) $(1)/usr/lib/collectd
63         $(CP) $(PKG_INSTALL_DIR)/usr/lib/collectd/*.so $(1)/usr/lib/collectd/
64         $(INSTALL_DIR) $(1)/etc/init.d
65         $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
66 endef
67
68 $(eval $(call BuildPackage,collectd))