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

(-)b/sysutils/munin-master/Makefile (+3 lines)
Lines 1-5 Link Here
1
PORTNAME=	munin
1
PORTNAME=	munin
2
PORTVERSION=	${MUNIN_VERSION}
2
PORTVERSION=	${MUNIN_VERSION}
3
PORTREVISION=	1
3
CATEGORIES=	sysutils perl5
4
CATEGORIES=	sysutils perl5
4
MASTER_SITES=	${MUNIN_SITES}
5
MASTER_SITES=	${MUNIN_SITES}
5
PKGNAMESUFFIX=	-master
6
PKGNAMESUFFIX=	-master
Lines 57-61 post-install: Link Here
57
	(cd ${STAGEDIR}${ETCDIR}; for i in `find . -type f`; do mv $$i $$i.sample; done)
58
	(cd ${STAGEDIR}${ETCDIR}; for i in `find . -type f`; do mv $$i $$i.sample; done)
58
	${MV} ${STAGEDIR}${WWWDIR}/.htaccess ${STAGEDIR}${WWWDIR}/.htaccess.sample
59
	${MV} ${STAGEDIR}${WWWDIR}/.htaccess ${STAGEDIR}${WWWDIR}/.htaccess.sample
59
	${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-master.newsyslog
60
	${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-master.newsyslog
61
	${MKDIR} ${STAGEDIR}${LOCALBASE}/etc/cron.d
62
	${INSTALL_DATA} ${FILESDIR}/cron ${STAGEDIR}${ETCDIR}/munin-master.cron
60
63
61
.include <bsd.port.mk>
64
.include <bsd.port.mk>
(-)b/sysutils/munin-master/files/cron (+1 lines)
Added Link Here
1
*/5	*	*	*	*	munin	/usr/local/bin/munin-cron
(-)b/sysutils/munin-master/files/pkg-message.in (-22 lines)
Lines 8-36 Please edit it according to your needs. Link Here
8
8
9
The Munin server will be run from cron under the user 'munin'.
9
The Munin server will be run from cron under the user 'munin'.
10
10
11
If you need to customize the munin crontab, remove the lines
12
containing #BEGIN_MUNIN_MAIN and #END_MUNIN_MAIN, and add a line
13
with #MANUAL_MUNIN_CRONTAB.
14
EOT
11
EOT
15
type: install
12
type: install
16
}
13
}
17
{
18
message: <<EOT
19
The munin-master newsyslog.conf(5) filename has been changed:
20
  OLD: ${PREFIX}/etc/newsyslog.conf.d/munin-master
21
  NEW: ${PREFIX}/etc/newsyslog.conf.d/munin-master.conf
22
23
Any file found at the old location has been automatically moved to
24
the new location. This was done to ensure log rotation continued to
25
work after change r340318 made to FreeBSD base, where the default
26
newsyslog configuration now only includes filenames that end with
27
'.conf' and do not begin with '.'.
28
29
If you use provisioning/configuration management tools to create or
30
edit this file, you will need to change their configuration to use
31
the new filename.
32
EOT
33
type: upgrade
34
maximum_version: "2.0.43_1"
35
}
36
]
14
]
(-)a/sysutils/munin-master/pkg-install (-100 lines)
Removed Link Here
1
#! /bin/sh
2
# ex:sw=4 sts=4
3
4
ask() {
5
    local question default answer
6
7
    question=$1
8
    default=$2
9
    if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]
10
    then
11
        read -p "${question} [${default}]? " answer
12
    fi
13
    if [ x${answer} = x ]
14
    then
15
        answer=${default}
16
    fi
17
    echo ${answer}
18
}
19
20
yesno() {
21
    local dflt question answer
22
23
    question=$1
24
    dflt=$2
25
    while :; do
26
        answer=$(ask "${question}" "${dflt}")
27
        case "${answer}" in
28
        [Yy]*)          return 0;;
29
        [Nn]*)          return 1;;
30
        esac
31
        echo "Please answer yes or no."
32
    done
33
}
34
35
create_crontab_entries() {
36
    local b e
37
    b=$1
38
    e=$2
39
40
    if crontab -u munin -l > /dev/null 2>&1
41
    then
42
	if ! crontab -u munin -l | grep -q MANUAL_MUNIN_CRONTAB
43
	then
44
	    TMPFILE=`mktemp -t munin` || exit 1
45
	    cat > $TMPFILE
46
	    crontab -u munin -l | sed -e "/^$b$/,/^$e$/d" | \
47
		cat - $TMPFILE | crontab -u munin -
48
	    rm $TMPFILE
49
	fi
50
    else
51
	crontab -u munin -
52
    fi
53
}
54
55
move_www_dir() {
56
    if [ -d ${PKG_PREFIX}/www/data/munin -a ! -d ${PKG_PREFIX}/www/munin ]
57
    then
58
	echo Migrating ${PKG_PREFIX}/www/data/munin to ${PKG_PREFIX}/www/munin
59
	mv ${PKG_PREFIX}/www/data/munin ${PKG_PREFIX}/www/munin
60
    fi
61
}
62
63
move_newsyslog_conf() {
64
    oldfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-master
65
    newfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-master.conf
66
    samplefile=${PKG_PREFIX}/etc/munin/munin-master.newsyslog
67
    if [ -f ${oldfile} ]; then
68
	echo "Configuration file found in old location: ${oldfile}"
69
	if cmp -s ${samplefile} ${newfile} > /dev/null; then
70
	    echo "Configuration file in new location has not been modified from the default: ${newfile}"
71
	    echo " => Moving old configuration file to new location"
72
	    mv -f ${oldfile} ${newfile}
73
	else
74
	    echo "Configuration file in new location has been modified from the default: ${newfile}"
75
	    echo " => Deleting old configuration file"
76
	    rm ${oldfile}
77
	fi
78
    fi
79
}
80
81
########################################################################
82
83
case $2 in
84
    PRE-INSTALL)
