diff --git a/net/quagga/Makefile b/net/quagga/Makefile new file mode 100644 index 00000000000..433c1f2a4d8 --- /dev/null +++ b/net/quagga/Makefile @@ -0,0 +1,61 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ + +COMMENT= "multi-threaded routing daemon" + +DISTNAME= quagga-0.96.4 +CATEGORIES= net +MASTER_SITES= http://www.quagga.net/download/ + +HOMEPAGE= http://www.quagga.net/ + +MAINTAINER= David Krause + +# GPL +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +STATEDIR?= /var/zebra +SUBST_VARS= CONFDIR STATEDIR + +# you might need debugging, it's a developer release ! +#CFLAGS+= -g + +USE_GMAKE= Yes +CONFDIR= ${SYSCONFDIR}/zebra +SEPARATE_BUILD= concurrent +CONFIGURE_STYLE=gnu old +CONFIGURE_ARGS+=--includedir=${PREFIX}/include/zebra +CONFIGURE_ARGS+=--sysconfdir=${CONFDIR} +CONFIGURE_ARGS+=--localstatedir=${STATEDIR} +CONFIGURE_ARGS+=--enable-user=_quagga +CONFIGURE_ARGS+=--enable-group=_quagga +CONFIGURE_ENV= LIBS=-lcurses + +FLAVORS= snmp +FLAVOR?= + +.if ${FLAVOR:L:Msnmp} +LIB_DEPENDS= snmp.42::net/ucd-snmp +CONFIGURE_ARGS+= --enable-snmp +.else +CONFIGURE_ARGS+= --disable-snmp +.endif + +post-extract: +.for f in vtysh.1 bgpd.8 ospf6d.8 ospfd.8 ripd.8 ripngd.8 zebra.8 quagga.info + @cd ${WRKSRC}/doc; sed \ + -e s#/usr/local/etc#@sysconfdir@#g \ + -e s#/usr/local/sbin#@prefix@/sbin#g \ + ${f} > ${f}.in && \ + rm -f ${f} +.endfor + +post-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/zebra + ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/zebra + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/zebra + ${INSTALL_DATA} ${WRKINST}${SYSCONFDIR}/zebra/* ${PREFIX}/share/examples/zebra + +.include diff --git a/net/quagga/distinfo b/net/quagga/distinfo new file mode 100644 index 00000000000..8a0ad2140d2 --- /dev/null +++ b/net/quagga/distinfo @@ -0,0 +1,3 @@ +MD5 (quagga-0.96.4.tar.gz) = 55f5a307c453f90d7dfcc13f0dabb83d +RMD160 (quagga-0.96.4.tar.gz) = 3cc329bb1d0c20d09397f8de7c2bb3b35feb887f +SHA1 (quagga-0.96.4.tar.gz) = eb1bd4d29638cc451a03d6caa8b69485e964510d diff --git a/net/quagga/patches/patch-configure b/net/quagga/patches/patch-configure new file mode 100644 index 00000000000..7d8d4bc7628 --- /dev/null +++ b/net/quagga/patches/patch-configure @@ -0,0 +1,12 @@ +$OpenBSD: patch-configure,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +--- configure.orig 2003-11-01 23:14:09.000000000 -0600 ++++ configure 2003-11-11 16:41:23.000000000 -0600 +@@ -9190,7 +9190,7 @@ fi + echo "$as_me:$LINENO: result: $ac_cv_htonl_works" >&5 + echo "${ECHO_T}$ac_cv_htonl_works" >&6 + +- ac_config_files="$ac_config_files Makefile lib/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile ospf6d/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile redhat/quagga.spec lib/version.h" ++ ac_config_files="$ac_config_files Makefile lib/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile ospf6d/Makefile vtysh/Makefile doc/Makefile doc/bgpd.8 doc/ospf6d.8 doc/ospfd.8 doc/ripd.8 doc/ripngd.8 doc/vtysh.1 doc/zebra.8 ospfclient/Makefile redhat/quagga.spec lib/version.h" + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure diff --git a/net/quagga/patches/patch-doc_Makefile_in b/net/quagga/patches/patch-doc_Makefile_in new file mode 100644 index 00000000000..a3a8d394f69 --- /dev/null +++ b/net/quagga/patches/patch-doc_Makefile_in @@ -0,0 +1,57 @@ +$OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +--- doc/Makefile.in.orig 2003-11-01 23:26:38.000000000 -0600 ++++ doc/Makefile.in 2003-11-17 19:40:12.000000000 -0600 +@@ -36,6 +36,7 @@ oldincludedir = /usr/include + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ ++builddir = @builddir@ + top_builddir = .. + + ACLOCAL = @ACLOCAL@ +@@ -84,6 +85,7 @@ LIBCAP = @LIBCAP@ + LIBPAM = @LIBPAM@ + LIB_IPV6 = @LIB_IPV6@ + LIB_REGEX = @LIB_REGEX@ ++MAKEINFOFLAGS = --no-split -I $(srcdir) + MULTIPATH_NUM = @MULTIPATH_NUM@ + OSPF6D = @OSPF6D@ + OSPFAPI = @OSPFAPI@ +@@ -141,21 +143,19 @@ quagga.info: quagga.texi $(quagga_TEXINF + quagga.dvi: quagga.texi $(quagga_TEXINFOS) + + .texi.info: +- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +- cd $(srcdir) \ +- && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ +- `echo $< | sed 's,.*/,,'` ++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] ++ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ ++ `echo $< | sed 's,.*/,,'` + + .texi.dvi: + TEXINPUTS="$(srcdir)$(PATH_SEPARATOR)$$TEXINPUTS" \ +- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ ++ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) ' \ + $(TEXI2DVI) $< + + .texi: +- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +- cd $(srcdir) \ +- && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ +- `echo $< | sed 's,.*/,,'` ++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] ++ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ ++ `echo $< | sed 's,.*/,,'` + + MAKEINFO = @MAKEINFO@ + TEXI2DVI = texi2dvi +@@ -382,7 +382,7 @@ install-info-am: $(INFO_DEPS) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ +- d=$(srcdir); \ ++ d=$(builddir); \ + for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \ + if test -f $$ifile; then \ + relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \ diff --git a/net/quagga/patches/patch-ospfd_ospf_packet_c b/net/quagga/patches/patch-ospfd_ospf_packet_c new file mode 100644 index 00000000000..452beb871a4 --- /dev/null +++ b/net/quagga/patches/patch-ospfd_ospf_packet_c @@ -0,0 +1,19 @@ +$OpenBSD: patch-ospfd_ospf_packet_c,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +--- ospfd/ospf_packet.c.orig 2003-09-24 08:28:30.000000000 -0500 ++++ ospfd/ospf_packet.c 2003-12-03 01:14:31.000000000 -0600 +@@ -1936,13 +1936,13 @@ ospf_recv_packet (int fd, struct interfa + return NULL; + } + +-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__NetBSD__) || defined(__FreeBSD__) || (defined(__OpenBSD__) && (OpenBSD < 200311)) + ip_len = iph.ip_len; + #else + ip_len = ntohs (iph.ip_len); + #endif + +-#if !defined(GNU_LINUX) ++#if !defined(GNU_LINUX) && (OpenBSD < 200311) + /* + * Kernel network code touches incoming IP header parameters, + * before protocol specific processing. diff --git a/net/quagga/pkg/DEINSTALL b/net/quagga/pkg/DEINSTALL new file mode 100644 index 00000000000..ab607e0ce73 --- /dev/null +++ b/net/quagga/pkg/DEINSTALL @@ -0,0 +1,35 @@ +#!/bin/sh +# $OpenBSD: DEINSTALL,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +# +# Quagga de-installation + +# exit on errors, use a sane path and prefix +# +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${CONFDIR} +STATE_DIR=${STATEDIR} +QUAGGAUSER=_quagga +QUAGGAGROUP=_quagga + +echo +echo "+---------------" +echo "| To completely deinstall the $1 package you need" +echo "| to perform these steps as root:" +echo "|" +echo "| userdel $QUAGGAUSER" +echo "| groupdel $QUAGGAGROUP" +if [ "$PKG_DELETE_EXTRA" != Yes -a -d $CONFIG_DIR ]; then + echo "| rm -rf $CONFIG_DIR" +fi +if [ "$PKG_DELETE_EXTRA" != Yes -a -d $STATE_DIR ]; then + echo "| rm -rf $STATE_DIR" +fi +echo "|" +echo "| Do not do this if you plan on re-installing $1" +echo "| at some future time." +echo "+---------------" +echo + +exit 0 diff --git a/net/quagga/pkg/DESCR b/net/quagga/pkg/DESCR new file mode 100644 index 00000000000..118d99da827 --- /dev/null +++ b/net/quagga/pkg/DESCR @@ -0,0 +1,6 @@ +Quagga is a routing software suite, providing implementations of OSPFv2, +OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for Unix platforms, particularly +FreeBSD and Linux and also NetBSD, to mention a few. Quagga is a fork of +GNU Zebra which was developed by Kunihiro Ishiguro. The Quagga tree aims +to build a more involved community around Quagga than the current +centralized model of GNU Zebra. diff --git a/net/quagga/pkg/INSTALL b/net/quagga/pkg/INSTALL new file mode 100644 index 00000000000..42796131d27 --- /dev/null +++ b/net/quagga/pkg/INSTALL @@ -0,0 +1,92 @@ +#!/bin/sh +# $OpenBSD: INSTALL,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +# +# Pre/post-installation setup of Quagga + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_DIR=${CONFDIR} +STATE_DIR=${STATEDIR} +SAMPLE_CONFIG_DIR=$PREFIX/share/examples/zebra +QUAGGAUSER=_quagga +QUAGGAGROUP=_quagga +ID=525 + +do_usergroup_install() +{ + # Create Quagga user and group + groupinfo -e $QUAGGAGROUP + if [ $? -eq 0 ]; then + echo "===> Using $QUAGGAGROUP group for Quagga" + else + echo "===> Creating $QUAGGAGROUP group for Quagga" + groupadd -g $ID $QUAGGAGROUP + fi + userinfo -e $QUAGGAUSER + if [ $? -eq 0 ]; then + echo "===> Using $QUAGGAUSER user for Quagga" + else + echo "===> Creating $QUAGGAUSER user for Quagga" + useradd -g $QUAGGAGROUP -d /nonexistent -L daemon -c 'Quagga Account' -s /sbin/nologin -u $ID $QUAGGAUSER + fi +} + +do_statedir_install() +{ + install -d -o $QUAGGAUSER -g $QUAGGAGROUP -m 755 $STATE_DIR +} + +do_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration files in $CONFIG_DIR," + echo "| have NOT been changed. You may want to compare them to the" + echo "| current sample files in $SAMPLE_CONFIG_DIR," + echo "| and update your configuration as needed." + echo "+---------------" + echo +} + +do_notice_conf() +{ + install -d -o $QUAGGAUSER -g $QUAGGAGROUP -m 755 $CONFIG_DIR + echo + echo "+---------------" + echo "| Sample $1 configuration files have been installed in" + echo "| $SAMPLE_CONFIG_DIR. Please rename and install these files" + echo "| into $CONFIG_DIR. Change the configuration to meet your needs." + echo "+---------------" + echo +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + do_usergroup_install + ;; + POST-INSTALL) + if [ ! -d $STATE_DIR ]; then + do_statedir_install + fi + if [ ! -d $CONFIG_DIR ]; then + do_notice_conf $1 + else + do_notice $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/net/quagga/pkg/PLIST b/net/quagga/pkg/PLIST new file mode 100644 index 00000000000..2dd02b068f1 --- /dev/null +++ b/net/quagga/pkg/PLIST @@ -0,0 +1,74 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2003/12/11 19:00:59 david Exp $ +@pkgcfl zebra-* +@unexec install-info --delete --info-dir=%D/info %D/info/quagga.info +include/zebra/buffer.h +include/zebra/command.h +include/zebra/debug.h +include/zebra/distribute.h +include/zebra/filter.h +include/zebra/getopt.h +include/zebra/hash.h +include/zebra/if.h +include/zebra/if_rmap.h +include/zebra/keychain.h +include/zebra/linklist.h +include/zebra/log.h +include/zebra/md5-gnu.h +include/zebra/memory.h +include/zebra/network.h +include/zebra/ospfd/ospf_api.h +include/zebra/ospfd/ospf_asbr.h +include/zebra/ospfd/ospf_dump.h +include/zebra/ospfd/ospf_ism.h +include/zebra/ospfd/ospf_lsa.h +include/zebra/ospfd/ospf_lsdb.h +include/zebra/ospfd/ospf_nsm.h +include/zebra/ospfd/ospf_opaque.h +include/zebra/ospfd/ospfd.h +include/zebra/plist.h +include/zebra/prefix.h +include/zebra/privs.h +include/zebra/routemap.h +include/zebra/smux.h +include/zebra/sockopt.h +include/zebra/sockunion.h +include/zebra/str.h +include/zebra/stream.h +include/zebra/table.h +include/zebra/thread.h +include/zebra/vector.h +include/zebra/version.h +include/zebra/vty.h +include/zebra/zclient.h +include/zebra/zebra.h +info/quagga.info +lib/libospf.a +lib/libzebra.a +man/man1/vtysh.1 +man/man8/bgpd.8 +man/man8/ospf6d.8 +man/man8/ospfd.8 +man/man8/ripd.8 +man/man8/ripngd.8 +man/man8/zebra.8 +sbin/bgpd +sbin/ospf6d +sbin/ospfd +sbin/ripd +sbin/ripngd +sbin/zebra +share/doc/zebra/README +share/examples/zebra/bgpd.conf.sample +share/examples/zebra/bgpd.conf.sample2 +share/examples/zebra/ospf6d.conf.sample +share/examples/zebra/ospfd.conf.sample +share/examples/zebra/ripd.conf.sample +share/examples/zebra/ripngd.conf.sample +share/examples/zebra/zebra.conf.sample +@dirrm share/examples/zebra +@dirrm share/doc/zebra +@dirrm include/zebra/ospfd +@dirrm include/zebra +@exec install-info --info-dir=%D/info %D/info/quagga.info +@extraunexec rm -rf ${CONFDIR} +@extraunexec rm -rf ${STATEDIR}