diff options
author | nork <nork@FreeBSD.org> | 2004-04-29 02:27:52 +0800 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2004-04-29 02:27:52 +0800 |
commit | 3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa (patch) | |
tree | 5c2e1eb2307e4c3e077a0fba5d8929beb862f41d /sysutils/smartmontools | |
parent | 11038ed237a7ecafd62955a4f0bacdbbbd138aa6 (diff) | |
download | freebsd-ports-gnome-3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa.tar.gz freebsd-ports-gnome-3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa.tar.zst freebsd-ports-gnome-3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa.zip |
rcNG-fy.
Approved by: maintainer no response (1 week)
Reviewed by: eik
Suggested by: hrs (obtained from: hrs's cvsyncd patch)
Diffstat (limited to 'sysutils/smartmontools')
-rw-r--r-- | sysutils/smartmontools/Makefile | 11 | ||||
-rw-r--r-- | sysutils/smartmontools/files/smartd.sh | 40 | ||||
-rw-r--r-- | sysutils/smartmontools/pkg-message | 3 | ||||
-rw-r--r-- | sysutils/smartmontools/pkg-plist | 2 |
4 files changed, 50 insertions, 6 deletions
diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile index 6bd0554b7aaa..ed19379ec867 100644 --- a/sysutils/smartmontools/Makefile +++ b/sysutils/smartmontools/Makefile @@ -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 @@ MAINTAINER= martines@rochester.rr.com 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 @@ MAN5= smartd.conf.5 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) diff --git a/sysutils/smartmontools/files/smartd.sh b/sysutils/smartmontools/files/smartd.sh new file mode 100644 index 000000000000..c8f3c66d586c --- /dev/null +++ b/sysutils/smartmontools/files/smartd.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: smartd +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown + +# Define these smartd_* 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="NO" +smartd_flags="" + +. %%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 + +case "${smartd_flags}" in +*-p\ *) + echo "ERROR: \$smartd_flags includes -p option." \ + "Please use \$smartd_pidfile instead." + exit 1 + ;; +*) + smartd_flags="-p ${smartd_pidfile} ${smartd_flags}" + ;; +esac + +run_rc_command "$1" diff --git a/sysutils/smartmontools/pkg-message b/sysutils/smartmontools/pkg-message index 21c0077d3243..08d8d8e799be 100644 --- a/sysutils/smartmontools/pkg-message +++ b/sysutils/smartmontools/pkg-message @@ -10,5 +10,4 @@ A sample configuration file has been installed as ${PREFIX}/etc/smartd.conf.samp Copy this file to ${PREFIX}/etc/smartd.conf and edit appropriately To have smartd start at boot - cp ${PREFIX}/etc/rc.d/smartd.sh.sample ${PREFIX}/etc/rc.d/smartd.sh - chmod 555 ${PREFIX}/etc/rc.d/smartd.sh + echo 'smartd_enable="YES"' >> /etc/rc.conf diff --git a/sysutils/smartmontools/pkg-plist b/sysutils/smartmontools/pkg-plist index a8ea2df1cba6..48160fff6192 100644 --- a/sysutils/smartmontools/pkg-plist +++ b/sysutils/smartmontools/pkg-plist @@ -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 |