aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt/fbsdmon
diff options
context:
space:
mode:
authorJason Helfman <jgh@FreeBSD.org>2012-02-04 00:56:53 +0000
committerJason Helfman <jgh@FreeBSD.org>2012-02-04 00:56:53 +0000
commit34a815e881d176d2d183aa5fe5600bd9620dfa43 (patch)
treea0ed754d6ce84ece8e2b3a8c66dbf5df56b91c5f /ports-mgmt/fbsdmon
parent4bab1e932ad2b3e1036f737977b285ba47632a18 (diff)
downloadports-34a815e881d176d2d183aa5fe5600bd9620dfa43.tar.gz
ports-34a815e881d176d2d183aa5fe5600bd9620dfa43.zip
Add new port: fbsdmon
Submit system and ports statistics to fbsdmon.org. Statistics can be sent from command line, from rc script or from periodic script. WWW: http://fbsdmon.org/ PR: ports/164608 Submitted by: Grzegorz Blach <magik at roorback.net> Approved by: rene (mentor)
Notes
Notes: svn path=/head/; revision=290366
Diffstat (limited to 'ports-mgmt/fbsdmon')
-rw-r--r--ports-mgmt/fbsdmon/Makefile31
-rw-r--r--ports-mgmt/fbsdmon/distinfo2
-rw-r--r--ports-mgmt/fbsdmon/files/600.fbsdmon.in25
-rw-r--r--ports-mgmt/fbsdmon/files/fbsdmon.in30
-rw-r--r--ports-mgmt/fbsdmon/files/patch-src__io.c11
-rw-r--r--ports-mgmt/fbsdmon/files/pkg-message.in10
-rw-r--r--ports-mgmt/fbsdmon/pkg-descr6
-rw-r--r--ports-mgmt/fbsdmon/pkg-plist6
8 files changed, 121 insertions, 0 deletions
diff --git a/ports-mgmt/fbsdmon/Makefile b/ports-mgmt/fbsdmon/Makefile
new file mode 100644
index 000000000000..a983b4c1abba
--- /dev/null
+++ b/ports-mgmt/fbsdmon/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: fbsdmon
+# Date created: 21 January 2012
+# Whom: Grzegorz Blach <magik@roorback.net>
+#
+# $FreeBSD$
+#
+
+PORTNAME= fbsdmon
+PORTVERSION= 0.90
+CATEGORIES= ports-mgmt sysutils
+MASTER_SITES= http://files.roorback.net/
+
+MAINTAINER= magik@roorback.net
+COMMENT= Sumbit system and ports statistics to fbsdmon.org
+
+LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
+ jansson.6:${PORTSDIR}/devel/jansson \
+
+SUB_FILES= 600.fbsdmon pkg-message
+USE_RC_SUBR= fbsdmon
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/fbsdmon ${PREFIX}/sbin
+ ${MKDIR} /var/db/fbsdmon
+ ${MKDIR} ${PREFIX}/etc/periodic/weekly
+ ${INSTALL_SCRIPT} ${WRKDIR}/600.fbsdmon ${PREFIX}/etc/periodic/weekly
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/ports-mgmt/fbsdmon/distinfo b/ports-mgmt/fbsdmon/distinfo
new file mode 100644
index 000000000000..c0dfcf0c0030
--- /dev/null
+++ b/ports-mgmt/fbsdmon/distinfo
@@ -0,0 +1,2 @@
+SHA256 (fbsdmon-0.90.tar.gz) = 5143eb51b241bef6c30e26a5fac54308ca36db76b865da208f33edab92c13b78
+SIZE (fbsdmon-0.90.tar.gz) = 3692
diff --git a/ports-mgmt/fbsdmon/files/600.fbsdmon.in b/ports-mgmt/fbsdmon/files/600.fbsdmon.in
new file mode 100644
index 000000000000..5b970f7412f0
--- /dev/null
+++ b/ports-mgmt/fbsdmon/files/600.fbsdmon.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+case "$weekly_fbsdmon_enable" in
+ [Yy][Ee][Ss])
+ echo ""
+ echo "Sending statistic to fbsdmon.org"
+
+ %%PREFIX%%/sbin/fbsdmon
+ rc=$?;;
+
+ *) rc=0;;
+esac
+
+exit $rc
diff --git a/ports-mgmt/fbsdmon/files/fbsdmon.in b/ports-mgmt/fbsdmon/files/fbsdmon.in
new file mode 100644
index 000000000000..64dc73c63b74
--- /dev/null
+++ b/ports-mgmt/fbsdmon/files/fbsdmon.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: fbsdmon
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `fbsdmon':
+#
+# fbsdmon_enable="YES"
+#
+
+
+. /etc/rc.subr
+
+name=fbsdmon
+rcvar=fbsdmon_enable
+
+load_rc_config "$name"
+: ${fbsdmon_enable="NO"}
+
+pidfile="/var/run/$name.pid"
+procname="%%PREFIX%%/sbin/$name"
+command="/usr/sbin/daemon"
+command_args="-c -f -p $pidfile $procname"
+stop_postcmd="/bin/rm -f $pidfile"
+
+run_rc_command "$1"
diff --git a/ports-mgmt/fbsdmon/files/patch-src__io.c b/ports-mgmt/fbsdmon/files/patch-src__io.c
new file mode 100644
index 000000000000..a60332c25712
--- /dev/null
+++ b/ports-mgmt/fbsdmon/files/patch-src__io.c
@@ -0,0 +1,11 @@
+--- ./src/io.c.orig 2012-01-30 12:34:26.000000000 -0800
++++ ./src/io.c 2012-01-30 12:34:36.000000000 -0800
+@@ -47,7 +47,7 @@
+ extern char* gz_data(char *data)
+ {
+ char *fn = strdup("/tmp/fbsdmon.XXXXXX");
+- mktemp(fn);
++ mkstemp(fn);
+
+ gzFile *gz = gzopen(fn, "wb");
+ gzputs(gz, data);
diff --git a/ports-mgmt/fbsdmon/files/pkg-message.in b/ports-mgmt/fbsdmon/files/pkg-message.in
new file mode 100644
index 000000000000..a6ec40605528
--- /dev/null
+++ b/ports-mgmt/fbsdmon/files/pkg-message.in
@@ -0,0 +1,10 @@
+
+ To enable weekly reporting, add this line to /etc/periodic.conf:
+ weekly_fbsdmon_enable="YES"
+
+ To enable boottime reporting, add this line to /etc/rc.conf:
+ fbsdmon_enable="YES"
+
+ To run it manually, run command:
+ %%PREFIX%%/sbin/fbsdmon
+
diff --git a/ports-mgmt/fbsdmon/pkg-descr b/ports-mgmt/fbsdmon/pkg-descr
new file mode 100644
index 000000000000..15590c742e20
--- /dev/null
+++ b/ports-mgmt/fbsdmon/pkg-descr
@@ -0,0 +1,6 @@
+Submit system and ports statistics to fbsdmon.org.
+
+Statistics can be sent from command line, from rc script
+or from periodic script.
+
+WWW: http://fbsdmon.org/
diff --git a/ports-mgmt/fbsdmon/pkg-plist b/ports-mgmt/fbsdmon/pkg-plist
new file mode 100644
index 000000000000..f2ed4abd289a
--- /dev/null
+++ b/ports-mgmt/fbsdmon/pkg-plist
@@ -0,0 +1,6 @@
+sbin/fbsdmon
+etc/periodic/weekly/600.fbsdmon
+@exec mkdir -p /var/db/fbsdmon || true
+@unexec rmdir /var/db/fbsdmon 2>/dev/null || true
+@dirrmtry etc/periodic/weekly
+@dirrmtry etc/periodic