diff options
author | vs <vs@FreeBSD.org> | 2004-08-13 21:36:02 +0800 |
---|---|---|
committer | vs <vs@FreeBSD.org> | 2004-08-13 21:36:02 +0800 |
commit | 71676966eeddce8d4ea282e5b22b16ece8767fbc (patch) | |
tree | e56c20cf9e31a5993ffdb91886935855dc5ba9f0 /security/nessus | |
parent | a424fb444a8e6b2745a4a69291d65466e44adc45 (diff) | |
download | freebsd-ports-gnome-71676966eeddce8d4ea282e5b22b16ece8767fbc.tar.gz freebsd-ports-gnome-71676966eeddce8d4ea282e5b22b16ece8767fbc.tar.zst freebsd-ports-gnome-71676966eeddce8d4ea282e5b22b16ece8767fbc.zip |
- Add WITHOUT_NESSUS_GTK knob.
- Upgrade rc.d script to the rc-ng style; bump PORTREVISION for that.
- Add CONFLICTS.
PR: ports/69877
Submitted by: Udo Schweigert (maintainer)
Diffstat (limited to 'security/nessus')
-rw-r--r-- | security/nessus/Makefile | 26 | ||||
-rw-r--r-- | security/nessus/files/nessusd.sh | 53 | ||||
-rw-r--r-- | security/nessus/pkg-message | 10 | ||||
-rw-r--r-- | security/nessus/pkg-plist | 2 | ||||
-rw-r--r-- | security/nessus/scripts/move_nessus | 31 |
5 files changed, 82 insertions, 40 deletions
diff --git a/security/nessus/Makefile b/security/nessus/Makefile index 8e83d13fa2d8..5ffecadd7a6e 100644 --- a/security/nessus/Makefile +++ b/security/nessus/Makefile @@ -4,9 +4,13 @@ # # $FreeBSD$ # +# If you want to only have the command-line client even if gtk is already +# installed define: +# WITHOUT_NESSUS_GTK PORTNAME= nessus PORTVERSION= 2.0.12 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= ftp://ftp.nessus.org/pub/nessus/nessus-${PORTVERSION}/src/ \ ftp://ftp.gwdg.de/pub/linux/misc/nessus/nessus-${PORTVERSION}/src/ \ @@ -19,17 +23,25 @@ DISTNAME= nessus-core-${PORTVERSION} MAINTAINER= udo.schweigert@siemens.com COMMENT= A security scanner: looks for vulnerabilities in a given network +CONFLICTS= nessus-devel-[0-9]* nessus-devel-gtk-[0-9]* \ + nessus-devel-gtk2-[0-9]* LIB_DEPENDS= nasl.2:${PORTSDIR}/security/nessus-libnasl DIST_SUBDIR= nessus WRKSRC= ${WRKDIR}/nessus-core USE_LIBTOOL_VER=13 -WANT_GNOME= yes USE_REINPLACE= YES +USE_RC_SUBR= YES +.if !defined(WITHOUT_NESSUS_GTK) +WANT_GNOME= yes +.endif .include <bsd.port.pre.mk> +.if defined(WITHOUT_NESSUS_GTK) +CONFIGURE_ARGS+=--disable-gtk +.else .if ${HAVE_GNOME:Mgtk20}!="" USE_GNOME+= gtk20 PKGNAMESUFFIX= -gtk2 @@ -39,17 +51,18 @@ PKGNAMESUFFIX= -gtk .else CONFIGURE_ARGS+=--disable-gtk .endif +.endif MAN1= nessus.1 nessus-mkrand.1 nessus-mkcert-client.1 MAN8= nessusd.8 nessus-adduser.8 nessus-mkcert.8 nessus-rmuser.8 -post-extract: - @${CP} ${FILESDIR}/nessusd.sh ${WRKSRC}/nessusd.sh - @${REINPLACE_CMD} -E -e 's|%%PREFIX%%|${PREFIX}|g' ${BUILD_WRKSRC}/nessusd.sh +RC_SCRIPTS_SUB= PREFIX=${PREFIX} \ + RC_SUBR=${RC_SUBR} post-install: - ${INSTALL_SCRIPT} ${BUILD_WRKSRC}/nessusd.sh \ - ${LOCALBASE}/etc/rc.d/nessusd.sh.sample + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/nessusd.sh > ${LOCALBASE}/etc/rc.d/nessusd.sh + @${CHMOD} +x ${LOCALBASE}/etc/rc.d/nessusd.sh @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/move_nessus .if ! exists(${PREFIX}/var/CA/serverkey.pem) .if ! defined(BATCH) @@ -58,5 +71,6 @@ post-install: ${PREFIX}/sbin/nessus-mkcert -q .endif .endif + @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/security/nessus/files/nessusd.sh b/security/nessus/files/nessusd.sh index 6fe58eadd1f0..b72c4f15e78c 100644 --- a/security/nessus/files/nessusd.sh +++ b/security/nessus/files/nessusd.sh @@ -1,28 +1,37 @@ -#! /bin/sh -# +#!/bin/sh + +# Start or stop nessusd # $FreeBSD$ + +# PROVIDE: nessusd +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown # +# NOTE for FreeBSD 5.0+: +# If you want this script to start with the base rc scripts +# move nessusd.sh to /etc/rc.d/nessusd -umask 022 -arg=${1:-start} +prefix=%%PREFIX%% + +# Define these nessusd_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/nessusd +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +[ -z "$nessusd_enable" ] && nessusd_enable="NO" # Disable nessusd +#nessusd_program="${prefix}/sbin/nessusd" # Location of nessusd +nessusd_flags="-D" # Flags to nessusd program -nessusd_bin=%%PREFIX%%/sbin/nessusd -nessus_arg="-D" -kill_arg=nessusd +. %%RC_SUBR%% -echo -n " nessusd" +name="nessusd" +rcvar=`set_rcvar` +command="${prefix}/sbin/nessusd" +pidfile="/usr/local/var/nessus/nessusd.pid" +required_files="${prefix}/etc/nessus/nessusd.conf" -case $arg in -start) - test -x $nessusd_bin || exit 1 - $nessusd_bin $nessus_arg - ;; -stop) - killall $kill_arg > /dev/null 2>&1 - ;; -restart) - killall $kill_arg > /dev/null 2>&1 - test -x $nessusd_bin || exit 1 - $nessusd_bin $nessus_arg - ;; -esac +load_rc_config $name +run_rc_command "$1" diff --git a/security/nessus/pkg-message b/security/nessus/pkg-message new file mode 100644 index 000000000000..16f469e1ce27 --- /dev/null +++ b/security/nessus/pkg-message @@ -0,0 +1,10 @@ + *********************************** + * !!!!!!!!!!! WARNING !!!!!!!!!!! * + *********************************** +Since 2.0.12_1, to run nessusd server from startup, add nessusd_enable="YES" +in your /etc/rc.conf. + +Available variables you add/set to /etc/rc.conf. +- nessusd_enable (bool): Set to "NO" by default. + Set it to "YES" to enable nessusd. +- nessusd_flags (str): Set to "-D" by default. diff --git a/security/nessus/pkg-plist b/security/nessus/pkg-plist index 810874f76d06..6c7c66e33bc1 100644 --- a/security/nessus/pkg-plist +++ b/security/nessus/pkg-plist @@ -1,4 +1,4 @@ -etc/rc.d/nessusd.sh.sample +etc/rc.d/nessusd.sh bin/nessus bin/nessus-mkcert-client bin/nessus-mkrand diff --git a/security/nessus/scripts/move_nessus b/security/nessus/scripts/move_nessus index 0da5e8a62128..7c5d16e4efac 100644 --- a/security/nessus/scripts/move_nessus +++ b/security/nessus/scripts/move_nessus @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: /tmp/pcvs/ports/security/nessus/scripts/move_nessus,v 1.1 2004-04-10 20:42:56 linimon Exp $ +# $FreeBSD: /tmp/pcvs/ports/security/nessus/scripts/move_nessus,v 1.2 2004-08-13 13:36:02 vs Exp $ # # set -x @@ -25,16 +25,21 @@ if [ -f $PREFIX/etc/nessus/nessusd.conf ]; then $PREFIX/etc/nessus/nessusd.conf.bak > $PREFIX/etc/nessus/nessusd.conf fi if [ -d $PREFIX/etc/nessus/var/nessus/users ]; then - printf "\n\nMigrating nessus to default directory scheme\n" - printf "============================================\n\n" - cd $PREFIX/etc/nessus/var/nessus/users - for i in *; do - if [ $i != '*' ]; then - mv $i $PREFIX/var/nessus/users - printf "Moving nessus user %s\n" $i - fi - done - printf "\n" + rmdir $PREFIX/etc/nessus/var/nessus/users > /dev/null 2>/dev/null + if [ $? -gt 0 ]; then + printf "\n\nMigrating nessus to default directory scheme\n" + printf "============================================\n\n" + cd $PREFIX/etc/nessus/var/nessus/users + for i in *; do + if [ $i != '*' ]; then + mv $i $PREFIX/var/nessus/users + printf "Moving nessus user %s\n" $i + fi + done + cd $PREFIX + rmdir $PREFIX/etc/nessus/var/nessus/users > /dev/null 2>/dev/null + printf "\n" + fi fi if [ ! -d $PREFIX/com/CA ]; then if [ -d $PREFIX/etc/nessus/com/CA ]; then @@ -49,3 +54,7 @@ if [ ! -d $PREFIX/com/CA ]; then fi fi fi +cd $PREFIX +rmdir $PREFIX/etc/nessus/var > /dev/null 2>/dev/null +rmdir $PREFIX/etc/nessus/com > /dev/null 2>/dev/null +exit 0 |