Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Sep 2018 15:56:18 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r479292 - in head/net-mgmt/statsite: . files
Message-ID:  <201809091556.w89FuIMY079766@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Sun Sep  9 15:56:18 2018
New Revision: 479292
URL: https://svnweb.freebsd.org/changeset/ports/479292

Log:
  net-mgmt/statsite: Add rc script
  
  PR:		230740
  Submitted by:	ndowens@yahoo.com
  Approved by:	rbarabas@rbarabas.info (maintainer timeout, 3 weeks)

Added:
  head/net-mgmt/statsite/files/
  head/net-mgmt/statsite/files/statsite.in   (contents, props changed)
Modified:
  head/net-mgmt/statsite/Makefile

Modified: head/net-mgmt/statsite/Makefile
==============================================================================
--- head/net-mgmt/statsite/Makefile	Sun Sep  9 13:41:08 2018	(r479291)
+++ head/net-mgmt/statsite/Makefile	Sun Sep  9 15:56:18 2018	(r479292)
@@ -3,6 +3,7 @@
 PORTNAME=	statsite
 PORTVERSION=	0.8.0
 DISTVERSIONPREFIX=	v
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 
 MAINTAINER=	rbarabas@rbarabas.info
@@ -11,7 +12,7 @@ COMMENT=	C implementation of statsd
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-USES=		autoreconf
+USES=		autoreconf python:env
 GNU_CONFIGURE=	yes
 USE_GITHUB=	yes
 GH_ACCOUNT=	armon
@@ -20,10 +21,18 @@ MAKE_ARGS=	CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LD
 
 USERS=		statsd
 GROUPS=		statsd
+USE_RC_SUBR=	statsite
 
 OPTIONS_DEFINE=	DOCS
 
 PORTDOCS=	README.md
+
+post-patch:
+	@${REINPLACE_CMD} -e 's,python,${PYTHON_CMD},' \
+		-e 's,/usr/libexec,/usr/local/share,' \
+		-e '/daemonize/d' \
+		-e '/pid_file/d' \
+		${WRKSRC}/rpm/statsite.conf.example
 
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/rpm/statsite.conf.example \

Added: head/net-mgmt/statsite/files/statsite.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/statsite/files/statsite.in	Sun Sep  9 15:56:18 2018	(r479292)
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: statsite
+# REQUIRE: NETWORKING SYSLOG
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# statsite_enable (bool):	Set to NO by default.
+#				Set it to YES to enable statsite.
+# statsite_config (path):	Set to %%PREFIX%%/etc/statsite.conf
+#				by default.
+
+. /etc/rc.subr
+
+name=statsite
+rcvar=statsite_enable
+
+load_rc_config $name
+
+: ${statsite_enable:="NO"}
+: ${statsite_config="%%PREFIX%%/etc/statsite.conf"}
+
+pidfile=/var/run/${name}.pid
+command="/usr/sbin/daemon"
+command_args="-f -u statsd -P ${pidfile} %%PREFIX%%/bin/statsite -f ${statsite_config}"
+
+run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809091556.w89FuIMY079766>