source: packages/utils/rrdcollect/Makefile @ 28957

Last change on this file since 28957 was 28957, checked in by nico, 5 years ago

packages/rrdcollect: fix linking against rrdtool by splitting it into 2 packages

  • rrdcollect10, linked against rrdtool-1.0.x shared library
  • rrdcollect12, linked against rrdtool-1.2.x shared library
  • use new service functions
  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=rrdcollect
11PKG_VERSION:=0.2.4
12PKG_RELEASE:=3
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=@SF/rrdcollect
16PKG_MD5SUM:=fd7ac95195e3e5cbab0677629505d9be
17
18PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20PKG_INSTALL:=1
21
22include $(INCLUDE_DIR)/package.mk
23
24define Package/rrdcollect/Default
25  SECTION:=utils
26  CATEGORY:=Utilities
27  URL:=http://rrdcollect.sourceforge.net/
28endef
29
30define Package/rrdcollect/Default/description
31 RRDcollect is a daemon which polls ceratin files in /proc/
32 directory, gathering data and storing it inside RRDtool's
33 database files. Being written in C should be both fast
34 and resources-friendly. Supports both scanf(3)-style
35 pattern matches and perl compatible regular expressions.       
36endef
37
38define Package/rrdcollect10
39$(call Package/rrdcollect/Default)
40  TITLE:=Round-Robin Database (RRD) collecting daemon
41  PROVIDES:=rrdcollect
42  DEPENDS:=+librrd1
43  VARIANT:=rrdtool10
44endef
45
46define Package/rrdcollect10/description
47$(call Package/rrdcollect/Default/description)
48 .
49 This package contains the RRD collecting daemon, linked against
50 rrdtool-1.0.x shared library.
51endef
52
53define Package/rrdcollect12
54$(call Package/rrdcollect/Default)
55  TITLE:=Round-Robin Database (RRD) collecting daemon
56  PROVIDES:=rrdcollect
57  DEPENDS:=+librrd
58  VARIANT:=rrdtool12
59endef
60
61define Package/rrdcollect12/description
62$(call Package/rrdcollect/Default/description)
63 .
64 This package contains the RRD collecting daemon, linked against
65 rrdtool-1.2.x shared library.
66endef
67
68
69define Package/rrdcollect10-example
70$(call Package/rrdcollect/Default)
71  TITLE:=Example setup for RRD collecting daemon above
72  DEPENDS:=rrdcollect +rrdtool1
73  VARIANT:=rrdtool12
74endef
75
76define Package/rrdcollect10-example/description
77$(call Package/rrdcollect/Default/description)
78 .
79 This package contains examples for the RRD collecting daemon, using
80 rrdtool-1.0.x shared library and utilities.
81endef
82
83define Package/rrdcollect12-example
84$(call Package/rrdcollect/Default)
85  TITLE:=Example setup for RRD collecting daemon above
86  DEPENDS:=rrdcollect +rrdtool
87  VARIANT:=rrdtool12
88endef
89
90define Package/rrdcollect12-example/description
91$(call Package/rrdcollect/Default/description)
92 This package contains examples for the RRD collecting daemon, using
93 rrdtool-1.2.x shared library and utilities.
94endef
95
96
97CONFIGURE_ARGS+= \
98        --enable-shared \
99        --disable-static \
100        --disable-rpath \
101        --enable-exec \
102        --without-rrdtool \
103        --with-librrd \
104        --without-libpcre \
105        --without-libpcap \
106
107CONFIGURE_VARS+= \
108        CFLAGS="$(TARGET_CFLAGS) -DSOCKET_COMM" \
109
110EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
111
112ifeq ($(BUILD_VARIANT),rrdtool10)
113
114  TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.0/include $(TARGET_CPPFLAGS)
115  TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.0/lib $(TARGET_CPPFLAGS)
116
117endif
118
119ifeq ($(BUILD_VARIANT),rrdtool12)
120
121  TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/lib/rrdtool-1.2/include $(TARGET_CPPFLAGS)
122  TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/rrdtool-1.2/lib $(TARGET_CPPFLAGS)
123
124endif
125
126define Package/rrdcollect/install
127        $(INSTALL_DIR) $(1)/usr/sbin
128        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rrdcollect $(1)/usr/sbin/
129endef
130
131Package/rrdcollect10/install = $(Package/rrdcollect/install)
132Package/rrdcollect12/install = $(Package/rrdcollect/install)
133
134define Package/rrdcollect-example/conffiles
135/etc/rrd.conf
136/etc/rrdcollect.conf
137endef
138
139define Package/rrdcollect-example/install
140        $(INSTALL_DIR) $(1)/etc
141        $(INSTALL_DATA) ./files/rrd.conf $(1)/etc/
142        $(INSTALL_DATA) ./files/rrdcollect.conf $(1)/etc/
143        $(INSTALL_DIR) $(1)/etc/init.d
144        $(INSTALL_BIN) ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect
145        $(INSTALL_DIR) $(1)/usr/bin
146        $(INSTALL_BIN) ./files/rrd.sh $(1)/usr/bin/
147        $(INSTALL_DIR) $(1)/www/cgi-bin
148        ln -sf /var/lib/rrdcollect/rrd.cgi $(1)/www/cgi-bin/rrd.cgi
149        ln -sf /var/lib/rrdcollect/img $(1)/www/img
150endef
151
152Package/rrdcollect10-example/install = $(Package/rrdcollect-example/install)
153Package/rrdcollect12-example/install = $(Package/rrdcollect-example/install)
154
155$(eval $(call BuildPackage,rrdcollect10))
156$(eval $(call BuildPackage,rrdcollect10-example))
157$(eval $(call BuildPackage,rrdcollect12))
158$(eval $(call BuildPackage,rrdcollect12-example))
Note: See TracBrowser for help on using the repository browser.