85
	move_www_dir # at some point in the installation, the www dir is created
86
	;;
87
    POST-INSTALL)
88
	if [ -z "${PACKAGE_BUILDING}" ]
89
	then
90
	    create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
91
#BEGIN_MUNIN_MAIN
92
MAILTO=root
93
94
*/5 * * * *     ${PKG_PREFIX}/bin/munin-cron
95
#END_MUNIN_MAIN
96
EOT
97
	fi
98
	move_newsyslog_conf
99
	;;
100
esac
(-)b/sysutils/munin-master/pkg-plist (+2 lines)
Lines 37-43 bin/munin-cron Link Here
37
@comment BSD.local.dist but if not registered here, it will not exist in PREFIX
37
@comment BSD.local.dist but if not registered here, it will not exist in PREFIX
38
@comment when the package is installed.
38
@comment when the package is installed.
39
@dir etc/newsyslog.conf.d
39
@dir etc/newsyslog.conf.d
40
@dir etc/cron.d
40
@sample %%ETCDIR%%/munin-master.newsyslog etc/newsyslog.conf.d/munin-master.conf
41
@sample %%ETCDIR%%/munin-master.newsyslog etc/newsyslog.conf.d/munin-master.conf
42
@sample %%ETCDIR%%/munin-master.cron etc/cron.d/munin-master.conf
41
%%SITE_PERL%%/Munin/Master/Config.pm
43
%%SITE_PERL%%/Munin/Master/Config.pm
42
%%SITE_PERL%%/Munin/Master/GraphOld.pm
44
%%SITE_PERL%%/Munin/Master/GraphOld.pm
43
%%SITE_PERL%%/Munin/Master/Group.pm
45
%%SITE_PERL%%/Munin/Master/Group.pm
(-)b/sysutils/munin-node/files/pkg-message.in (-19 lines)
Lines 27-49 to install the plugins automatically Link Here
27
EOT
27
EOT
28
type: install
28
type: install
29
}
29
}
30
{
31
message: <<EOT
32
The munin-node newsyslog.conf(5) filename has been changed:
33
  OLD: ${PREFIX}/etc/newsyslog.conf.d/munin-node
34
  NEW: ${PREFIX}/etc/newsyslog.conf.d/munin-node.conf
35
36
Any file found at the old location has been automatically moved to
37
the new location. This was done to ensure log rotation continued to
38
work after change r340318 made to FreeBSD base, where the default
39
newsyslog configuration now only includes filenames that end with
40
'.conf' and do not begin with '.'.
41
42
If you use provisioning/configuration management tools to create or
43
edit this file, you will need to change their configuration to use
44
the new filename.
45
EOT
46
type: upgrade
47
maximum_version: "2.0.43_1"
48
}
49
]
30
]
(-)a/sysutils/munin-node/pkg-install (-43 lines)
Removed Link Here
1
#! /bin/sh
2
3
init_plugins() {
4
    if [ -f /tmp/.munin-node.version ]; then
5
	prevver=$(cat /tmp/.munin-node.version)
6
    fi
7
8
    if [ -n "$prevver" ]; then
9
	echo -n "Initializing new plugins.."
10
	${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x
11
    fi
12
    echo "done."
13
}
14
15
move_newsyslog_conf() {
16
    oldfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-node
17
    newfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-node.conf
18
    samplefile=${PKG_PREFIX}/etc/munin/munin-node.newsyslog
19
    if [ -f ${oldfile} ]; then
20
	echo "Configuration file found in old location: ${oldfile}"
21
	if cmp -s ${samplefile} ${newfile} > /dev/null; then
22
	    echo "Configuration file in new location has not been modified from the default: ${newfile}"
23
	    echo " => Moving old configuration file to new location"
24
	    mv -f ${oldfile} ${newfile}
25
	else
26
	    echo "Configuration file in new location has been modified from the default: ${newfile}"
27
	    echo " => Deleting old configuration file"
28
	    rm ${oldfile}
29
	fi
30
    fi
31
}
32
33
########################################################################
34
35
case $2 in
36
    POST-INSTALL)
37
	if [ -z "${PACKAGE_BUILDING}" ]; then
38
		init_plugins
39
	fi
40
	move_newsyslog_conf
41
	;;
42
esac
43
- 

Return to bug 258072