diff options
author | Sergey Matveychuk <sem@FreeBSD.org> | 2011-11-25 14:09:12 +0000 |
---|---|---|
committer | Sergey Matveychuk <sem@FreeBSD.org> | 2011-11-25 14:09:12 +0000 |
commit | 7c3abdf67609bf94082f67610e9a8a032943fe4a (patch) | |
tree | 9437e6a4411c5b89bbca623bc61e627a932b6a85 /net | |
parent | dbc5bacb23c3ca210c2abcd2467121bc809c0cd1 (diff) |
Notes
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/quagga-re/Makefile | 183 | ||||
-rw-r--r-- | net/quagga-re/distinfo | 2 | ||||
-rw-r--r-- | net/quagga-re/files/patch-ospfd__ospf_packet.c | 11 | ||||
-rw-r--r-- | net/quagga-re/files/quagga.sh.in | 122 | ||||
-rw-r--r-- | net/quagga-re/files/watchquagga.sh.in | 37 | ||||
-rw-r--r-- | net/quagga-re/pkg-descr | 6 | ||||
-rw-r--r-- | net/quagga-re/pkg-install | 75 | ||||
-rw-r--r-- | net/quagga-re/pkg-plist | 85 |
9 files changed, 522 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 16fa8b558588..a5a7fa0884e7 100644 --- a/net/Makefile +++ b/net/Makefile @@ -902,6 +902,7 @@ SUBDIR += qoauth SUBDIR += qt4-network SUBDIR += quagga + SUBDIR += quagga-re SUBDIR += queso SUBDIR += quoted SUBDIR += rabbitmq diff --git a/net/quagga-re/Makefile b/net/quagga-re/Makefile new file mode 100644 index 000000000000..e1aba315ad06 --- /dev/null +++ b/net/quagga-re/Makefile @@ -0,0 +1,183 @@ +# New ports collection makefile for: quagga-re +# Date created: 25 Nov 2011 +# Whom: Sergey Matveychuk <sem@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= quagga +PORTVERSION= 0.99.17.5 +CATEGORIES= net ipv6 +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= quagga/Quagga-RE +PKGNAMESUFFIX= -re + +MAINTAINER= sem@FreeBSD.org +COMMENT= A branch of popular quagga software pointed at stability + +CONFLICTS= openbgpd-[0-9]* zebra-0* quagga-[0-9] + +USE_AUTOTOOLS= libtool autoheader +USE_GMAKE= yes +USE_LDCONFIG= yes +USE_PERL5_BUILD= yes +BUILD_DEPENDS+= gawk:${PORTSDIR}/lang/gawk + +MAN1= vtysh.1 +MAN8= bgpd.8 ospf6d.8 ospfd.8 ripd.8 ripngd.8 zebra.8 +INFO= quagga + +OPTIONS= ISISD "Enable experimental ISIS daemon" off \ + PAM "PAM authentication for vtysh" off \ + OSPF_NSSA "NSSA support (RFC1587)" off \ + OSPF_OPAQUE_LSA "OSPF Opaque-LSA support (RFC2370)" off \ + RTADV "IPv6 Router Advertisements" off \ + SNMP "SNMP support" off \ + TCPSOCKETS "Use TCP/IP sockets for protocol daemons" off \ + DLMALLOC "Use dlmalloc (makes bgpd much faster)" off \ + NO_BGP_ANNOUNCE "Turn off BGP route announcement" off + +.include <bsd.port.pre.mk> + +CFLAGS+= -I${LOCALBASE}/include +.if ${OSVERSION} >= 800000 +LDFLAGS+= -fstack-protector +.endif +CONFIGURE_ARGS+=--includedir=${PREFIX}/include --enable-exampledir=${PREFIX}/share/examples/quagga +CONFIGURE_ENV+= LIBTOOL=${LIBTOOL} LIBTOOLIZE=${LIBTOOLIZE} \ + LIBTOOL_VERSION=${LIBTOOL_VERSION} +LDFLAGS+= -L${LOCALBASE}/lib + +.if !defined(ENABLE_USER) +ENABLE_USER=quagga +.endif +.if !defined(ENABLE_GROUP) +ENABLE_GROUP=quagga +.endif + +CONFIGURE_ARGS+=--enable-user=${ENABLE_USER} +CONFIGURE_ARGS+=--enable-group=${ENABLE_GROUP} + +.if !defined(SYSCONF_DIR) +SYSCONF_DIR=${PREFIX}/etc/quagga +.endif +.if !defined(LOCALSTATE_DIR) +LOCALSTATE_DIR=/var/run/quagga +.endif + +CONFIGURE_ARGS+=--sysconfdir=${SYSCONF_DIR} +CONFIGURE_ARGS+=--localstatedir=${LOCALSTATE_DIR} + +.if defined(ENABLE_VTY_GROUP) +CONFIGURE_ARGS+=--enable-vty-group=${ENABLE_VTY_GROUP} +.endif + +CONFIGURE_ARGS+=--enable-vtysh + +SCRIPTS_ENV= PREFIX=${PREFIX} PKG_PREFIX=${PREFIX} \ + SYSCONF_DIR=${SYSCONF_DIR} SYSSTATE_DIR=${SYSSTATE_DIR} \ + ENABLE_USER=${ENABLE_USER} ENABLE_GROUP=${ENABLE_GROUP} + +.if defined(WITH_ISISD) +CONFIGURE_ARGS+=--enable-isisd +PLIST_SUB+= ISISD="" +.else +PLIST_SUB+= ISISD="@comment " +.endif +MAN8+= isisd.8 + +.if defined(WITH_PAM) +CONFIGURE_ARGS+=--with-libpam +.endif + +.if defined(WITH_OSPFNSSA) +CONFIGURE_ARGS+=--enable-nssa +.endif + +.if defined(WITH_OSPF_OPAQUE_LSA) +CONFIGURE_ARGS+=--enable-opaque-lsa +PLIST_SUB+= OSPFAPI="" +.else +CONFIGURE_ARGS+=--disable-opaque-lsa +PLIST_SUB+= OSPFAPI="@comment " +.endif + +.if defined(WITH_RTADV) +CONFIGURE_ARGS+=--enable-rtadv +.endif + +.if defined(WITH_SNMP) +CONFIGURE_ARGS+=--enable-snmp +LIB_DEPENDS+=netsnmp:${PORTSDIR}/net-mgmt/net-snmp +.endif + +.if defined(WITH_TCPSOCKETS) +CONFIGURE_ARGS+=--enable-tcp-zebra +.endif + +.if defined(WITH_DLMALLOC) +LIB_DEPENDS+=dlmalloc.2:${PORTSDIR}/devel/libdlmalloc +LDFLAGS+=-ldlmalloc +SUB_LIST= RCLDCONFIG=ldconfig +.else +SUB_LIST= RCLDCONFIG= +.endif + +.if defined(WITH_NO_BGP_ANNOUNCE) +CONFIGURE_ARGS+=--disable-bgp-announce +.endif + +USE_RC_SUBR= quagga.sh watchquagga.sh + +SUB_LIST+= LOCALSTATE_DIR=${LOCALSTATE_DIR} \ + SYSCONF_DIR=${SYSCONF_DIR} + +PLIST_SUB+= LOCALSTATE_DIR=${LOCALSTATE_DIR} \ + SYSCONF_DIR=${SYSCONF_DIR} \ + ENABLE_USER=${ENABLE_USER} \ + ENABLE_GROUP=${ENABLE_GROUP} + +pre-everything:: + @${ECHO} "=============================================================" + @${ECHO} + @${ECHO} "You can build ${PORTNAME} with the following options:" + @${ECHO} + @${ECHO} "ENABLE_USER Specify user to run Quagga suite as" + @${ECHO} "ENABLE_GROUP Specify group to run Quagga suite as" + @${ECHO} "ENABLE_VTY_GROUP Specify group for vty socket ownership" + @${ECHO} "SYSCONF_DIR Specify directory for Quagga configuration files" + @${ECHO} "LOCALSTATE_DIR Specify directory for Quagga runtime files" + @${ECHO} + @${ECHO} "The following options may be configured interactively:" + @${ECHO} " WITH_PAM PAM authentication for vtysh" + @${ECHO} " WITH_OSPF_NSSA NSSA support (RFC1587)" + @${ECHO} " WITH_OSPF_OPAQUE_LSA OSPF Opaque-LSA with OSPFAPI support (RFC2370)" + @${ECHO} " WITH_RTADV IPv6 Router Advertisements" + @${ECHO} " WITH_SNMP SNMP support" + @${ECHO} " WITH_TCPSOCKETS Use TCP/IP sockets for protocol daemons" + @${ECHO} " WITH_DLMALLOC Use dlmalloc (makes bgpd much faster)" + @${ECHO} " WITH_NO_BGP_ANNOUNCE Turn off BGP route announcement" + +post-install: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${ECHO} "===> installing ${PORTNAME} startup file..." + @${ECHO} "Add the following lines to /etc/rc.conf to enable quagga:" + @${ECHO} "" + @${ECHO} "defaultrouter=\"NO\"" + @${ECHO} "quagga_enable=\"YES\"" + @${ECHO} "" + @${ECHO} "Also, you may wish to set the following options:" + @${ECHO} "quagga_daemons=\"zebra bgpd etc...\"" + @${ECHO} "quagga_flags=\"....\"" + @${ECHO} "quagga_extralibs_path=\"/path1 /path2\"" + @${ECHO} "router_enable=\"NO\"" + @${ECHO} "watchquagga_enable=\"YES\"" + @${ECHO} "watchquagga_flags=\"...\"" + @${ECHO} "" + +.if !defined(BATCH) +post-clean: + @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc +.endif + +.include <bsd.port.post.mk> diff --git a/net/quagga-re/distinfo b/net/quagga-re/distinfo new file mode 100644 index 000000000000..75648886e0c2 --- /dev/null +++ b/net/quagga-re/distinfo @@ -0,0 +1,2 @@ +SHA256 (quagga-0.99.17.5.tar.gz) = 4687ce2385770ba4e94262b1a3c6a4f7777d58281eb46ed9b44ec2de4ca19ebf +SIZE (quagga-0.99.17.5.tar.gz) = 2225727 diff --git a/net/quagga-re/files/patch-ospfd__ospf_packet.c b/net/quagga-re/files/patch-ospfd__ospf_packet.c new file mode 100644 index 000000000000..fb312c5bf68e --- /dev/null +++ b/net/quagga-re/files/patch-ospfd__ospf_packet.c @@ -0,0 +1,11 @@ +--- ospfd/ospf_packet.c.orig 2011-09-29 18:59:32.000000000 +0600 ++++ ospfd/ospf_packet.c 2011-11-12 12:02:58.000000000 +0600 +@@ -2116,7 +2116,7 @@ + + ip_len = iph->ip_len; + +-#if !defined(GNU_LINUX) && (OpenBSD < 200311) ++#if !defined(GNU_LINUX) && (OpenBSD < 200311) && (__FreeBSD_version < 1000000) + /* + * Kernel network code touches incoming IP header parameters, + * before protocol specific processing. diff --git a/net/quagga-re/files/quagga.sh.in b/net/quagga-re/files/quagga.sh.in new file mode 100644 index 000000000000..ceb71b62d1b2 --- /dev/null +++ b/net/quagga-re/files/quagga.sh.in @@ -0,0 +1,122 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: quagga +# REQUIRE: netif routing +# KEYWORD: nojail + +# +# Add the following line to /etc/rc.conf to enable quagga: +#quagga_enable="YES" +# +# You may also wish to use the following variables to fine-tune startup: +# quagga_flags="-d" +# quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd" +# Per daemon tuning may be done with daemon_name_flags +# zebra_flags="-dP 0" +# bgpd_flags="-dnrP 0" and so on +# If you want to give the routing deamons a chance to catchup before +# continueing, set quagga_wait_for to a "default" or certain prefix. +# quagga_wait_for="default" +# +# If the quagga daemons require additional shared libraries to start, +# use the following variable to run ldconfig(8) in advance: +#quagga_extralibs_path="/usr/local/lib ..." +# + +. /etc/rc.subr + +name="quagga" +rcvar=`set_rcvar` + +start_postcmd=start_postcmd +stop_postcmd=stop_postcmd + +start_postcmd() +{ + # Wait only when last daemon has started. + if [ "${quagga_daemons}" = "${quagga_daemons% ${name}}" ]; then + return; + fi + if [ ${quagga_wait_for} ]; then + echo Waiting for ${quagga_wait_for} route... + while true; do + /sbin/route -n get ${quagga_wait_for} >/dev/null 2>&1 && break; + sleep 1; + done + fi +} + +stop_postcmd() +{ + rm -f $pidfile +} + +do_cmd() +{ + local ret + ret=0 + for daemon in ${quagga_daemons}; do + command=%%PREFIX%%/sbin/${daemon} + required_files=%%SYSCONF_DIR%%/${daemon}.conf + pidfile=%%LOCALSTATE_DIR%%/${daemon}.pid + if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then + continue + fi + if [ ${quagga_cmd} = "stop" -a -z $(check_process ${command}) ]; then + continue + fi + eval flags=\$\{${daemon}_flags:-\"${quagga_flags}\"\} + name=${daemon} + _rc_restart_done=false + run_rc_command "$1" || ret=1 + done + return ${ret} +} + +# set defaults + +load_rc_config $name + +: ${quagga_enable="NO"} +: ${quagga_flags="-d"} +: ${quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"} + +quagga_cmd=$1 + +case "$1" in + force*) + quagga_cmd=${quagga_cmd#force} + ;; + fast*) + quagga_cmd=${quagga_cmd#fast} + ;; +esac +shift + +if [ $# -ge 1 ]; then + quagga_daemons="$*" +fi + +case "${quagga_cmd}" in + start) + if [ ! -z ${quagga_extralibs_path} ]; then + /sbin/ldconfig -m ${quagga_extralibs_path} + fi + do_cmd "start" + ;; + stop) + quagga_daemons=$(reverse_list ${quagga_daemons}) + do_cmd "stop" + ;; + restart) + quagga_daemons=$(reverse_list ${quagga_daemons}) + do_cmd "stop" + quagga_daemons=$(reverse_list ${quagga_daemons}) + do_cmd "start" + ;; + *) + do_cmd "${quagga_cmd}" + ;; +esac diff --git a/net/quagga-re/files/watchquagga.sh.in b/net/quagga-re/files/watchquagga.sh.in new file mode 100644 index 000000000000..cb0d1bf1e751 --- /dev/null +++ b/net/quagga-re/files/watchquagga.sh.in @@ -0,0 +1,37 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: watchquagga +# REQUIRE: NETWORKING quagga +# +# Add the following line to /etc/rc.conf to enable quagga: +# watchquagga_enable="YES" +# +# You may also wish to use the following variables to fine-tune startup: +# watchquagga_flags +# +# + +. /etc/rc.subr + +name="watchquagga" +rcvar=`set_rcvar` + + +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +# set defaults + +load_rc_config $name + +: ${watchquagga_enable="NO"} + +command=%%PREFIX%%/sbin/watchquagga +pidfile=%%LOCALSTATE_DIR%%/watchquagga.pid +run_rc_command "$1" diff --git a/net/quagga-re/pkg-descr b/net/quagga-re/pkg-descr new file mode 100644 index 000000000000..a1828f1cd72d --- /dev/null +++ b/net/quagga-re/pkg-descr @@ -0,0 +1,6 @@ +Quagga-RE (Release Engineering) is a process established on the base of +the well-known Quagga Routing Suite project. The aim of this process is +to deliver better tested version releases, in the first turn focused on +OSPF and BGP stability. + +WWW: http://sourceforge.net/projects/quagga/files/Quagga-RE/ diff --git a/net/quagga-re/pkg-install b/net/quagga-re/pkg-install new file mode 100644 index 000000000000..87fe58302cfe --- /dev/null +++ b/net/quagga-re/pkg-install @@ -0,0 +1,75 @@ +#!/bin/sh + +PATH=/bin:/usr/sbin + +if [ -z "${SYSCONF_DIR}" ]; then + SYSCONF_DIR=${PKG_PREFIX}/etc/quagga +fi + +if [ -z "${LOCALSTATE_DIR}" ]; then + LOCALSTATE_DIR=/var/run/quagga +fi + +if [ -z "${ENABLE_USER}" ]; then + ENABLE_USER=quagga +fi + +if [ -z "${ENABLE_GROUP}" ]; then + ENABLE_GROUP=quagga +fi + +case $2 in + POST-INSTALL) + UID=101 + GID=${UID} + if pw group show "${ENABLE_GROUP}" 2>/dev/null; then + echo "You already have a group \"${ENABLE_GROUP}\", so I will use it." + else + if pw groupadd ${ENABLE_GROUP} -g ${GID}; then + echo "Added group \"${ENABLE_GROUP}\"." + else + echo "Adding group \"${ENABLE_GROUP}\" failed." + exit 1 + fi + fi + + if pw user show "${ENABLE_USER}" 2>/dev/null; then + echo "You already have a user \"${ENABLE_USER}\", so I will use it." + if pw usermod ${ENABLE_USER} -d ${SYSCONF_DIR} + then + echo "Changed home directory of \"${ENABLE_USER}\" to \"${SYSCONF_DIR}\"" + else + echo "Changing home directory of \"${ENABLE_USER}\" to \"${SYSCONF_DIR}\" failed..." + exit 1 + fi + else + if pw useradd ${ENABLE_USER} -u ${UID} -g ${ENABLE_GROUP} -h - \ + -d ${SYSCONF_DIR} -s /sbin/nologin -c "Quagga Daemon" + then + echo "Added user \"${ENABLE_USER}\"." + else + echo "Adding user \"${ENABLE_USER}\" failed..." + exit 1 + fi + fi + + mkdir ${LOCALSTATE_DIR} + if [ ! -d ${LOCALSTATE_DIR} ]; then + echo "Creating \"${LOCALSTATE_DIR}\" failed." + exit 1 + fi + + chown -R ${ENABLE_USER}:${ENABLE_GROUP} ${LOCALSTATE_DIR} + + if [ ! -d ${SYSCONF_DIR} ]; then + mkdir -p ${SYSCONF_DIR} + fi + + if [ ! -d ${SYSCONF_DIR} ]; then + echo "Creating \"${SYSCONF_DIR}\" failed." + exit 1 + fi + + chown -R ${ENABLE_USER}:${ENABLE_GROUP} ${SYSCONF_DIR} + ;; +esac diff --git a/net/quagga-re/pkg-plist b/net/quagga-re/pkg-plist new file mode 100644 index 000000000000..da4cf1081b36 --- /dev/null +++ b/net/quagga-re/pkg-plist @@ -0,0 +1,85 @@ +sbin/bgpd +%%ISISD%%sbin/isisd +sbin/ospf6d +%%OSPFAPI%%sbin/ospfclient +sbin/ospfd +sbin/ripd +sbin/ripngd +sbin/watchquagga +sbin/zebra +bin/vtysh +lib/libospf.a +lib/libospf.la +lib/libospf.so +lib/libospf.so.0 +%%OSPFAPI%%lib/libospfapiclient.a +%%OSPFAPI%%lib/libospfapiclient.la +%%OSPFAPI%%lib/libospfapiclient.so +%%OSPFAPI%%lib/libospfapiclient.so.0 +lib/libzebra.a +lib/libzebra.la +lib/libzebra.so +lib/libzebra.so.0 +include/quagga/buffer.h +include/quagga/checksum.h +include/quagga/command.h +include/quagga/distribute.h +include/quagga/filter.h +include/quagga/getopt.h +include/quagga/hash.h +include/quagga/if.h +include/quagga/if_rmap.h +include/quagga/jhash.h +include/quagga/keychain.h +include/quagga/linklist.h +include/quagga/log.h +include/quagga/md5.h +include/quagga/memory.h +include/quagga/memtypes.h +include/quagga/network.h +%%OSPFAPI%%include/quagga/ospfapi/ospf_apiclient.h +include/quagga/ospfd/ospf_api.h +include/quagga/ospfd/ospf_asbr.h +include/quagga/ospfd/ospf_dump.h +include/quagga/ospfd/ospf_ism.h +include/quagga/ospfd/ospf_lsa.h +include/quagga/ospfd/ospf_lsdb.h +include/quagga/ospfd/ospf_nsm.h +include/quagga/ospfd/ospf_opaque.h +include/quagga/ospfd/ospfd.h +include/quagga/plist.h +include/quagga/pqueue.h +include/quagga/prefix.h +include/quagga/privs.h +include/quagga/routemap.h +include/quagga/route_types.h +include/quagga/sigevent.h +include/quagga/smux.h +include/quagga/sockopt.h +include/quagga/sockunion.h +include/quagga/str.h +include/quagga/stream.h +include/quagga/table.h +include/quagga/thread.h +include/quagga/vector.h +include/quagga/version.h +include/quagga/vty.h +include/quagga/workqueue.h +include/quagga/zassert.h +include/quagga/zclient.h +include/quagga/zebra.h +%%EXAMPLESDIR%%/bgpd.conf.sample +%%EXAMPLESDIR%%/bgpd.conf.sample2 +%%ISISD%%%%EXAMPLESDIR%%/isisd.conf.sample +%%EXAMPLESDIR%%/ospf6d.conf.sample +%%EXAMPLESDIR%%/ospfd.conf.sample +%%EXAMPLESDIR%%/ripd.conf.sample +%%EXAMPLESDIR%%/ripngd.conf.sample +%%EXAMPLESDIR%%/vtysh.conf.sample +%%EXAMPLESDIR%%/zebra.conf.sample +@dirrm include/quagga/ospfd +%%OSPFAPI%%@dirrm include/quagga/ospfapi +@dirrm include/quagga +@dirrm share/examples/quagga +@dirrm etc/quagga +@dirrmtry %%LOCALSTATE_DIR%% |