summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-06-24 09:40:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-24 09:40:56 +0000
commiteb8d770a77408f127ff2fa138aad5cb07dde8d08 (patch)
treeb293b613af69894699eb2f6205324bebeb594965 /testing
parenta770a4563149fa905662648da861dd9b063ac8b9 (diff)
downloadaports-eb8d770a77408f127ff2fa138aad5cb07dde8d08.tar.bz2
aports-eb8d770a77408f127ff2fa138aad5cb07dde8d08.tar.xz
testing/collectd: add init.d script, fix default conf, fix localstatedir
Diffstat (limited to 'testing')
-rw-r--r--testing/collectd/APKBUILD18
-rw-r--r--testing/collectd/collectd.initd20
2 files changed, 31 insertions, 7 deletions
diff --git a/testing/collectd/APKBUILD b/testing/collectd/APKBUILD
index 2905922a6..617accbd9 100644
--- a/testing/collectd/APKBUILD
+++ b/testing/collectd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer:
pkgname=collectd
pkgver=4.9.1
-pkgrel=2
+pkgrel=3
pkgdesc="The system statistics collection daemon"
url="http://collectd.org"
license="GPL"
@@ -14,7 +14,8 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-perl $pkgname-snmp $pkgname-curl
$pkgname-write_http $pkgname-nginx $pkgname-apache $pkgname-postgresql
$pkgname-mysql $pkgname-network"
-source="http://collectd.org/files/collectd-$pkgver.tar.bz2"
+source="http://collectd.org/files/collectd-$pkgver.tar.bz2
+ collectd.initd"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -33,11 +34,15 @@ prepare() {
build() {
cd "$_builddir"
./configure --prefix=/usr \
- --sysconfdir=/etc \
+ --sysconfdir=/etc/collectd \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
+ --localstate=/var \
|| return 1
make || return 1
+ # disable network plugin by default since its in a subpackage
+ sed -i -e 's/^LoadPlugin network/#LoadPlugin network/' \
+ src/collectd.conf
}
package() {
@@ -45,9 +50,7 @@ package() {
make DESTDIR="$pkgdir" install
find "$pkgdir" -name perllocal.pod -delete
- # remove the 2 lines below (and this) if there is no init.d script
- # install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- # install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}
perl() {
@@ -76,4 +79,5 @@ postgresql() { _plugin postgresql; }
mysql() { _plugin mysql; }
network() { _plugin network; }
-md5sums="5753496651c8c84afaea1fe290876bfc collectd-4.9.1.tar.bz2"
+md5sums="5753496651c8c84afaea1fe290876bfc collectd-4.9.1.tar.bz2
+13a36ae2f92634b5619ab94224e1b77d collectd.initd"
diff --git a/testing/collectd/collectd.initd b/testing/collectd/collectd.initd
new file mode 100644
index 000000000..de5705a03
--- /dev/null
+++ b/testing/collectd/collectd.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+
+DAEMON=/usr/sbin/collectd
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting collectd"
+ start-stop-daemon --start --exec $DAEMON -- $collectd_options
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping collectd"
+ start-stop-daemon --stop --exec $DAEMON
+ eend $?
+}
+