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