From a56877db2dfcbeb124a755db4199894ce72ebb46 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 1 Aug 2006 11:52:57 +0000 Subject: [PATCH] Port collectd to -ng git-svn-id: svn://svn.openwrt.org/openwrt/packages@4362 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/collectd/Makefile | 73 ++++++++++++++++++++++++++++++++++++++++ utils/collectd/files/S80collectd | 17 ++++++++++ 2 files changed, 90 insertions(+) create mode 100644 utils/collectd/Makefile create mode 100755 utils/collectd/files/S80collectd diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile new file mode 100644 index 000000000..edf2114cf --- /dev/null +++ b/utils/collectd/Makefile @@ -0,0 +1,73 @@ +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=collectd +PKG_VERSION:=3.5.1 +PKG_RELEASE:=1 +PKG_MD5SUM:=46a4b81e46d3bb58faab1d603649d737 + +PKG_SOURCE_URL:=http://verplant.org/collectd/files +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/collectd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Lightweight system statistics collection daemon + DESCRIPTION:=Lightweight system statistics collection daemon + URL:=http://verplant.org/collectd/ +endef + +define Build/Compile +$(call Build/Configure/Default,--enable-shared \ +--disable-static \ +--disable-debug \ +--enable-cpu \ +--enable-load \ +--enable-memory \ +--enable-ping \ +--enable-traffic \ +--disable-cpufreq \ +--disable-disk \ +--disable-hddtemp \ +--disable-nfs \ +--disable-processes \ +--disable-sensors \ +--disable-serial \ +--disable-swap \ +--disable-tape \ +--disable-users \ +) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + +define Package/collectd/install + install -d -m0755 $(1)/etc/init.d + install -d -m0755 $(1)/usr/sbin + install -d -m0755 $(1)/usr/lib/collectd + install -d -m0755 $(1)/var/lib/collectd + install -d -m0755 $(1)/var/run + $(CP) ./files/S80collectd $(1)/etc/init.d/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/collectd/*.so $(1)/usr/lib/collectd/ +endef + +$(eval $(call BuildPackage,collectd)) diff --git a/utils/collectd/files/S80collectd b/utils/collectd/files/S80collectd new file mode 100755 index 000000000..aa767fbc4 --- /dev/null +++ b/utils/collectd/files/S80collectd @@ -0,0 +1,17 @@ +#!/bin/sh + +BINARY="/usr/sbin/collectd" +PIDFILE="/var/run/collectd.pid" +DATADIR="/var/lib/collectd" + +[ -x "$BINARY" ] || exit 1; + +if [ -e "$PIDFILE" ] +then + kill $(cat "$PIDFILE") 2>/dev/null + sleep 1 +fi + +[ -d "$DATADIR" ] || mkdir -p "$DATADIR"; + +$BINARY -- 2.11.0