a2a90f1fdc2525308068a48f06fb34e226f094db
[packages.git] / utils / rrdcollect / 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:=rrdcollect
12 PKG_VERSION:=0.2.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/rrdcollect
17 PKG_MD5SUM:=5e4305c612bc3cccbaf802c275c81a11
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/rrdcollect/Default
26   SECTION:=utils
27   CATEGORY:=Utilities
28   DESCRIPTION:=\
29         RRDcollect is a daemon which polls ceratin files in /proc/ \\\
30         directory, gathering data and storing it inside RRDtool's \\\
31         database files.  Being written in C should be both fast \\\
32         and resources-friendly.  Supports both scanf(3)-style \\\
33         pattern matches and perl compatible regular expressions.
34   URL:=http://rrdcollect.sourceforge.net/
35 endef
36
37 define Package/rrdcollect
38   $(call Package/rrdcollect/Default)
39   DEPENDS:=+librrd1
40   TITLE:=Round-Robin Database (RRD) collecting daemon
41   DESCRIPTION+=\\\
42         \\\
43         This package contains the RRD collecting daemon.
44   MENU:=1
45 endef
46
47 define Package/rrdcollect-example
48   $(call Package/rrdcollect/Default)
49   DEPENDS:=rrdcollect
50   TITLE:=Example setup for RRD collecting daemon above
51   DESCRIPTION+=\\\
52         \\\
53         This package contains examples for the RRD collecting daemon.
54 endef
55
56 define Package/rrdcollect-example/conffiles
57 /etc/rrd.conf
58 /etc/rrdcollect.conf
59 endef
60
61 define Build/Configure
62         $(call Build/Configure/Default, \
63                 --enable-shared \
64                 --disable-static \
65                 --disable-rpath \
66                 --enable-exec \
67                 --without-rrdtool \
68                 --with-librrd \
69                 --without-libpcre \
70                 --without-libpcap \
71                 , \
72                 CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
73                 LIBS="-lz" \
74         )
75 endef
76
77 define Build/Compile    
78         $(MAKE) -C $(PKG_BUILD_DIR) \
79                 DESTDIR="$(PKG_INSTALL_DIR)" \
80                 all install
81 endef
82
83 define Package/rrdcollect/install       
84         $(INSTALL_DIR) $(1)/usr/sbin
85         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/
86 endef
87
88 define Package/rrdcollect-example/install       
89         $(INSTALL_DIR) $(1)/etc
90         $(INSTALL_DATA) ./files/rrd.conf $(1)/etc/
91         $(INSTALL_DATA) ./files/rrdcollect.conf $(1)/etc/
92         $(INSTALL_DIR) $(1)/etc/init.d
93         $(INSTALL_BIN) ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect
94         $(INSTALL_DIR) $(1)/usr/bin
95         $(INSTALL_BIN) ./files/rrd.sh $(1)/usr/bin/
96         $(INSTALL_DIR) $(1)/www/cgi-bin
97         ln -sf /var/lib/rrdcollect/rrd.cgi $(1)/www/cgi-bin/rrd.cgi
98         ln -sf /var/lib/rrdcollect/img $(1)/www/img
99 endef
100
101 $(eval $(call BuildPackage,rrdcollect))
102 $(eval $(call BuildPackage,rrdcollect-example))