2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
14 PKG_MD5SUM:=5e4305c612bc3cccbaf802c275c81a11
16 PKG_SOURCE_URL:=@SF/rrdcollect
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23 ifneq ($(BR2_PACKAGE_LIBRRD),)
24 RRDTOOL_LIBS:=-lart_lgpl_2 -lfreetype -lpng
27 include $(INCLUDE_DIR)/package.mk
29 define Package/rrdcollect
33 TITLE:=Round-Robin Database (RRD) collecting daemon
34 DESCRIPTION:=RRDcollect is a daemon which polls ceratin files in /proc/\\\
35 directory, gathering data and storing it inside RRDtool's\\\
36 database files. Being written in C should be both fast\\\
37 and resources-friendly. Supports both scanf(3)-style\\\
38 pattern matches and perl compatible regular expressions.\\\
39 URL:=http://rrdcollect.sourceforge.net/
43 define Package/rrdcollect-example
47 TITLE:=Example setup for RRD collecting daemon above
48 DESCRIPTION:=RRDcollect is a daemon which polls ceratin files in /proc/\\\
49 directory, gathering data and storing it inside RRDtool's\\\
50 database files. Being written in C should be both fast\\\
51 and resources-friendly. Supports both scanf(3)-style\\\
52 pattern matches and perl compatible regular expressions.\\\
53 URL:=http://rrdcollect.sourceforge.net/
56 define Package/rrdcollect-example/conffiles
61 define Build/Configure
62 $(call Build/Configure/Default,--enable-shared \
70 --without-libpcap, CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
71 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
72 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
73 LIBS="$(RRDTOOL_LIBS) -lz" \
74 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
75 ac_cv_func_malloc_0_nonnull=yes)
79 rm -rf $(PKG_INSTALL_DIR)
80 mkdir -p $(PKG_INSTALL_DIR)
81 $(MAKE) -C $(PKG_BUILD_DIR) \
82 DESTDIR="$(PKG_INSTALL_DIR)" \
86 define Package/rrdcollect/install
87 install -d -m0755 $(1)/usr/sbin
88 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/
91 define Package/rrdcollect-example/install
92 install -d -m0755 $(1)/etc
93 install -m0644 ./files/rrd.conf $(1)/etc/
94 install -m0644 ./files/rrdcollect.conf $(1)/etc/
95 install -d -m0755 $(1)/etc/init.d
96 install -m0755 ./files/rrdcollect.init $(1)/etc/init.d/S98rrdcollect
97 install -d -m0755 $(1)/usr/bin
98 install -m0755 ./files/rrd.sh $(1)/usr/bin/
99 install -d -m0755 $(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
104 $(eval $(call BuildPackage,rrdcollect))
105 $(eval $(call BuildPackage,rrdcollect-example))