summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-04-22 16:28:16 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2013-04-26 10:00:32 +0200
commit2fc71a181eeea1ef393ad1ca7bde0a5f5de5c5ad (patch)
tree18eec77a319ca57d26ed75dfbe1afc7429edae8a /meta-oe
parent9e7327e446d16a8bd70f93d5d68cdf267e3d2106 (diff)
downloadmeta-openembedded-2fc71a181eeea1ef393ad1ca7bde0a5f5de5c5ad.tar.gz
collectd: add recipe for 5.2.2
Based on initial version by Koen Kooi <koen@beagleboard.org>. Initscript borrowed from Debian with some tweaks. Note that since collectd uses libltdl, building this successfully required OE-Core commit db84eaf851b22b262d9dc48eb55bd5224a00fdd2 or else you get an error about "config/compile" being missing. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-extended/collectd/collectd/collectd-version.patch31
-rw-r--r--meta-oe/recipes-extended/collectd/collectd/collectd.init201
-rw-r--r--meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch30
-rw-r--r--meta-oe/recipes-extended/collectd/collectd_5.2.2.bb45
4 files changed, 307 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch b/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch
new file mode 100644
index 0000000000..1e2b7c159c
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch
@@ -0,0 +1,31 @@
1Don't pick up version string from parent git repository
2
3If the collectd source is extracted from a tarball underneath a
4directory structure that includes another git repository, that
5repository will be picked up by "git describe" which is not
6desirable. Check whether collectd itself is a git repository and just
7use the default version if not.
8
9Upstream-Status: Pending
10
11Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
12
13diff --git a/version-gen.sh b/version-gen.sh
14index e344541..d1c0929 100755
15--- a/version-gen.sh
16+++ b/version-gen.sh
17@@ -2,7 +2,10 @@
18
19 DEFAULT_VERSION="5.2.2.git"
20
21-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
22+VERSION=""
23+if test -d .git ; then
24+ VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
25+fi
26
27 if test -z "$VERSION"; then
28 VERSION="$DEFAULT_VERSION"
29--
301.7.10.4
31
diff --git a/meta-oe/recipes-extended/collectd/collectd/collectd.init b/meta-oe/recipes-extended/collectd/collectd/collectd.init
new file mode 100644
index 0000000000..abdb194a35
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd/collectd.init
@@ -0,0 +1,201 @@
1#!/bin/sh
2#
3# collectd - start and stop the statistics collection daemon
4# http://collectd.org/
5#
6# Copyright (C) 2005-2006 Florian Forster <octo@verplant.org>
7# Copyright (C) 2006-2009 Sebastian Harl <tokkee@debian.org>
8#
9
10### BEGIN INIT INFO
11# Provides: collectd
12# Required-Start: $local_fs $remote_fs
13# Required-Stop: $local_fs $remote_fs
14# Should-Start: $network $named $syslog $time cpufrequtils
15# Should-Stop: $network $named $syslog
16# Default-Start: 2 3 4 5
17# Default-Stop: 0 1 6
18# Short-Description: manage the statistics collection daemon
19# Description: collectd is the statistics collection daemon.
20# It is a small daemon which collects system information
21# periodically and provides mechanisms to monitor and store
22# the values in a variety of ways.
23### END INIT INFO
24
25. /etc/init.d/functions
26
27export PATH=/sbin:/bin:/usr/sbin:/usr/bin
28
29DISABLE=0
30
31NAME=collectd
32DAEMON=/usr/sbin/collectd
33
34CONFIGFILE=/etc/collectd.conf
35PIDFILE=/var/run/collectd.pid
36
37USE_COLLECTDMON=1
38COLLECTDMON_DAEMON=/usr/sbin/collectdmon
39COLLECTDMON_PIDFILE=/var/run/collectdmon.pid
40
41MAXWAIT=30
42
43# Gracefully exit if the package has been removed.
44test -x $DAEMON || exit 0
45
46if [ -r /etc/default/$NAME ]; then
47 . /etc/default/$NAME
48fi
49
50if test "$ENABLE_COREFILES" == 1; then
51 ulimit -c unlimited
52fi
53
54if test "$USE_COLLECTDMON" == 1; then
55 _PIDFILE="$COLLECTDMON_PIDFILE"
56else
57 _PIDFILE="$PIDFILE"
58fi
59
60# return:
61# 0 if config is fine
62# 1 if there is a syntax error
63# 2 if there is no configuration
64check_config() {
65 if test ! -e "$CONFIGFILE"; then
66 return 2
67 fi
68 if ! $DAEMON -t -C "$CONFIGFILE"; then
69 return 1
70 fi
71 return 0
72}
73
74# return:
75# 0 if the daemon has been started
76# 1 if the daemon was already running
77# 2 if the daemon could not be started
78# 3 if the daemon was not supposed to be started
79d_start() {
80 if test "$DISABLE" != 0; then
81 # we get here during restart
82 echo "disabled by /etc/default/$NAME"
83 return 3
84 fi
85
86 if test ! -e "$CONFIGFILE"; then
87 # we get here during restart
88 echo "disabled, no configuration ($CONFIGFILE) found"
89 return 3
90 fi
91
92 check_config
93 rc="$?"
94 if test "$rc" -ne 0; then
95 echo "not starting, configuration error"
96 return 2
97 fi
98
99 if test "$USE_COLLECTDMON" == 1; then
100 start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \
101 --exec $COLLECTDMON_DAEMON -- -P "$_PIDFILE" -- -C "$CONFIGFILE" \
102 || return 2
103 else
104 start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \
105 --exec $DAEMON -- -C "$CONFIGFILE" -P "$_PIDFILE" \
106 || return 2
107 fi
108 return 0
109}
110
111still_running_warning="
112WARNING: $NAME might still be running.
113In large setups it might take some time to write all pending data to
114the disk. You can adjust the waiting time in /etc/default/collectd."
115
116# return:
117# 0 if the daemon has been stopped
118# 1 if the daemon was already stopped
119# 2 if daemon could not be stopped
120d_stop() {
121 PID=$( cat "$_PIDFILE" 2> /dev/null ) || true
122
123 start-stop-daemon --stop --quiet --oknodo --pidfile "$_PIDFILE"
124 rc="$?"
125
126 if test "$rc" -eq 2; then
127 return 2
128 fi
129
130 sleep 1
131 if test -n "$PID" && kill -0 $PID 2> /dev/null; then
132 i=0
133 while kill -0 $PID 2> /dev/null; do
134 i=$(( $i + 2 ))
135 echo -n " ."
136
137 if test $i -gt $MAXWAIT; then
138 echo "$still_running_warning"
139 return 2
140 fi
141
142 sleep 2
143 done
144 return "$rc"
145 fi
146 return "$rc"
147}
148
149case "$1" in
150 start)
151 echo -n "Starting $NAME"
152 d_start
153 case "$?" in
154 0|1) echo "." ;;
155 *) exit 1 ;;
156 esac
157 ;;
158 stop)
159 echo -n "Stopping $NAME"
160 d_stop
161 case "$?" in
162 0|1) echo "." ;;
163 *) exit 1 ;;
164 esac
165 ;;
166 status)
167 status_of_proc -p "$_PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
168 ;;
169 restart|force-reload)
170 echo -n "Restarting $NAME"
171 check_config
172 rc="$?"
173 if test "$rc" -eq 1; then
174 echo "not restarting, configuration error"
175 exit 1
176 fi
177 d_stop
178 rc="$?"
179 case "$rc" in
180 0|1)
181 sleep 1
182 d_start
183 rc2="$?"
184 case "$rc2" in
185 0|1) echo "." ;;
186 *) exit 1 ;;
187 esac
188 ;;
189 *)
190 exit 1
191 ;;
192 esac
193 ;;
194 *)
195 echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
196 exit 3
197 ;;
198esac
199
200# vim: syntax=sh noexpandtab sw=4 ts=4 :
201
diff --git a/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch b/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch
new file mode 100644
index 0000000000..02b160109e
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch
@@ -0,0 +1,30 @@
1Disable defaulting of GCRYPT_LDFLAGS to -L/usr/lib
2
3Prevents "unsafe for cross compilation" warnings that cause
4do_qa_configure to fail.
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9
10diff --git a/configure.in b/configure.in
11index 98395ed..81c3a2c 100644
12--- a/configure.in
13+++ b/configure.in
14@@ -1777,11 +1777,11 @@ then
15 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
16 fi
17
18- if test "x$GCRYPT_LDFLAGS" = "x"
19- then
20- gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
21- GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
22- fi
23+# if test "x$GCRYPT_LDFLAGS" = "x"
24+# then
25+# gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
26+# GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
27+# fi
28
29 if test "x$GCRYPT_LIBS" = "x"
30 then
diff --git a/meta-oe/recipes-extended/collectd/collectd_5.2.2.bb b/meta-oe/recipes-extended/collectd/collectd_5.2.2.bb
new file mode 100644
index 0000000000..a508840eff
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd_5.2.2.bb
@@ -0,0 +1,45 @@
1SUMMARY = "Collects and summarises system performance statistics"
2DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files."
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
5
6DEPENDS = "rrdtool curl mysql5 libpcap libxml2 yajl libgcrypt libtool"
7
8SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
9 file://no-gcrypt-badpath.patch \
10 file://collectd-version.patch \
11 file://collectd.init"
12
13SRC_URI[md5sum] = "29e61411e51845d5ae71ab676078867e"
14SRC_URI[sha256sum] = "7b8906d1c8866155b31820ef108be92abcee7fcd278d386bf0d449e704ba4696"
15
16inherit autotools pythonnative update-rc.d
17
18# Floatingpoint layout, architecture dependent
19# 'nothing', 'endianflip' or 'intswap'
20FPLAYOUT ?= "--with-fp-layout=nothing"
21
22PACKAGECONFIG ??= ""
23PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
24
25EXTRA_OECONF = " \
26 ${FPLAYOUT} \
27 --disable-perl --with-libperl=no --with-perl-bindings=no \
28 --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
29"
30
31do_install_append() {
32 install -d ${D}${sysconfdir}/init.d
33 install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
34 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
35 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
36 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
37 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
38
39 # Fix configuration file to allow collectd to start up
40 sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf
41}
42
43INITSCRIPT_NAME = "collectd"
44INITSCRIPT_PARAMS = "defaults"
45