cleanup
[openwrt/svn-archive/archive.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 PKG_MD5SUM:=5e4305c612bc3cccbaf802c275c81a11
15
16 PKG_SOURCE_URL:=@SF/rrdcollect
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
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 ifneq ($(BR2_PACKAGE_LIBRRD),)
24 RRDTOOL_LIBS:=-lart_lgpl_2 -lfreetype -lpng
25 endif
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/rrdcollect
30 SECTION:=utils
31 CATEGORY:=Utilities
32 DEPENDS:=+librrd1
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/
40 MENU:=1
41 endef
42
43 define Package/rrdcollect-example
44 SECTION:=utils
45 CATEGORY:=Utilities
46 DEPENDS:=rrdcollect
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/
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 --with-gnu-ld \
67 --enable-exec \
68 --without-rrdtool \
69 --with-librrd \
70 --without-libpcre \
71 --without-libpcap, \
72 CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
73 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
74 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
75 LIBS="$(RRDTOOL_LIBS) -lz" \
76 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
77 )
78 endef
79
80 define Build/Compile
81 rm -rf $(PKG_INSTALL_DIR)
82 mkdir -p $(PKG_INSTALL_DIR)
83 $(MAKE) -C $(PKG_BUILD_DIR) \
84 DESTDIR="$(PKG_INSTALL_DIR)" \
85 all install
86 endef
87
88 define Package/rrdcollect/install
89 install -d -m0755 $(1)/usr/sbin
90 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/
91 endef
92
93 define Package/rrdcollect-example/install
94 install -d -m0755 $(1)/etc
95 install -m0644 ./files/rrd.conf $(1)/etc/
96 install -m0644 ./files/rrdcollect.conf $(1)/etc/
97 install -d -m0755 $(1)/etc/init.d
98 install -m0755 ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect
99 install -d -m0755 $(1)/usr/bin
100 install -m0755 ./files/rrd.sh $(1)/usr/bin/
101 install -d -m0755 $(1)/www/cgi-bin
102 ln -sf /var/lib/rrdcollect/rrd.cgi $(1)/www/cgi-bin/rrd.cgi
103 ln -sf /var/lib/rrdcollect/img $(1)/www/img
104 endef
105
106 $(eval $(call BuildPackage,rrdcollect))
107 $(eval $(call BuildPackage,rrdcollect-example))