summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2013-11-08 13:48:36 +0100
committerMatteo Bernardini <ponce@slackbuilds.org>2013-11-08 17:35:12 +0100
commit1b393452df0547e7ca75ff1e3e74484a82e6072e (patch)
tree8724aaa6e9c68d48f8499fc785dd3d4d950937fb /system
parenta1fda691eae13d28a10021c3fcab2f7ffd238c38 (diff)
downloadslackbuilds-1b393452df0547e7ca75ff1e3e74484a82e6072e.tar.gz
system/collectd: Updated for version 5.4.0.
Added an rc script, fix for gcc-4.8.x, disabled static stuff Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/collectd/collectd.SlackBuild12
-rw-r--r--system/collectd/collectd.info6
-rw-r--r--system/collectd/doinst.sh12
-rw-r--r--system/collectd/rc.collectd74
4 files changed, 99 insertions, 5 deletions
diff --git a/system/collectd/collectd.SlackBuild b/system/collectd/collectd.SlackBuild
index 06c44d08bf..1a710047ec 100644
--- a/system/collectd/collectd.SlackBuild
+++ b/system/collectd/collectd.SlackBuild
@@ -8,8 +8,10 @@
# Based on http://slackbuilds.org/template.SlackBuild
+# Modified by the SlackBuilds.org project
+
PRGNAM=collectd
-VERSION=${VERSION:-20120912_5cf0dd2}
+VERSION=${VERSION:-5.4.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -55,7 +57,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-./build.sh
+# Fix for gcc-4.8.x
+sed -i "s|\ -Werror||" src/Makefile.in
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -67,6 +70,7 @@ CXXFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--with-perl-bindings="PREFIX=/usr INSTALLDIRS=vendor INSTALLVENDORMAN3DIR=/usr/man/man3" \
+ --enable-static=no \
--build=$ARCH-slackware-linux
make
@@ -78,6 +82,8 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+install -m 0644 -D $CWD/rc.collectd $PKG/etc/rc.d/rc.collectd.new
+
# Rename
mv $PKG/etc/collectd.conf $PKG/etc/collectd.conf.new
@@ -86,6 +92,8 @@ find $PKG -name "perllocal.pod" \
-o -name "*.bs" \
| xargs rm -f
+rm -fr $PKG/var/run $PKG/var/log
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS ChangeLog COPYING INSTALL README \
diff --git a/system/collectd/collectd.info b/system/collectd/collectd.info
index 75910c846b..b76b7cee7c 100644
--- a/system/collectd/collectd.info
+++ b/system/collectd/collectd.info
@@ -1,8 +1,8 @@
PRGNAM="collectd"
-VERSION="20120912_5cf0dd2"
+VERSION="5.4.0"
HOMEPAGE="http://collectd.org"
-DOWNLOAD="http://ponce.cc/slackware/sources/repo/collectd-20120912_5cf0dd2.tar.xz"
-MD5SUM="396f857d9b347ccd186187064aee42c1"
+DOWNLOAD="http://collectd.org/files/collectd-5.4.0.tar.bz2"
+MD5SUM="bbcc8d0dd466d1ec7d8311646d5bddd8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/system/collectd/doinst.sh b/system/collectd/doinst.sh
index bbbfd14f1a..6359977249 100644
--- a/system/collectd/doinst.sh
+++ b/system/collectd/doinst.sh
@@ -11,4 +11,16 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
config etc/collectd.conf.new
+preserve_perms etc/rc.d/rc.collectd.new
diff --git a/system/collectd/rc.collectd b/system/collectd/rc.collectd
new file mode 100644
index 0000000000..2323395929
--- /dev/null
+++ b/system/collectd/rc.collectd
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# rc.d script for collectd
+#
+# Thanks to miklos from slacky.eu
+
+exec=/usr/sbin/collectd
+prog=$(basename $exec)
+configfile=/etc/collectd.conf
+pidfile=/var/run/collectd.pid
+
+start() {
+ [ -x $exec ] || exit 5
+ if [ -f $pidfile ]; then
+ echo "Seems that an active process is up and running with pid $(cat $pidfile)"
+ echo "If this is not true try first to remove pidfile $pidfile"
+ exit 5
+ fi
+ echo $"Starting $prog"
+ $exec -P $pidfile -C $configfile
+}
+
+stop() {
+ if [ -e $pidfile ]; then
+ echo "Stopping $prog"
+ kill -QUIT $(cat $pidfile) 2>/dev/null
+ rm $pidfile
+ fi
+}
+
+status() {
+ echo -n "$prog is "
+ CHECK=$(ps aux | grep $exec | grep -v grep)
+ STATUS=$?
+ if [ "$STATUS" == "1" ]; then
+ echo "not running"
+ else
+ echo "running"
+ fi
+
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+case "$1" in
+ start)
+ $1
+ ;;
+ stop)
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ status)
+ $1
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart}"
+ exit 2
+esac
+exit $?
+