View | Details | Raw Unified | Return to bug 165167
Collapse All | Expand All

(-)Makefile (-4 / +4 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	smartmontools
8
PORTNAME=	smartmontools
9
PORTVERSION=	5.42
9
PORTVERSION=	5.42
10
PORTREVISION=	2
10
PORTREVISION=	3
11
CATEGORIES=	sysutils
11
CATEGORIES=	sysutils
12
MASTER_SITES=	SF
12
MASTER_SITES=	SF
13
13
Lines 19-26 Link Here
19
CONFLICTS=	smartmontools-devel-[0-9]*
19
CONFLICTS=	smartmontools-devel-[0-9]*
20
20
21
USE_GMAKE=	yes
21
USE_GMAKE=	yes
22
# hack to prevent gmake failure on 6.xx
23
GMAKE=		make
24
GNU_CONFIGURE=	yes
22
GNU_CONFIGURE=	yes
25
CONFIGURE_ARGS=	--disable-dependency-tracking \
23
CONFIGURE_ARGS=	--disable-dependency-tracking \
26
		--enable-drivedb --enable-sample \
24
		--enable-drivedb --enable-sample \
Lines 32-37 Link Here
32
MAN5=		smartd.conf.5
30
MAN5=		smartd.conf.5
33
MAN8=		smartd.8 smartctl.8
31
MAN8=		smartd.8 smartctl.8
34
32
33
PORTDOCS=	*
34
35
CFLAGS:=	${CFLAGS:S/-O2/-O/} -Wno-write-strings
35
CFLAGS:=	${CFLAGS:S/-O2/-O/} -Wno-write-strings
36
36
37
post-patch:
37
post-patch:
Lines 40-46 Link Here
40
post-install:
40
post-install:
41
	${MKDIR} ${PREFIX}/etc/periodic/daily
41
	${MKDIR} ${PREFIX}/etc/periodic/daily
42
	${INSTALL_SCRIPT} ${WRKDIR}/smart ${PREFIX}/etc/periodic/daily/smart
42
	${INSTALL_SCRIPT} ${WRKDIR}/smart ${PREFIX}/etc/periodic/daily/smart
43
	${INSTALL_SCRIPT} ${WRKSRC}/smartd.freebsd.initd ${PREFIX}/etc/rc.d/smartd
43
44
	@${CAT} ${PKGMESSAGE}
44
	@${CAT} ${PKGMESSAGE}
45
45
46
.include <bsd.port.mk>
46
.include <bsd.port.mk>
(-)pkg-plist (-19 / +1 lines)
Lines 1-28 Link Here
1
@comment $FreeBSD: ports/sysutils/smartmontools/pkg-plist,v 1.7 2010/10/19 11:31:13 sunpoet Exp $
1
@stopdaemon smartd
2
@unexec /bin/echo "===>" Stopping smartd ...
3
@unexec /usr/bin/killall smartd 2>/dev/null || true
4
etc/periodic/daily/smart
2
etc/periodic/daily/smart
5
etc/smartd.conf.sample
3
etc/smartd.conf.sample
6
sbin/smartctl
4
sbin/smartctl
7
sbin/smartd
5
sbin/smartd
8
sbin/update-smart-drivedb
6
sbin/update-smart-drivedb
9
%%DOCSDIR%%/AUTHORS
10
%%DOCSDIR%%/CHANGELOG
11
%%DOCSDIR%%/COPYING
12
%%DOCSDIR%%/INSTALL
13
%%DOCSDIR%%/NEWS
14
%%DOCSDIR%%/README
15
%%DOCSDIR%%/TODO
16
%%DOCSDIR%%/WARNINGS
17
%%DOCSDIR%%/examplescripts/Example1
18
%%DOCSDIR%%/examplescripts/Example2
19
%%DOCSDIR%%/examplescripts/Example3
20
%%DOCSDIR%%/examplescripts/Example4
21
%%DOCSDIR%%/examplescripts/README
22
%%DOCSDIR%%/smartd.conf
23
%%DATADIR%%/drivedb.h
7
%%DATADIR%%/drivedb.h
24
@dirrm %%DATADIR%%
8
@dirrm %%DATADIR%%
25
@dirrm %%DOCSDIR%%/examplescripts
26
@dirrm %%DOCSDIR%%
27
@dirrmtry etc/periodic/daily
9
@dirrmtry etc/periodic/daily
28
@dirrmtry etc/periodic
10
@dirrmtry etc/periodic
(-)files/smartd.in (-25 / +51 lines)
Lines 1-44 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# $FreeBSD: ports/sysutils/smartmontools/files/smartd.in,v 1.3 2012/01/14 08:57:06 dougb Exp $
3
2
3
# $FreeBSD$
4
#
4
# PROVIDE: smartd
5
# PROVIDE: smartd
5
# REQUIRE: DAEMON
6
# REQUIRE: LOGIN
6
# BEFORE: LOGIN
7
# KEYWORD: shutdown nojail
7
# KEYWORD: shutdown
8
#
8
9
# Define these smartd_* variables in one of these files:
9
# Define these smartd_* variables in one of these files:
10
#	/etc/rc.conf
10
#	/etc/rc.conf
11
#	/etc/rc.conf.local
11
#	/etc/rc.conf.local
12
#	/etc/rc.conf.d/smartd
12
#	/etc/rc.conf.d/smartd
13
#
13
#
14
# DO NOT CHANGE THESE DEFAULT VALUES HERE
14
# DO NOT CHANGE THESE DEFAULT VALUES HERE
15
#
16
smartd_enable="${smartd_enable-NO}"
17
smartd_pidfile="/var/run/smartd.pid"
18
15
19
. /etc/rc.subr
16
. /etc/rc.subr
20
17
21
name="smartd"
18
name=smartd
22
rcvar=smartd_enable
19
rcvar=smartd_enable
23
command="%%PREFIX%%/sbin/smartd"
24
20
25
load_rc_config $name
21
load_rc_config smartd
22
23
: ${smartd_enable:="NO"}
26
24
27
: ${smartd_config="%%PREFIX%%/etc/smartd.conf"}
25
required_files=${smartd_config:="%%PREFIX%%/etc/smartd.conf"}
28
: ${smartd_flags="-c ${smartd_config}"}
26
pidfile=${smartd_pidfile:="/var/run/smartd.pid"}
29
27
30
pidfile="${smartd_pidfile}"
28
command="%%PREFIX%%/sbin/smartd"
31
required_files="${smartd_config}"
29
command_args="-c ${required_files} -p ${pidfile}"
32
30
33
case "${smartd_flags}" in
31
extra_commands="reload report"
34
*-p\ *)
32
reload_cmd="smartd_reload"
35
	echo "ERROR: \$smartd_flags includes -p option." \
33
report_cmd="smartd_report"
36
		"Please use \$smartd_pidfile instead."
34
37
	exit 1
35
start_precmd=smartd_prestart
38
	;;
36
39
*)
37
smartd_prestart()
40
	smartd_flags="-p ${pidfile} ${smartd_flags}"
38
{
41
	;;
39
	case "${smartd_flags}" in
42
esac
40
	-p*|*-p*)
41
	err 1 'smartd_flags includes the -p option, use smartd_pidfile instead'
42
		;;
43
	esac
44
}
45
46
smartd_reload()
47
{
48
	local status
49
50
	if ! status=`run_rc_command status 2>&1`; then
51
		echo $status
52
		return 1
53
	fi
54
	echo 'Reloading smartd.'
55
	kill -HUP $rc_pid
56
}
57
58
smartd_report()
59
{
60
	local status
61
62
	if ! status=`run_rc_command status 2>&1`; then
63
		echo $status
64
		return 1
65
	fi
66
	echo 'Checking SMART devices now.'
67
	kill -USR1 $rc_pid
68
}
43
69
44
run_rc_command "$1"
70
run_rc_command "$1"

Return to bug 165167