From c3512526f8c10ddce664c244fe084310c9c34ff1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 28 Mar 2005 11:05:38 +0000 Subject: [PATCH] add experimental quagga package SVN-Revision: 470 --- openwrt/package/Config.in | 1 + openwrt/package/Makefile | 1 + openwrt/package/quagga/Config.in | 37 ++++ openwrt/package/quagga/Makefile | 170 ++++++++++++++++++ .../quagga/control/quagga-bgpd.control | 8 + .../quagga/control/quagga-ospfd.control | 8 + .../quagga/control/quagga-ripd.control | 8 + .../quagga/control/quagga-zebra.control | 8 + openwrt/package/quagga/control/quagga.control | 8 + openwrt/package/quagga/ipkg/CONTROL/postinst | 45 +++++ .../package/quagga/patches/quagga-cross.patch | 87 +++++++++ 11 files changed, 381 insertions(+) create mode 100644 openwrt/package/quagga/Config.in create mode 100644 openwrt/package/quagga/Makefile create mode 100644 openwrt/package/quagga/control/quagga-bgpd.control create mode 100644 openwrt/package/quagga/control/quagga-ospfd.control create mode 100644 openwrt/package/quagga/control/quagga-ripd.control create mode 100644 openwrt/package/quagga/control/quagga-zebra.control create mode 100644 openwrt/package/quagga/control/quagga.control create mode 100755 openwrt/package/quagga/ipkg/CONTROL/postinst create mode 100644 openwrt/package/quagga/patches/quagga-cross.patch diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index 0c8a035107..080c2c4630 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -25,6 +25,7 @@ source "package/openvpn/Config.in" source "package/openntpd/Config.in" source "package/pptp/Config.in" source "package/pptpd/Config.in" +source "package/quagga/Config.in" source "package/cups/Config.in" source "package/cifsmount/Config.in" source "package/ez-ipupdate/Config.in" diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index 95e7d70676..d010cb2fb6 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -31,6 +31,7 @@ package-$(BR2_PACKAGE_PORTMAP) += portmap package-$(BR2_PACKAGE_PPP) += ppp package-$(BR2_PACKAGE_PPTP) += pptp package-$(BR2_PACKAGE_PPTPD) += pptpd +package-$(BR2_PACKAGE_QUAGGA) += quagga package-$(BR2_PACKAGE_SER) += ser package-$(BR2_PACKAGE_STRACE) += strace package-$(BR2_PACKAGE_TCPDUMP) += tcpdump diff --git a/openwrt/package/quagga/Config.in b/openwrt/package/quagga/Config.in new file mode 100644 index 0000000000..073d916120 --- /dev/null +++ b/openwrt/package/quagga/Config.in @@ -0,0 +1,37 @@ +config BR2_PACKAGE_QUAGGA + tristate "Quagga" + default m + help + routing software package that provides TCP/IP based routing services + with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, + OSPFv3, BGP-4, and BGP-4+ + + http://www.quagga.net/ + +config BR2_PACKAGE_QUAGGA_ZEBRA + tristate "zebra daemon" + default m + depends BR2_PACKAGE_QUAGGA + help + zebra daemon + +config BR2_PACKAGE_QUAGGA_RIPD + tristate "ripd daemon" + default m + depends BR2_PACKAGE_QUAGGA + help + ripd daemon + +config BR2_PACKAGE_QUAGGA_BGPD + tristate "bgpd daemon" + default m + depends BR2_PACKAGE_QUAGGA + help + bgpd daemon + +config BR2_PACKAGE_QUAGGA_OSPFD + tristate "ospfd daemon" + default m + depends BR2_PACKAGE_QUAGGA + help + ospfd daemon diff --git a/openwrt/package/quagga/Makefile b/openwrt/package/quagga/Makefile new file mode 100644 index 0000000000..e78f6f5b69 --- /dev/null +++ b/openwrt/package/quagga/Makefile @@ -0,0 +1,170 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=quagga +PKG_VERSION:=0.98.2 +PKG_RELEASE:=1 +PKG_MD5SUM:=8757b155aa2458f6158ccd330d0e1b39 + +PKG_SOURCE_URL:=http://www.quagga.net/download/ \ + http://www.de.quagga.net/download/ \ + http://www.uk.quagga.net/download/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_CAT:=zcat +PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)-all_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg/quagga + +PKG_ZEBRA_DIR:=$(PKG_BUILD_DIR)/ipkg/zebra +PKG_BGPD_DIR:=$(PKG_BUILD_DIR)/ipkg/bgpd +PKG_OSPFD_DIR:=$(PKG_BUILD_DIR)/ipkg/ospfd +PKG_RIPD_DIR:=$(PKG_BUILD_DIR)/ipkg/ripd + +# separate ipkg for zebra,bgpd,ospf and ripd +PKG_ZEBRA:=$(PACKAGE_DIR)/$(PKG_NAME)-zebra_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +PKG_BGPD:=$(PACKAGE_DIR)/$(PKG_NAME)-bgpd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +PKG_RIPD:=$(PACKAGE_DIR)/$(PKG_NAME)-ripd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +PKG_OSPFD:=$(PACKAGE_DIR)/$(PKG_NAME)-ospfd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk + +TARGETS:=$(PKG_IPK) +ifneq ($(BR2_PACKAGE_QUAGGA_ZEBRA),) +TARGETS += $(PKG_ZEBRA) +endif +ifneq ($(BR2_PACKAGE_QUAGGA_BGPD),) +TARGETS += $(PKG_BGPD) +endif +ifneq ($(BR2_PACKAGE_QUAGGA_RIPD),) +TARGETS += $(PKG_RIPD) +endif +ifneq ($(BR2_PACKAGE_QUAGGA_OSPFD),) +TARGETS += $(PKG_OSPFD) +endif + +INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga.list +ifeq ($(BR2_PACKAGE_QUAGGA_ZEBRA),y) +INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-zebra.list +endif +ifeq ($(BR2_PACKAGE_QUAGGA_BGPD),y) +INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-bgpd.list +endif +ifeq ($(BR2_PACKAGE_QUAGGA_RIPD),y) +INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ripd.list +endif +ifeq ($(BR2_PACKAGE_QUAGGA_OSPFD),y) +INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ospfd.list +endif + +$(DL_DIR)/$(PKG_SOURCE): + $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL) + +$(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE) + $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + $(PATCH) $(PKG_BUILD_DIR) ./patches + touch $(PKG_BUILD_DIR)/.unpacked + +$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked + (cd $(PKG_BUILD_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --disable-static \ + --disable-ipv6 \ + --disable-vtysh \ + --enable-user=quagga \ + --enable-group=quagga \ + --sysconfdir=/etc/quagga \ + --disable-exampledir \ + ); + touch $(PKG_BUILD_DIR)/.configured + +$(PKG_IPK_DIR)/zebra: $(PKG_BUILD_DIR)/.configured + $(MAKE) -C $(PKG_BUILD_DIR) + $(MAKE) DESTDIR=$(PKG_IPK_DIR) -C $(PKG_BUILD_DIR) install + +$(PKG_IPK): $(PKG_IPK_DIR)/zebra + cp -a ./ipkg/* $(PKG_IPK_DIR)/ + $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) control/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + mkdir -p $(PKG_IPK_DIR)/usr/sbin + mkdir -p $(PKG_IPK_DIR)/usr/lib + mkdir -p $(PKG_IPK_DIR)/etc/quagga + rm $(PKG_IPK_DIR)/usr/lib/*.la + rm -rf $(PKG_IPK_DIR)/usr/include + rm -rf $(PKG_IPK_DIR)/usr/info + rm -rf $(PKG_IPK_DIR)/usr/man + $(STRIP) $(PKG_IPK_DIR)/usr/lib/* + $(STRIP) $(PKG_IPK_DIR)/usr/sbin/* + mkdir -p $(PACKAGE_DIR) + $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR) + +$(IPKG_STATE_DIR)/info/quagga.list: $(PKG_IPK) + $(IPKG) install $(PKG_IPK) + +$(PKG_ZEBRA): $(PKG_IPK_DIR)/zebra + mkdir -p $(PKG_ZEBRA_DIR)/etc/quagga + mkdir -p $(PKG_ZEBRA_DIR)/usr/sbin + mkdir -p $(PKG_ZEBRA_DIR)/usr/lib + cp -a ./ipkg/* $(PKG_ZEBRA_DIR)/ + $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_ZEBRA_DIR) control/$(PKG_NAME)-zebra.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + cp $(PKG_IPK_DIR)/usr/sbin/zebra $(PKG_ZEBRA_DIR)/usr/sbin + cp $(PKG_IPK_DIR)/usr/lib/libzebra* $(PKG_ZEBRA_DIR)/usr/lib + $(IPKG_BUILD) $(PKG_ZEBRA_DIR) $(PACKAGE_DIR) + +$(IPKG_STATE_DIR)/info/quagga-zebra.list: $(PKG_ZEBRA) + $(IPKG) install $(PKG_ZEBRA) + +$(PKG_BGPD): $(PKG_IPK_DIR)/zebra + mkdir -p $(PKG_BGPD_DIR)/etc/quagga + mkdir -p $(PKG_BGPD_DIR)/usr/sbin + cp -a ./ipkg/* $(PKG_BGPD_DIR)/ + $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_BGPD_DIR) control/$(PKG_NAME)-bgpd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + cp $(PKG_IPK_DIR)/usr/sbin/bgpd $(PKG_BGPD_DIR)/usr/sbin + $(IPKG_BUILD) $(PKG_BGPD_DIR) $(PACKAGE_DIR) + +$(IPKG_STATE_DIR)/info/quagga-bgpd.list: $(PKG_BGPD) + $(IPKG) install $(PKG_BGPD) + +$(PKG_RIPD): $(PKG_IPK_DIR)/zebra + mkdir -p $(PKG_RIPD_DIR)/etc/quagga + mkdir -p $(PKG_RIPD_DIR)/usr/sbin + cp -a ./ipkg/* $(PKG_RIPD_DIR)/ + $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_RIPD_DIR) control/$(PKG_NAME)-ripd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + cp $(PKG_IPK_DIR)/usr/sbin/ripd $(PKG_RIPD_DIR)/usr/sbin + $(IPKG_BUILD) $(PKG_RIPD_DIR) $(PACKAGE_DIR) + +$(IPKG_STATE_DIR)/info/quagga-ripd.list: $(PKG_RIPD) + $(IPKG) install $(PKG_RIPD) + +$(PKG_OSPFD): $(PKG_IPK_DIR)/zebra + mkdir -p $(PKG_OSPFD_DIR)/etc/quagga + mkdir -p $(PKG_OSPFD_DIR)/usr/sbin + mkdir -p $(PKG_OSPFD_DIR)/usr/lib + cp -a ./ipkg/* $(PKG_OSPFD_DIR)/ + $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_OSPFD_DIR) control/$(PKG_NAME)-ospfd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + cp $(PKG_IPK_DIR)/usr/sbin/ospfd $(PKG_OSPFD_DIR)/usr/sbin + cp $(PKG_IPK_DIR)/usr/lib/libospf* $(PKG_OSPFD_DIR)/usr/lib + $(IPKG_BUILD) $(PKG_OSPFD_DIR) $(PACKAGE_DIR) + +$(IPKG_STATE_DIR)/info/quagga-ospfd.list: $(PKG_OSPFD) + $(IPKG) install $(PKG_OSPFD) + +source: $(DL_DIR)/$(PKG_SOURCE) +prepare: $(PKG_BUILD_DIR)/.unpacked +compile: $(TARGETS) +install: $(INSTALL_TARGETS) + +clean: + rm -rf $(PKG_BUILD_DIR) + rm -f $(PKG_IPK) $(PKG_ZEBRA) $(PKG_OSPFD) $(PKG_RIPD) $(PKG_BGPD) diff --git a/openwrt/package/quagga/control/quagga-bgpd.control b/openwrt/package/quagga/control/quagga-bgpd.control new file mode 100644 index 0000000000..1c1a146058 --- /dev/null +++ b/openwrt/package/quagga/control/quagga-bgpd.control @@ -0,0 +1,8 @@ +Package: quagga-bgpd +Priority: optional +Section: net +Version: 0.98.2 +Architecture: mipsel +Maintainer: Johannes 5 Joemann +Source: buildroot internal +Description: bgpd daemon diff --git a/openwrt/package/quagga/control/quagga-ospfd.control b/openwrt/package/quagga/control/quagga-ospfd.control new file mode 100644 index 0000000000..5166b89685 --- /dev/null +++ b/openwrt/package/quagga/control/quagga-ospfd.control @@ -0,0 +1,8 @@ +Package: quagga-ospfd +Priority: optional +Section: net +Version: 0.98.2 +Architecture: mipsel +Maintainer: Johannes 5 Joemann +Source: buildroot internal +Description: ospf daemon diff --git a/openwrt/package/quagga/control/quagga-ripd.control b/openwrt/package/quagga/control/quagga-ripd.control new file mode 100644 index 0000000000..6df6aee8a5 --- /dev/null +++ b/openwrt/package/quagga/control/quagga-ripd.control @@ -0,0 +1,8 @@ +Package: quagga-ripd +Priority: optional +Section: net +Version: 0.98.2 +Architecture: mipsel +Maintainer: Johannes 5 Joemann +Source: buildroot internal +Description: rip daemon diff --git a/openwrt/package/quagga/control/quagga-zebra.control b/openwrt/package/quagga/control/quagga-zebra.control new file mode 100644 index 0000000000..f2b81df7ae --- /dev/null +++ b/openwrt/package/quagga/control/quagga-zebra.control @@ -0,0 +1,8 @@ +Package: quagga-zebra +Priority: optional +Section: net +Version: 0.98.2 +Architecture: mipsel +Maintainer: Johannes 5 Joemann +Source: buildroot internal +Description: zebra daemon diff --git a/openwrt/package/quagga/control/quagga.control b/openwrt/package/quagga/control/quagga.control new file mode 100644 index 0000000000..f8b4dbb02a --- /dev/null +++ b/openwrt/package/quagga/control/quagga.control @@ -0,0 +1,8 @@ +Package: quagga-all +Priority: optional +Section: net +Version: 0.98.2 +Architecture: mipsel +Maintainer: Johannes 5 Joemann +Source: buildroot internal +Description: routing software package that provides TCP/IP based routing services with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, BGP-4, and BGP-4+ diff --git a/openwrt/package/quagga/ipkg/CONTROL/postinst b/openwrt/package/quagga/ipkg/CONTROL/postinst new file mode 100755 index 0000000000..0bb4bdda6d --- /dev/null +++ b/openwrt/package/quagga/ipkg/CONTROL/postinst @@ -0,0 +1,45 @@ +#!/bin/sh + +name=quagga +id=51 + +# do not change below +# check if we are on real system +if [ -z "${IPKG_INSTROOT}" ]; then + # create copies of passwd and group, if we use squashfs + rootfs=`mount |awk '/root/ { print $5 }'` + if [ "$rootfs" = "squashfs" ]; then + if [ -h /etc/group ]; then + rm /etc/group + cp /rom/etc/group /etc/group + fi + if [ -h /etc/passwd ]; then + rm /etc/passwd + cp /rom/etc/passwd /etc/passwd + fi + fi +fi + +echo "" +if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then + echo "adding group $name to /etc/group" + echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group +fi + +if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then + echo "adding user $name to /etc/passwd" + echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd +fi + +grep -q '^zebra[[:space:]]*2601/tcp' ${IPKG_INSTROOT}/etc/services 2>/dev/null +if [ $? -ne 0 ]; then +echo "zebrasrv 2600/tcp" >>${IPKG_INSTROOT}/etc/services +echo "zebra 2601/tcp" >>${IPKG_INSTROOT}/etc/services +echo "ripd 2602/tcp" >>${IPKG_INSTROOT}/etc/services +echo "ripngd 2603/tcp" >>${IPKG_INSTROOT}/etc/services +echo "ospfd 2604/tcp" >>${IPKG_INSTROOT}/etc/services +echo "bgpd 2605/tcp" >>${IPKG_INSTROOT}/etc/services +echo "ospf6d 2606/tcp" >>${IPKG_INSTROOT}/etc/services +echo "ospfapi 2607/tcp" >>${IPKG_INSTROOT}/etc/services +echo "isisd 2608/tcp" >>${IPKG_INSTROOT}/etc/services +fi diff --git a/openwrt/package/quagga/patches/quagga-cross.patch b/openwrt/package/quagga/patches/quagga-cross.patch new file mode 100644 index 0000000000..69b83283bf --- /dev/null +++ b/openwrt/package/quagga/patches/quagga-cross.patch @@ -0,0 +1,87 @@ +--- quagga-0.98.2/configure.orig Thu Feb 3 17:39:29 2005 ++++ quagga-0.98.2/configure Sat Feb 12 06:47:14 2005 +@@ -12491,72 +12491,6 @@ + + + +-echo "$as_me:$LINENO: checking for broken CMSG_FIRSTHDR" >&5 +-echo $ECHO_N "checking for broken CMSG_FIRSTHDR... $ECHO_C" >&6 +-if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#ifdef SUNOS_5 +-#define _XPG4_2 +-#define __EXTENSIONS__ +-#endif +-#include +-#include +-#include +- +-main() +-{ +- struct msghdr msg; +- char buf[4]; +- +- msg.msg_control = buf; +- msg.msg_controllen = 0; +- +- if (CMSG_FIRSTHDR(&msg) != NULL) +- exit(0); +- exit (1); +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- echo "$as_me:$LINENO: result: yes - using workaround" >&5 +-echo "${ECHO_T}yes - using workaround" >&6 +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_BROKEN_CMSG_FIRSTHDR +-_ACEOF +- +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- + echo "$as_me:$LINENO: checking route read method check" >&5 + echo $ECHO_N "checking route read method check... $ECHO_C" >&6 + if test "${zebra_rtread+set}" = set; then +@@ -12654,10 +12588,7 @@ + if test "${zebra_ipforward_path+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; +-do +- test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break +-done ++ zebra_ipforward_path="/proc/net/snmp" + case $zebra_ipforward_path in + "/proc/net/snmp") IPFORWARD=ipforward_proc.o + zebra_ipforward_path="proc";; -- 2.30.2