ports/126016: New port: net/ladvd CDP/LLDP sender

Sten Spans sten at blinkenlights.nl
Sun Jul 27 23:50:01 UTC 2008


>Number:         126016
>Category:       ports
>Synopsis:       New port: net/ladvd CDP/LLDP sender
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 27 23:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Sten Spans
>Release:        FreeBSD 7.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD random.blinkenlights.nl 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	Ladvd is a cdp / lldp sender for unix. The code has been tested
	on freebsd, openbsd and linux (i386, amd64, sparc). 
	Various BSD specific ioctls and features are supported.
>How-To-Repeat:
	
>Fix:

	Include this shar, the ladvd userid has been randomly selected
	from ports/UIDs.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	net/ladvd
#	net/ladvd/pkg-plist
#	net/ladvd/pkg-descr
#	net/ladvd/distinfo
#	net/ladvd/Makefile
#	net/ladvd/files
#	net/ladvd/files/ladvd.in
#	net/ladvd/pkg-message
#	net/ladvd/pkg-install
#
echo c - net/ladvd
mkdir -p net/ladvd > /dev/null 2>&1
echo x - net/ladvd/pkg-plist
sed 's/^X//' >net/ladvd/pkg-plist << 'END-of-net/ladvd/pkg-plist'
Xsbin/ladvd
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/LICENSE
X%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
END-of-net/ladvd/pkg-plist
echo x - net/ladvd/pkg-descr
sed 's/^X//' >net/ladvd/pkg-descr << 'END-of-net/ladvd/pkg-descr'
Xladvd is a minimal link layer advertisement sender which supports the
XCDP and LLDP packet formats.
X
XWWW: http://www.blinkenlights.nl/software/ladvd/
END-of-net/ladvd/pkg-descr
echo x - net/ladvd/distinfo
sed 's/^X//' >net/ladvd/distinfo << 'END-of-net/ladvd/distinfo'
XMD5 (ladvd-0.6.0.tar.gz) = f5ae227505bf27b98bcf2ca97e1e4215
XSHA256 (ladvd-0.6.0.tar.gz) = 0ac7d9898ae4f8176b9fa68140c0b7fa5a015c004c62cc5bba64400cdd391d71
XSIZE (ladvd-0.6.0.tar.gz) = 97266
END-of-net/ladvd/distinfo
echo x - net/ladvd/Makefile
sed 's/^X//' >net/ladvd/Makefile << 'END-of-net/ladvd/Makefile'
X# New ports collection makefile for:	ladvd
X# Date Created:				27 Jul 2008
X# Whom:					sten at blinkenlights.nl
X#
X# $FreeBSD$
X#
X
XPORTNAME=	ladvd
XPORTVERSION=	0.6.0
XCATEGORIES=	net
XMASTER_SITES=	http://blinkenlights.nl/software/ladvd/
XDISTNAME=	ladvd-${PORTVERSION}
X
XMAINTAINER=	sten at blinkenlights.nl
XCOMMENT=	A minimal CDP/LLDP sender
X
XGNU_CONFIGURE=	yes
XMAN8=		ladvd.8
XUSE_RC_SUBR+=	ladvd
X
Xpost-install:
X		@${ECHO} "==>  Creating custom user to run pdns_recursor..."
X		@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X		@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-net/ladvd/Makefile
echo c - net/ladvd/files
mkdir -p net/ladvd/files > /dev/null 2>&1
echo x - net/ladvd/files/ladvd.in
sed 's/^X//' >net/ladvd/files/ladvd.in << 'END-of-net/ladvd/files/ladvd.in'
X#!/bin/sh
X#
X# PROVIDE: ladvd
X# REQUIRE: DAEMON
X
X#
X# Add the following lines to /etc/rc.conf to enable ladvd:
X#
X#ladvd_enable="YES"
X#
X# See ladvd(8) for flags.
X#
X
X. %%RC_SUBR%%
X
Xname=ladvd
Xrcvar=`set_rcvar`
X
Xcommand=%%PREFIX%%/sbin/ladvd
Xload_rc_config ${name}
X
X# set defaults
Xladvd_enable=${ladvd_enable:-"NO"}
Xladvd_flags=${ladvd_flags:-"-cl"}
X
Xstart_precmd="ladvd_check"
X
Xladvd_check()
X{
X	if [ -z "${ladvd_flags}" ]
X	then
X		err 1 "ladvd_flags should be set"
X	fi
X}
X
Xrun_rc_command "$1"
END-of-net/ladvd/files/ladvd.in
echo x - net/ladvd/pkg-message
sed 's/^X//' >net/ladvd/pkg-message << 'END-of-net/ladvd/pkg-message'
X*******************************************************************
X If you want to run ladvd at startup you'll need the following
X line in /etc/rc.conf(.local):
X
X    ladvd_enable="YES"
X
X*******************************************************************
END-of-net/ladvd/pkg-message
echo x - net/ladvd/pkg-install
sed 's/^X//' >net/ladvd/pkg-install << 'END-of-net/ladvd/pkg-install'
X#!/bin/sh
X
Xif [ "$2" != "PRE-INSTALL" ]; then
X    exit 0
Xfi
X
XLADVDUSER=${LADVDUSER:-ladvd}
XLADVDUID=${LADVDUID:-142}
XLADVDGROUP=${LADVDGROUP:-ladvd}
XLADVDGID=${LADVDGID:-142}
X
Xif ! pw groupshow "$LADVDGROUP" 2>/dev/null 1>&2; then
X	if pw groupadd $LADVDGROUP -g $LADVDGID; then
X		echo "=> Added group \"$LADVDGROUP\"."
X	else
X		echo "=> Adding group \"$LADVDGROUP\" failed..."
X		exit 1
X	fi
Xfi
X
Xif ! pw usershow "$LADVDUSER" 2>/dev/null 1>&2; then
X	if pw useradd $LADVDUSER -u $LADVDUID -g $LADVDGROUP -h - \
X		-s "/sbin/nologin" -d "/nonexistent" \
X		-c "ladvd pseudo-user"; \
X	then
X		echo "=> Added user \"$LADVDUSER\"."
X	else
X		echo "=> Adding user \"$LADVDUSER\" failed..."
X		exit 1
X	fi
Xfi
Xexit 0
END-of-net/ladvd/pkg-install
exit


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list