diff --git a/sysutils/Makefile b/sysutils/Makefile index a4d78c11cd1a..43fd76d3ec68 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -366,6 +366,7 @@ SUBDIR += isomaster SUBDIR += isomd5sum SUBDIR += ispman + SUBDIR += istatd SUBDIR += jailadmin SUBDIR += jailctl SUBDIR += jailer diff --git a/sysutils/istatd/Makefile b/sysutils/istatd/Makefile new file mode 100644 index 000000000000..726ee562c0cd --- /dev/null +++ b/sysutils/istatd/Makefile @@ -0,0 +1,37 @@ +# New ports collection makefile for: istatd +# Date created: 2009-12-01 +# Whom: Babak Farrokhi +# +# $FreeBSD$ +# + +PORTNAME= istatd +PORTVERSION= 0.5.4 +CATEGORIES= sysutils +MASTER_SITES= GOOGLE_CODE + +MAINTAINER= farrokhi@FreeBSD.org +COMMENT= Daemon for iStat iPhone application + +LIB_DEPENDS= xml2:${PORTSDIR}/textproc/libxml2 + +GNU_CONFIGURE= yes +USE_RC_SUBR= ${PORTNAME} + +MAN1= istatd.1 +MAN5= istat.conf.5 + +PLIST_FILES= bin/istatd etc/istat.conf-dist +SUB_FILES+= pkg-message + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/istatd ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKDIR}/istatd ${PREFIX}/etc/rc.d + ${INSTALL_DATA} ${WRKSRC}/resource/istat.conf ${PREFIX}/etc/istat.conf-dist + ${INSTALL_MAN} ${WRKSRC}/resource/istatd.1 ${MAN1PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/resource/istat.conf.5 ${MAN5PREFIX}/man/man5 + +post-install: + @${CAT} ${PKGMESSAGE} + +.include diff --git a/sysutils/istatd/distinfo b/sysutils/istatd/distinfo new file mode 100644 index 000000000000..f9ed01ecb83c --- /dev/null +++ b/sysutils/istatd/distinfo @@ -0,0 +1,3 @@ +MD5 (istatd-0.5.4.tar.gz) = e2906d3b71a003c2e06bf1cfa99d34e1 +SHA256 (istatd-0.5.4.tar.gz) = 454a5d9a04e8af4c22875adf962e52d7e4a35b808ccc3e249dd45b7e3b716f0a +SIZE (istatd-0.5.4.tar.gz) = 147932 diff --git a/sysutils/istatd/files/istatd.in b/sysutils/istatd/files/istatd.in new file mode 100644 index 000000000000..e65f0d670d73 --- /dev/null +++ b/sysutils/istatd/files/istatd.in @@ -0,0 +1,28 @@ +#!/bin/sh + +# PROVIDE: istatd +# REQUIRE: LOGIN +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# istatd_enable (bool): Set to NO by default. +# Set it to YES to enable istatd. +# + +. %%RC_SUBR%% + +name="istatd" +rcvar=${name}_enable + +command=%%PREFIX%%/bin/${name} + +load_rc_config $name + +: ${istatd_enable="NO"} +: ${istatd_config="%%PREFIX%%/etc/istat.conf"} + +command_args="-d -c $istatd_config" + +run_rc_command "$1" + diff --git a/sysutils/istatd/files/patch-main.cpp b/sysutils/istatd/files/patch-main.cpp new file mode 100644 index 000000000000..3760c679fdfc --- /dev/null +++ b/sysutils/istatd/files/patch-main.cpp @@ -0,0 +1,21 @@ + +$FreeBSD$ + +--- main.cpp.orig ++++ main.cpp +@@ -97,11 +97,11 @@ + + string cf_network_addr = arguments.get("a", config.get("network_addr", "0.0.0.0")); + string cf_network_port = arguments.get("p", config.get("network_port", "5109")); +- string cf_server_user = arguments.get("u", config.get("server_user", "istat")); +- string cf_server_group = arguments.get("g", config.get("server_group", "istat")); +- string cf_server_pid = arguments.get("pid", config.get("server_pid", "/var/run/istat/istatd.pid")); ++ string cf_server_user = arguments.get("u", config.get("server_user", "nobody")); ++ string cf_server_group = arguments.get("g", config.get("server_group", "nobody")); ++ string cf_server_pid = arguments.get("pid", config.get("server_pid", "/var/run/istatd.pid")); + string cf_server_socket = arguments.get("socket", config.get("server_socket", "/tmp/istatd.sock")); +- string cf_cache_dir = arguments.get("cache", config.get("cache_dir", "/var/cache/istat")); ++ string cf_cache_dir = arguments.get("cache", config.get("cache_dir", "/var/db/istatd")); + + #ifdef HAVE_LIBKSTAT + if(-1 == kstat_init()) return 1; diff --git a/sysutils/istatd/files/pkg-message.in b/sysutils/istatd/files/pkg-message.in new file mode 100644 index 000000000000..f2d0771818c0 --- /dev/null +++ b/sysutils/istatd/files/pkg-message.in @@ -0,0 +1,6 @@ +================================================================================ + +Please copy %%PREFIX%%/etc/istat.conf-dist to %%PREFIX%%/etc/istat.conf and +change necessary variables before starting the daemon. + +================================================================================ diff --git a/sysutils/istatd/pkg-descr b/sysutils/istatd/pkg-descr new file mode 100644 index 000000000000..32b5f1aa0892 --- /dev/null +++ b/sysutils/istatd/pkg-descr @@ -0,0 +1,7 @@ +istatd is a daemon serving statistics to your iStat iPhone application +from Linux, Solaris & FreeBSD. istatd collects data such as CPU, memory, +network and disk usage and keeps the history. Once connecting from the +iPhone and entering the lock code this data will be sent to the iPhone +and shown in fancy graphs. + +WWW: http://code.google.com/p/istatd/