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

(-)Makefile (-67 / +53 lines)
Lines 26-74 Link Here
26
NO_BUILD=	yes
26
NO_BUILD=	yes
27
USE_PERL5=	yes
27
USE_PERL5=	yes
28
28
29
OPTIONS=	FPING "Support for fping probes" on
30
OPTIONS+=	ECHOPING "Support for EchoPing probes" off
31
OPTIONS+=	CURL "Support for Curl probes" off
32
OPTIONS+=	LDAP "Support for LDAP probes" off
33
OPTIONS+=	LDAPSSL "Support for SSL-enabled LDAP probes" off
34
OPTIONS+=	RADIUS "Support for Radius probes" off
35
OPTIONS+=	TELNET "Support for TelnetIOSPing probes" off
36
OPTIONS+=	DNS "Support for AnotherDNS probes" off
37
38
.include <bsd.port.pre.mk>
39
40
.ifdef(WITH_FPING)
41
RUN_DEPENDS+=	${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
42
.endif
43
44
.ifdef(WITH_ECHOPING)
45
RUN_DEPENDS+=	${LOCALBASE}/bin/echoping:${PORTSDIR}/net/echoping
46
.endif
47
48
.ifdef(WITH_CURL)
49
RUN_DEPENDS+=	${LOCALBASE}/bin/curl:${PORTSDIR}/ftp/curl
50
.endif
51
52
.if defined(WITH_LDAP) || defined(WITH_LDAPSSL)
53
RUN_DEPENDS+=	${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap
54
.endif
55
56
.ifdef(WITH_RADIUS)
57
RUN_DEPENDS+=	${SITE_PERL}/Authen/Radius.pm:${PORTSDIR}/security/p5-Authen-Radius
58
.endif
59
60
.ifdef(WITH_LDAPSSL)
61
RUN_DEPENDS+=	${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
62
.endif
63
64
.ifdef(WITH_TELNET)
65
RUN_DEPENDS+=	${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet
66
.endif
67
68
.ifdef(WITH_DNS)
69
RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
70
.endif
71
72
USE_RC_SUBR=	smokeping
29
USE_RC_SUBR=	smokeping
73
30
74
MAN1=		smokeping.1 \
31
MAN1=		smokeping.1 \
Lines 114-131 Link Here
114
		smokeping_install.7 \
71
		smokeping_install.7 \
115
		smokeping_upgrade.7
72
		smokeping_upgrade.7
116
73
117
PKGMESSAGE=	${WRKDIR}/pkg-message
118
PKGINSTALL=	${WRKDIR}/pkg-install
119
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
74
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
120
75
121
USER=		smokeping
76
USERS=		smokeping
122
SMOKEPING_UID=	117
77
GROUPS=		smokeping
123
GROUP=		smokeping
78
124
SMOKEPING_GID=	117
79
SUB_FILES=	pkg-deinstall pkg-message
125
80
SUB_LIST=	USERS=${USERS} \
126
SUB_LIST+=	USER=${USER} UID=${SMOKEPING_UID} \
81
		GROUPS=${GROUPS} \
127
		GROUP=${GROUP} GID=${SMOKEPING_GID} \
82
		PERL=${PERL} \
128
		PERL=${PERL} PREFIX=${PREFIX}
83
		PKG_PREFIX=${PKG_PREFIX}
129
84
130
DOC1=		CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO
85
DOC1=		CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO
131
DOC2=		Config/Grammar \
86
DOC2=		Config/Grammar \
Lines 180-185 Link Here
180
135
181
ETC1=		basepage.html config smokemail tmail
136
ETC1=		basepage.html config smokemail tmail
182
137
138
OPTIONS=	FPING "Support for fping probes" on
139
OPTIONS+=	ECHOPING "Support for EchoPing probes" off
140
OPTIONS+=	CURL "Support for Curl probes" off
141
OPTIONS+=	LDAP "Support for LDAP probes" off
142
OPTIONS+=	LDAPSSL "Support for SSL-enabled LDAP probes" off
143
OPTIONS+=	RADIUS "Support for Radius probes" off
144
OPTIONS+=	TELNET "Support for TelnetIOSPing probes" off
145
OPTIONS+=	DNS "Support for AnotherDNS probes" off
146
147
.include <bsd.port.options.mk>
148
.ifdef(WITH_FPING)
149
RUN_DEPENDS+=	${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
150
.endif
151
152
.ifdef(WITH_ECHOPING)
153
RUN_DEPENDS+=	${LOCALBASE}/bin/echoping:${PORTSDIR}/net/echoping
154
.endif
155
156
.ifdef(WITH_CURL)
157
RUN_DEPENDS+=	${LOCALBASE}/bin/curl:${PORTSDIR}/ftp/curl
158
.endif
159
160
.if defined(WITH_LDAP) || defined(WITH_LDAPSSL)
161
RUN_DEPENDS+=	${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap
162
.endif
163
164
.ifdef(WITH_RADIUS)
165
RUN_DEPENDS+=	${SITE_PERL}/Authen/Radius.pm:${PORTSDIR}/security/p5-Authen-Radius
166
.endif
167
168
.ifdef(WITH_LDAPSSL)
169
RUN_DEPENDS+=	${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
170
.endif
171
172
.ifdef(WITH_TELNET)
173
RUN_DEPENDS+=	${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet
174
.endif
175
176
.ifdef(WITH_DNS)
177
RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
178
.endif
179
180
.include <bsd.port.pre.mk>
181
183
# Things that shouldn't have been in the tarball in the first place
182
# Things that shouldn't have been in the tarball in the first place
184
post-extract:
183
post-extract:
185
	${RM} ${WRKSRC}/lib/BER.pm
184
	${RM} ${WRKSRC}/lib/BER.pm
Lines 216-235 Link Here
216
		${WRKSRC}/etc/config.dist \
215
		${WRKSRC}/etc/config.dist \
217
		${WRKSRC}/lib/Smokeping/probes/*.pm
216
		${WRKSRC}/lib/Smokeping/probes/*.pm
218
	${FIND} ${WRKSRC} -name \*.bak -delete
217
	${FIND} ${WRKSRC} -name \*.bak -delete
219
	${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
220
		${PKGDIR}/pkg-message > ${PKGMESSAGE}
221
	${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
222
		${PKGDIR}/pkg-install > ${PKGINSTALL}
223
	${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
224
		${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
225
	${MV} ${WRKSRC}/bin/smokeping.dist ${WRKSRC}/bin/smokeping
218
	${MV} ${WRKSRC}/bin/smokeping.dist ${WRKSRC}/bin/smokeping
226
	${MV} ${WRKSRC}/bin/tSmoke.dist ${WRKSRC}/bin/tSmoke
219
	${MV} ${WRKSRC}/bin/tSmoke.dist ${WRKSRC}/bin/tSmoke
227
	${MV} ${WRKSRC}/htdocs/smokeping.cgi.dist ${WRKSRC}/htdocs/smokeping.cgi
220
	${MV} ${WRKSRC}/htdocs/smokeping.cgi.dist ${WRKSRC}/htdocs/smokeping.cgi
228
	${MV} ${WRKSRC}/htdocs/tr.cgi.dist ${WRKSRC}/htdocs/tr.cgi
221
	${MV} ${WRKSRC}/htdocs/tr.cgi.dist ${WRKSRC}/htdocs/tr.cgi
229
222
230
pre-su-install:
231
	PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
232
233
do-install:
223
do-install:
234
	${INSTALL_SCRIPT} ${WRKSRC}/bin/smokeping ${PREFIX}/bin
224
	${INSTALL_SCRIPT} ${WRKSRC}/bin/smokeping ${PREFIX}/bin
235
	${INSTALL_SCRIPT} ${WRKSRC}/bin/tSmoke ${PREFIX}/bin
225
	${INSTALL_SCRIPT} ${WRKSRC}/bin/tSmoke ${PREFIX}/bin
Lines 267-281 Link Here
267
	${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/smokeping/htdocs
257
	${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/smokeping/htdocs
268
	${CP} -R ${WRKSRC}/lib ${PREFIX}/smokeping/
258
	${CP} -R ${WRKSRC}/lib ${PREFIX}/smokeping/
269
	${MKDIR} ${PREFIX}/var/smokeping
259
	${MKDIR} ${PREFIX}/var/smokeping
270
	${CHOWN} -R ${USER}:${GROUP} ${PREFIX}/var/smokeping
260
	${CHOWN} -R ${USERS}:${GROUPS} ${PREFIX}/var/smokeping
271
261
272
post-install:
262
post-install:
273
	PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
274
.if !defined(BATCH)
263
.if !defined(BATCH)
275
	${CAT} ${PKGMESSAGE}
264
	${CAT} ${PKGMESSAGE}
276
.endif
265
.endif
277
266
278
post-deinstall:
279
	PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL
280
281
.include <bsd.port.post.mk>
267
.include <bsd.port.post.mk>
(-)pkg-deinstall (-55 lines)
Removed Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD: ports/net-mgmt/smokeping/pkg-deinstall,v 1.4 2004/02/24 12:41:37 eik Exp $
4
#
5
6
echo 'Stopping Smokeping daemon.'
7
if [ -f ${PKG_PREFIX}/var/smokeping/smokeping.pid ]; then
8
	if [ -x ${PKG_PREFIX}/etc/rc.d/smokeping.sh ]; then
9
		${PKG_PREFIX}/etc/rc.d/smokeping.sh stop > /dev/null
10
	fi
11
	rm ${PKG_PREFIX}/var/smokeping/smokeping.pid
12
fi
13
14
case $2 in
15
POST-DEINSTALL)
16
17
	if [ ! -n "$BATCH" ]; then
18
19
		if [ -d ${PKG_PREFIX}/etc/smokeping -o -d ${PKG_PREFIX}/var/smokeping ]; then
20
			echo '================================================================='
21
			echo
22
			echo 'You seem to have some custom config and data.'
23
			echo 'The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
24
			echo
25
			echo 'You may delete them with:'
26
			echo
27
			echo '  pw groupdel %%GROUP%%'
28
			echo '  pw userdel %%USER%%'
29
			echo
30
			echo 'The config and data can be deleted with:'
31
			echo
32
			echo "  rm -R ${PKG_PREFIX}/etc/smokeping"
33
			echo "  rm -R ${PKG_PREFIX}/var/smokeping"
34
			echo
35
			echo '================================================================='
36
		else
37
			if pw groupdel -n %%GROUP%%; then
38
				echo 'Removed group "%%GROUP%%".'
39
			else
40
				echo 'Removing group "%%GROUP%%" failed...'
41
				exit 1
42
			fi
43
44
			if pw userdel -n %%USER%%; then
45
				echo 'Removed user "%%USER%%".'
46
			else
47
				echo 'Removing user "%%USER%%" failed...'
48
				exit 1
49
			fi
50
		fi
51
	fi
52
53
	exit 0
54
	;;
55
esac
(-)pkg-install (-31 lines)
Removed Link Here
1
#! /bin/sh
2
#
3
# $FreeBSD: ports/net-mgmt/smokeping/pkg-install,v 1.6 2008/01/11 12:25:22 lth Exp $
4
#
5
6
case $2 in
7
PRE-INSTALL)
8
	if ! pw groupshow %%GROUP%% 2>/dev/null 1>&2; then
9
		if pw groupadd %%GROUP%% -g %%GID%% ; then
10
			echo 'Added group "%%GROUP%%".'
11
		else
12
			echo 'Adding group "%%GROUP%%" failed...'
13
			exit 1
14
		fi
15
	fi
16
17
	if ! pw usershow %%USER%% 2>/dev/null 1>&2; then
18
                if pw useradd %%USER%% -u %%UID%% -g %%GROUP%% -h - \
19
			-s "/sbin/nologin" -d "/nonexistent" \
20
			-c "SmokePing Daemon"; \
21
		then
22
			echo 'Added user "%%USER%%".'
23
		else
24
			echo 'Adding user "%%USER%%" failed...'
25
			exit 1
26
		fi
27
	fi
28
29
	exit 0
30
	;;
31
esac
(-)pkg-message (-36 lines)
Removed Link Here
1
=================================================================
2
3
SmokePing has now been installed in %%PREFIX%%/smokeping/.
4
5
NOTE: A set of sample configuration files have been installed:
6
7
  %%PREFIX%%/etc/smokeping/config
8
  %%PREFIX%%/etc/smokeping/smokemail
9
  %%PREFIX%%/etc/smokeping/basepage.html
10
  %%PREFIX%%/etc/smokeping/tmail
11
12
You *MUST* edit these to suit your requirements. Please read the
13
manpages 'smokeping_install' and 'smokeping_config' for further
14
details on installation and configuration.
15
16
If you are upgrading from a previous version of Smokeping, the
17
manpage 'smokeping_upgrade' may be of help.
18
19
Once configured, you can start SmokePing by adding:
20
21
  smokeping_enable="YES"
22
23
to /etc/rc.conf, and then running, as root:
24
25
  %%PREFIX%%/etc/rc.d/smokeping start
26
27
To enable Apache web access, add something like the following to
28
your %%PREFIX%%/etc/apache/httpd.conf:
29
30
  DocumentRoot %%PREFIX%%/smokeping/htdocs
31
  ScriptAlias /smokeping.cgi %%PREFIX%%/smokeping/htdocs/smokeping.cgi
32
  ScriptAlias /tr.cgi %%PREFIX%%/smokeping/htdocs/tr.cgi
33
34
Enjoy!
35
36
=================================================================
(-)pkg-plist (+1 lines)
Lines 1-3 Link Here
1
@stopdaemon smokeping
1
bin/smokeping
2
bin/smokeping
2
bin/tSmoke
3
bin/tSmoke
3
@unexec if cmp -s %D/etc/smokeping/basepage.html %D/etc/smokeping/basepage.html.dist; then rm -f %D/etc/smokeping/basepage.html; fi
4
@unexec if cmp -s %D/etc/smokeping/basepage.html %D/etc/smokeping/basepage.html.dist; then rm -f %D/etc/smokeping/basepage.html; fi
(-)files/pkg-deinstall.in (+9 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD: ports/net-mgmt/smokeping/pkg-deinstall,v 1.4 2004/02/24 12:41:37 eik Exp $
4
#
5
6
if [ -f ${PKG_PREFIX}/var/smokeping/smokeping.pid ]; then
7
rm ${PKG_PREFIX}/var/smokeping/smokeping.pid
8
fi
9
(-)files/pkg-message.in (+36 lines)
Added Link Here
1
=================================================================
2
3
SmokePing has now been installed in %%PREFIX%%/smokeping/.
4
5
NOTE: A set of sample configuration files have been installed:
6
7
  %%ETCDIR%%/config
8
  %%ETCDIR%%/smokemail
9
  %%ETCDIR%%/basepage.html
10
  %%ETCDIR%%/tmail
11
12
You *MUST* edit these to suit your requirements. Please read the
13
manpages 'smokeping_install' and 'smokeping_config' for further
14
details on installation and configuration.
15
16
If you are upgrading from a previous version of Smokeping, the
17
manpage 'smokeping_upgrade' may be of help.
18
19
Once configured, you can start SmokePing by adding:
20
21
  smokeping_enable="YES"
22
23
to /etc/rc.conf, and then running, as root:
24
25
  %%PREFIX%%/etc/rc.d/smokeping start
26
27
To enable Apache web access, add something like the following to
28
your %%PREFIX%%/etc/apache/httpd.conf:
29
30
  DocumentRoot %%PREFIX%%/smokeping/htdocs
31
  ScriptAlias /smokeping.cgi %%PREFIX%%/smokeping/htdocs/smokeping.cgi
32
  ScriptAlias /tr.cgi %%PREFIX%%/smokeping/htdocs/tr.cgi
33
34
Enjoy!
35
36
=================================================================

Return to bug 143182