Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2004 01:08:42 +0900 (JST)
From:      Norikatsu Shigemura <nork@FreeBSD.org>
To:        Eduard Martinescu <martines@rochester.rr.com>
Cc:        ports@FreeBSD.org
Subject:   rcNG-fy sysutils/smartmontools
Message-ID:  <200404201608.i3KG8gPE015920@sakura.ninth-nine.com>

next in thread | raw e-mail | index | archive | help
Hi Eduard.

	I made a patch which rcNG-fy sysutils/smartmontools.
	Is this commit OK?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/smartmontools/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	9 Mar 2004 06:32:12 -0000	1.7
+++ Makefile	20 Apr 2004 15:50:56 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	smartmontools
 PORTVERSION=	5.30
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -16,6 +16,7 @@
 COMMENT=	S.M.A.R.T. disk monitoring tools
 
 USE_GMAKE=	yes
+USE_RC_SUBR=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-initscriptdir=${PREFIX}/etc/rc.d \
 		--with-docdir=${DOCSDIR} --enable-sample
@@ -26,14 +27,18 @@
 MAN8=		smartd.8 smartctl.8
 DOCS=		AUTHORS CHANGELOG INSTALL NEWS README TODO WARNINGS
 EXAMPLES=	smartd.conf examplescripts/README examplescripts/Example?
+RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
+
+post-build:
+	${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+		${FILESDIR}/smartd.sh > ${WRKDIR}/smartd.sh
 
 do-install:
 	cd ${WRKSRC} && ${INSTALL_PROGRAM} ${PROGRAMS} ${PREFIX}/sbin
 	cd ${WRKSRC} && ${INSTALL_MAN} ${MAN5} ${MANPREFIX}/man/man5
 	cd ${WRKSRC} && ${INSTALL_MAN} ${MAN8} ${MANPREFIX}/man/man8
 	${INSTALL_DATA} ${WRKSRC}/smartd.conf.sample ${PREFIX}/etc
-	${INSTALL_DATA} ${WRKSRC}/smartd.initd \
-		${PREFIX}/etc/rc.d/smartd.sh.sample
+	${INSTALL_SCRIPT} ${WRKDIR}/smartd.sh ${PREFIX}/etc/rc.d/smartd.sh
 	@${MKDIR} ${EXAMPLESDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
 .if !defined(NOPORTDOCS)
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/smartmontools/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pkg-plist	24 Oct 2003 07:45:38 -0000	1.1
+++ pkg-plist	20 Apr 2004 15:53:08 -0000
@@ -2,7 +2,7 @@
 @unexec /bin/echo "===>" Stopping smartd ...
 @unexec /usr/bin/killall smartd 2>/dev/null || true
 etc/smartd.conf.sample
-etc/rc.d/smartd.sh.sample
+etc/rc.d/smartd.sh
 sbin/smartctl
 sbin/smartd
 %%PORTDOCS%%%%DOCSDIR%%/AUTHORS
Index: files/smartd.sh
===================================================================
RCS file: files/smartd.sh
diff -N files/smartd.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/smartd.sh	20 Apr 2004 15:26:22 -0000
@@ -0,0 +1,28 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: smartd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+# Define these cyrus_imapd_* variables in one of these files:
+#	/etc/rc.conf
+#	/etc/rc.conf.local
+#	/etc/rc.conf.d/smartd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+smartd_enable="${smartd_enable:-NO}"
+smartd_flags="${smartd_flags:--p /var/run/smartd.pid}"
+
+. %%RC_SUBR%%
+
+name="smartd"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/smartd"
+pidfile="/var/run/smartd.pid"
+required_files="%%PREFIX%%/etc/smartd.conf"
+
+load_rc_config $name
+run_rc_command "$1"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



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