massive Makefile cleanup, add missing 'svn:keywords' property
[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
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
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 --with-gnu-ld \
67 --enable-exec \
68 --without-rrdtool \
69 --with-librrd \
70 --without-libpcre \
71 --without-libpcap \
72 , \
73 CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
74 LIBS="-lz" \
75 )
76 endef
77
78 define Build/Compile
79 $(MAKE) -C $(PKG_BUILD_DIR) \
80 DESTDIR="$(PKG_INSTALL_DIR)" \
81 all install
82 endef
83
84 define Package/rrdcollect/install
85 install -d -m0755 $(1)/usr/sbin
86 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/
87 endef
88
89 define Package/rrdcollect-example/install
90 install -d -m0755 $(1)/etc
91 install -m0644 ./files/rrd.conf $(1)/etc/
92 install -m0644 ./files/rrdcollect.conf $(1)/etc/
93 install -d -m0755 $(1)/etc/init.d
94 install -m0755 ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect
95 install -d -m0755 $(1)/usr/bin
96 install -m0755 ./files/rrd.sh $(1)/usr/bin/
97 install -d -m0755 $(1)/www/cgi-bin
98 ln -sf /var/lib/rrdcollect/rrd.cgi $(1)/www/cgi-bin/rrd.cgi
99 ln -sf /var/lib/rrdcollect/img $(1)/www/img
100 endef
101
102 $(eval $(call BuildPackage,rrdcollect))
103 $(eval $(call BuildPackage,rrdcollect-example))