aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2004-04-28 18:27:52 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2004-04-28 18:27:52 +0000
commitff755b6f57c07d93482602c49860a3ed89441ddd (patch)
tree2ab7bf799f21c86fbbf889ea3f187565800d2378
parente42792096e1b02b38d0b8f405c6ee0e9123b23ce (diff)
downloadports-ff755b6f57c07d93482602c49860a3ed89441ddd.tar.gz
ports-ff755b6f57c07d93482602c49860a3ed89441ddd.zip
Notes
-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 fb1b1cc5509c..18efed03365a 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 6bd0554b7aaa..ed19379ec867 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 000000000000..c8f3c66d586c
--- /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 21c0077d3243..08d8d8e799be 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 a8ea2df1cba6..48160fff6192 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 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