summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2004-04-28 18:27:52 +0000
committernork <nork@FreeBSD.org>2004-04-28 18:27:52 +0000
commit3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa (patch)
tree5c2e1eb2307e4c3e077a0fba5d8929beb862f41d
parent11038ed237a7ecafd62955a4f0bacdbbbd138aa6 (diff)
downloadFreeBSD-ports-3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa.zip
FreeBSD-ports-3d84f46bc71d21ec7459e16a479ecf5ceb3ff3fa.tar.gz
rcNG-fy.
Approved by: maintainer no response (1 week) Reviewed by: eik Suggested by: hrs (obtained from: hrs's cvsyncd patch)
-rw-r--r--UPDATING6
-rw-r--r--sysutils/smartmontools-devel/Makefile11
-rw-r--r--sysutils/smartmontools-devel/files/smartd.sh40
-rw-r--r--sysutils/smartmontools-devel/pkg-message3
-rw-r--r--sysutils/smartmontools-devel/pkg-plist2
-rw-r--r--sysutils/smartmontools/Makefile11
-rw-r--r--sysutils/smartmontools/files/smartd.sh40
-rw-r--r--sysutils/smartmontools/pkg-message3
-rw-r--r--sysutils/smartmontools/pkg-plist2
9 files changed, 106 insertions, 12 deletions
diff --git a/UPDATING b/UPDATING
index fb1b1cc..18efed0 100644
--- a/UPDATING
+++ b/UPDATING
@@ -6,6 +6,12 @@ You should get into the habit of checking this file for changes each
time you update your ports collection, before attempting any port
upgrades.
+20040429:
+ AFFECTS: users of sysutils/smartmontools
+
+ The smartmontools port must now be enabled / disabled and configured in
+ rc.conf. See the pkg-message or script for details.
+
20040420:
AFFECTS: users of sysutils/cdrtools
diff --git a/sysutils/smartmontools-devel/Makefile b/sysutils/smartmontools-devel/Makefile
index 6bd0554..ed19379 100644
--- a/sysutils/smartmontools-devel/Makefile
+++ b/sysutils/smartmontools-devel/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-devel/files/smartd.sh b/sysutils/smartmontools-devel/files/smartd.sh
new file mode 100644
index 0000000..c8f3c66
--- /dev/null
+++ b/sysutils/smartmontools-devel/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-devel/pkg-message b/sysutils/smartmontools-devel/pkg-message
index 21c0077..08d8d8e 100644
--- a/sysutils/smartmontools-devel/pkg-message
+++ b/sysutils/smartmontools-devel/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-devel/pkg-plist b/sysutils/smartmontools-devel/pkg-plist
index a8ea2df..48160ff 100644
--- a/sysutils/smartmontools-devel/pkg-plist
+++ b/sysutils/smartmontools-devel/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
diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile
index 6bd0554..ed19379 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 0000000..c8f3c66
--- /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 21c0077..08d8d8e 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 a8ea2df..48160ff 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
OpenPOWER on IntegriCloud