diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-11-27 11:25:48 +0000 |
|---|---|---|
| committer | Joe MacDonald <joe.macdonald@windriver.com> | 2012-11-27 14:43:58 -0500 |
| commit | e762ce3fc044cc64f473c95e096245e439eb3234 (patch) | |
| tree | f8bee569ae46897e40627896679ca708e0cafca3 /meta-networking/recipes-protocols/quagga | |
| parent | 4a851a8f25bb9d8d4f7eb40e4bd0e70f74e3ce12 (diff) | |
| download | meta-openembedded-e762ce3fc044cc64f473c95e096245e439eb3234.tar.gz | |
quagga: add from OE-Classic, update and tidy-up
* Update to 0.99.21
* Fix SRC_URI to point to a working download location
* Make LICENSE more accurate
* Add LIC_FILES_CHKSUM
* Add old gentoo patch to fix libcap linking errors
* Put binaries in sbindir
* Use useradd.bbclass to create user/groups
* Handle hardcoded paths in initscript
* Add LSB headers to initscript (borrowed from debian)
* Tidy up packaging and directory references
* Add SUMMARY
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-networking/recipes-protocols/quagga')
9 files changed, 531 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch new file mode 100644 index 0000000000..50f0ad502f --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | At first this worked, then I tried a clean build in a directory that | ||
| 2 | contained lib in it (oe/build/titan-glibc) and vtysh no longer | ||
| 3 | worked. It's test for the lib directory was excepting anything | ||
| 4 | containing lib. | ||
| 5 | |||
| 6 | With this patch you still cannot have lib in the path anywhere, but | ||
| 7 | at least things containing lib will now work. | ||
| 8 | |||
| 9 | --- quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:04 1.1 | ||
| 10 | +++ quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:16 | ||
| 11 | @@ -89,7 +89,7 @@ | ||
| 12 | $cmd =~ s/\s+$//g; | ||
| 13 | |||
| 14 | # $protocol is VTYSH_PROTO format for redirection of user input | ||
| 15 | - if ($file =~ /lib/) { | ||
| 16 | + if ($file =~ /\/lib\//) { | ||
| 17 | if ($file =~ /keychain.c/) { | ||
| 18 | $protocol = "VTYSH_RIPD"; | ||
| 19 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch new file mode 100644 index 0000000000..9563ea2f36 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From 63e97633d01908da6d3776ac61e4033e6fa91e5c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com> | ||
| 3 | Date: Sun, 5 Sep 2010 18:19:09 +0200 | ||
| 4 | Subject: [PATCH] build: fix linking position for libcap | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | * lib/Makefile.am: link libzebra to libcap, since it uses symbols | ||
| 10 | from there. | ||
| 11 | * zebra/Makefile.am: no need to link libcap here now, since it's not | ||
| 12 | used directly (libtool with apply transitive dependencies for | ||
| 13 | static linking). | ||
| 14 | |||
| 15 | Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com> | ||
| 16 | |||
| 17 | Imported from Gentoo by Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 18 | Upstream-Status: Pending | ||
| 19 | |||
| 20 | --- | ||
| 21 | lib/Makefile.am | 2 +- | ||
| 22 | zebra/Makefile.am | 5 ++--- | ||
| 23 | 2 files changed, 3 insertions(+), 4 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/lib/Makefile.am b/lib/Makefile.am | ||
| 26 | index 315e919..6e69993 100644 | ||
| 27 | --- a/lib/Makefile.am | ||
| 28 | +++ b/lib/Makefile.am | ||
| 29 | @@ -18,7 +18,7 @@ BUILT_SOURCES = memtypes.h route_types.h | ||
| 30 | |||
| 31 | libzebra_la_DEPENDENCIES = @LIB_REGEX@ | ||
| 32 | |||
| 33 | -libzebra_la_LIBADD = @LIB_REGEX@ | ||
| 34 | +libzebra_la_LIBADD = @LIB_REGEX@ $(LIBCAP) | ||
| 35 | |||
| 36 | pkginclude_HEADERS = \ | ||
| 37 | buffer.h checksum.h command.h filter.h getopt.h hash.h \ | ||
| 38 | diff --git a/zebra/Makefile.am b/zebra/Makefile.am | ||
| 39 | index 542f36f..d09a209 100644 | ||
| 40 | --- a/zebra/Makefile.am | ||
| 41 | +++ b/zebra/Makefile.am | ||
| 42 | @@ -5,7 +5,6 @@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@ | ||
| 43 | INSTALL_SDATA=@INSTALL@ -m 600 | ||
| 44 | |||
| 45 | LIB_IPV6 = @LIB_IPV6@ | ||
| 46 | -LIBCAP = @LIBCAP@ | ||
| 47 | |||
| 48 | ipforward = @IPFORWARD@ | ||
| 49 | if_method = @IF_METHOD@ | ||
| 50 | @@ -39,9 +38,9 @@ noinst_HEADERS = \ | ||
| 51 | connected.h ioctl.h rib.h rt.h zserv.h redistribute.h debug.h rtadv.h \ | ||
| 52 | interface.h ipforward.h irdp.h router-id.h kernel_socket.h | ||
| 53 | |||
| 54 | -zebra_LDADD = $(otherobj) $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
| 55 | +zebra_LDADD = $(otherobj) ../lib/libzebra.la $(LIB_IPV6) | ||
| 56 | |||
| 57 | -testzebra_LDADD = $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
| 58 | +testzebra_LDADD = ../lib/libzebra.la $(LIB_IPV6) | ||
| 59 | |||
| 60 | zebra_DEPENDENCIES = $(otherobj) | ||
| 61 | |||
| 62 | -- | ||
| 63 | 1.7.2.2 | ||
| 64 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-networking/recipes-protocols/quagga/files/quagga.default new file mode 100644 index 0000000000..438c3b6035 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.default | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # If this option is set the /etc/init.d/quagga script automatically loads | ||
| 2 | # the config via "vtysh -b" when the servers are started. | ||
| 3 | vtysh_enable=yes | ||
| 4 | |||
| 5 | # Bind all daemons to loopback only by default | ||
| 6 | zebra_options=" --daemon -A 127.0.0.1" | ||
| 7 | babeld_options="-D 127.0.0.1" | ||
| 8 | bgpd_options=" --daemon -A 127.0.0.1" | ||
| 9 | ospfd_options=" --daemon -A 127.0.0.1" | ||
| 10 | ospf6d_options="--daemon -A ::1" | ||
| 11 | ripd_options=" --daemon -A 127.0.0.1" | ||
| 12 | ripngd_options="--daemon -A ::1" | ||
| 13 | isisd_options=" --daemon -A 127.0.0.1" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-networking/recipes-protocols/quagga/files/quagga.init new file mode 100644 index 0000000000..60b5ab01a1 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.init | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # /etc/init.d/quagga -- start/stop the Quagga routing daemons | ||
| 4 | # | ||
| 5 | # Based on debian version by Endre Hirling <endre@mail.elte.hu> and | ||
| 6 | # Christian Hammers <ch@debian.org>. | ||
| 7 | # | ||
| 8 | |||
| 9 | ### BEGIN INIT INFO | ||
| 10 | # Provides: quagga | ||
| 11 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
| 12 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
| 13 | # Default-Start: 2 3 4 5 | ||
| 14 | # Default-Stop: 0 1 6 | ||
| 15 | # Short-Description: start and stop the Quagga routing suite | ||
| 16 | # Description: Quagga is a routing suite for IP routing protocols like | ||
| 17 | # BGP, OSPF, RIP and others. This script contols the main | ||
| 18 | # daemon "quagga" as well as the individual protocol daemons. | ||
| 19 | ### END INIT INFO | ||
| 20 | |||
| 21 | # NOTE: sbin must be before bin so we get the iproute2 ip and not the | ||
| 22 | # busybox ip command. The busybox one flushes all routes instead of just | ||
| 23 | # the dynamic routes | ||
| 24 | PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin | ||
| 25 | D_PATH=/usr/sbin | ||
| 26 | C_PATH=/etc/quagga | ||
| 27 | |||
| 28 | # Keep zebra first and do not list watchquagga! | ||
| 29 | DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld" | ||
| 30 | |||
| 31 | # Print the name of the pidfile. | ||
| 32 | pidfile() | ||
| 33 | { | ||
| 34 | echo "/var/run/quagga/$1.pid" | ||
| 35 | } | ||
| 36 | |||
| 37 | # Check if daemon is started by using the pidfile. | ||
| 38 | started() | ||
| 39 | { | ||
| 40 | [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 | ||
| 41 | return 1 | ||
| 42 | } | ||
| 43 | |||
| 44 | # Loads the config via vtysh -b if configured to do so. | ||
| 45 | vtysh_b () | ||
| 46 | { | ||
| 47 | # Rember, that all variables have been incremented by 1 in convert_daemon_prios() | ||
| 48 | if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then | ||
| 49 | /usr/bin/vtysh -b | ||
| 50 | fi | ||
| 51 | } | ||
| 52 | |||
| 53 | # Check if the daemon is activated and if its executable and config files | ||
| 54 | # are in place. | ||
| 55 | # params: daemon name | ||
| 56 | # returns: 0=ok, 1=error | ||
| 57 | check_daemon() | ||
| 58 | { | ||
| 59 | # If the integrated config file is used the others are not checked. | ||
| 60 | if [ -r "$C_PATH/Quagga.conf" ]; then | ||
| 61 | return 0 | ||
| 62 | fi | ||
| 63 | |||
| 64 | # check for config file | ||
| 65 | if [ ! -r "$C_PATH/$1.conf" ]; then | ||
| 66 | return 1 | ||
| 67 | fi | ||
| 68 | return 0 | ||
| 69 | } | ||
| 70 | |||
| 71 | # Starts the server if it's not alrady running according to the pid file. | ||
| 72 | # The Quagga daemons creates the pidfile when starting. | ||
| 73 | start() | ||
| 74 | { | ||
| 75 | if ! check_daemon $1; then echo -n " (!$1)"; return; fi | ||
| 76 | echo -n " $1" | ||
| 77 | start-stop-daemon \ | ||
| 78 | --start \ | ||
| 79 | --pidfile=`pidfile $1` \ | ||
| 80 | --exec "$D_PATH/$1" \ | ||
| 81 | -- \ | ||
| 82 | `eval echo "$""$1""_options"` | ||
| 83 | |||
| 84 | } | ||
| 85 | |||
| 86 | # Stop the daemon given in the parameter, printing its name to the terminal. | ||
| 87 | stop() | ||
| 88 | { | ||
| 89 | if ! started "$1" ; then | ||
| 90 | echo -n " (!$1)" | ||
| 91 | return 0 | ||
| 92 | else | ||
| 93 | PIDFILE=`pidfile $1` | ||
| 94 | PID=`cat $PIDFILE 2>/dev/null` | ||
| 95 | start-stop-daemon --stop --quiet --exec "$D_PATH/$1" | ||
| 96 | # | ||
| 97 | # Now we have to wait until $DAEMON has _really_ stopped. | ||
| 98 | # | ||
| 99 | if test -n "$PID" && kill -0 $PID 2>/dev/null; then | ||
| 100 | echo -n " (waiting) ." | ||
| 101 | cnt=0 | ||
| 102 | while kill -0 $PID 2>/dev/null; do | ||
| 103 | cnt=`expr $cnt + 1` | ||
| 104 | if [ $cnt -gt 60 ]; then | ||
| 105 | # Waited 120 secs now, fail. | ||
| 106 | echo -n "Failed.. " | ||
| 107 | break | ||
| 108 | fi | ||
| 109 | sleep 2 | ||
| 110 | echo -n "." | ||
| 111 | done | ||
| 112 | fi | ||
| 113 | echo -n " $1" | ||
| 114 | rm -f `pidfile $1` | ||
| 115 | fi | ||
| 116 | } | ||
| 117 | |||
| 118 | stop_all() | ||
| 119 | { | ||
| 120 | local daemon_list | ||
| 121 | daemon_list=${1:-$DAEMONS} | ||
| 122 | |||
| 123 | echo -n "Stopping Quagga daemons:" | ||
| 124 | for daemon_name in $daemon_list; do | ||
| 125 | stop "$daemon_name" | ||
| 126 | done | ||
| 127 | echo "." | ||
| 128 | } | ||
| 129 | |||
| 130 | start_all() | ||
| 131 | { | ||
| 132 | local daemon_list | ||
| 133 | daemon_list=${1:-$DAEMONS} | ||
| 134 | |||
| 135 | echo -n "Starting Quagga daemons:" | ||
| 136 | for daemon_name in $daemon_list; do | ||
| 137 | start "$daemon_name" | ||
| 138 | done | ||
| 139 | echo "." | ||
| 140 | } | ||
| 141 | |||
| 142 | status_all() | ||
| 143 | { | ||
| 144 | local daemon_list | ||
| 145 | daemon_list=${1:-$DAEMONS} | ||
| 146 | res=1 | ||
| 147 | |||
| 148 | echo -n "quagga: " | ||
| 149 | for daemon_name in $daemon_list; do | ||
| 150 | if started "$daemon_name" ; then | ||
| 151 | id=`cat \`pidfile $daemon_name\`` | ||
| 152 | echo -n "$daemon_name (pid $id) " | ||
| 153 | res=0 | ||
| 154 | fi | ||
| 155 | done | ||
| 156 | if [ $res -eq 0 ]; then | ||
| 157 | echo "is running..." | ||
| 158 | else | ||
| 159 | echo "is stopped..." | ||
| 160 | fi | ||
| 161 | exit $res | ||
| 162 | } | ||
| 163 | |||
| 164 | ######################################################### | ||
| 165 | # Main program # | ||
| 166 | ######################################################### | ||
| 167 | |||
| 168 | # Load configuration | ||
| 169 | test -f /etc/default/quagga && . /etc/default/quagga | ||
| 170 | |||
| 171 | case "$1" in | ||
| 172 | start) | ||
| 173 | cd $C_PATH/ | ||
| 174 | start_all $2 | ||
| 175 | vtysh_b | ||
| 176 | ;; | ||
| 177 | |||
| 178 | stop) | ||
| 179 | stop_all $2 | ||
| 180 | echo "Removing all routes made by zebra." | ||
| 181 | ip route flush proto zebra | ||
| 182 | ;; | ||
| 183 | |||
| 184 | status) | ||
| 185 | status_all $2 | ||
| 186 | ;; | ||
| 187 | |||
| 188 | restart|force-reload) | ||
| 189 | $0 stop $2 | ||
| 190 | sleep 1 | ||
| 191 | $0 start $2 | ||
| 192 | ;; | ||
| 193 | |||
| 194 | *) | ||
| 195 | echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" | ||
| 196 | exit 1 | ||
| 197 | ;; | ||
| 198 | esac | ||
| 199 | |||
| 200 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga new file mode 100644 index 0000000000..cfb896a17b --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
| 2 | d quagga quagga 0755 /var/run/quagga none | ||
| 3 | d quagga quagga 0755 /var/log/quagga none \ No newline at end of file | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-networking/recipes-protocols/quagga/files/watchquagga.default new file mode 100644 index 0000000000..53f6a8cf10 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.default | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # Watchquagga configuration | ||
| 2 | #watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" | ||
| 3 | watch_daemons="zebra" | ||
| 4 | |||
| 5 | # To enable restarts, uncomment this line (but first be sure to edit | ||
| 6 | # the WATCH_DAEMONS line to reflect the daemons you are actually using): | ||
| 7 | watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-networking/recipes-protocols/quagga/files/watchquagga.init new file mode 100644 index 0000000000..5ddd94a3d6 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.init | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: watchquagga | ||
| 5 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
| 6 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
| 7 | # Default-Start: 2 3 4 5 | ||
| 8 | # Default-Stop: 0 1 6 | ||
| 9 | # Short-Description: start and stop the Quagga watchdog | ||
| 10 | ### END INIT INFO | ||
| 11 | |||
| 12 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
| 13 | |||
| 14 | # Load configuration | ||
| 15 | test -f /etc/default/watchquagga && . /etc/default/watchquagga | ||
| 16 | |||
| 17 | # Check that there are daemons to be monitored. | ||
| 18 | [ -z "$watch_daemons" ] && exit 0 | ||
| 19 | |||
| 20 | pidfile="/var/run/quagga/watchquagga.pid" | ||
| 21 | |||
| 22 | case "$1" in | ||
| 23 | start) | ||
| 24 | echo -n "Starting quagga watchdog daemon: watchquagga" | ||
| 25 | start-stop-daemon --start \ | ||
| 26 | --pidfile $pidfile \ | ||
| 27 | --exec /usr/sbin/watchquagga \ | ||
| 28 | -- -d $watch_options $watch_daemons | ||
| 29 | echo "." | ||
| 30 | ;; | ||
| 31 | |||
| 32 | stop) | ||
| 33 | echo -n "Stopping quagga watchdog daemon: watchquagga" | ||
| 34 | start-stop-daemon --stop --quiet \ | ||
| 35 | --pidfile $pidfile | ||
| 36 | echo "." | ||
| 37 | ;; | ||
| 38 | |||
| 39 | status) | ||
| 40 | echo -n "watchquagga " | ||
| 41 | res=1 | ||
| 42 | [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null | ||
| 43 | if [ $? -eq 0 ]; then | ||
| 44 | echo "(pid `cat $pidfile`) is running..." | ||
| 45 | res=0 | ||
| 46 | else | ||
| 47 | echo "is stopped..." | ||
| 48 | fi | ||
| 49 | exit $res | ||
| 50 | ;; | ||
| 51 | |||
| 52 | restart|force-reload) | ||
| 53 | $0 stop $2 | ||
| 54 | sleep 1 | ||
| 55 | $0 start $2 | ||
| 56 | ;; | ||
| 57 | |||
| 58 | *) | ||
| 59 | echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" | ||
| 60 | exit 1 | ||
| 61 | ;; | ||
| 62 | esac | ||
| 63 | |||
| 64 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc new file mode 100644 index 0000000000..6ee2455be8 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga.inc | |||
| @@ -0,0 +1,153 @@ | |||
| 1 | SUMMARY = "BGP/OSPF/RIP routing daemon" | ||
| 2 | DESCRIPTION = "Quagga is a routing software suite, providing \ | ||
| 3 | implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for \ | ||
| 4 | Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. \ | ||
| 5 | Quagga is a fork of GNU Zebra which was developed by Kunihiro \ | ||
| 6 | Ishiguro. The Quagga tree aims to build a more involved community \ | ||
| 7 | around Quagga than the current centralised model of GNU Zebra." | ||
| 8 | HOMEPAGE = "http://www.quagga.net/" | ||
| 9 | SECTION = "network" | ||
| 10 | LICENSE = "GPL-2.0 & LGPL-2.0" | ||
| 11 | DEPENDS = "readline ncurses perl-native" | ||
| 12 | |||
| 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ | ||
| 14 | file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a" | ||
| 15 | |||
| 16 | INC_PR = "r0" | ||
| 17 | |||
| 18 | QUAGGASUBDIR = "" | ||
| 19 | # ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old | ||
| 20 | # versions and leave it empty for recent versions. | ||
| 21 | SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz;name=quagga-${PV} \ | ||
| 22 | file://fix-for-lib-inpath.patch \ | ||
| 23 | file://quagga-0.99.17-libcap.patch \ | ||
| 24 | file://quagga.init \ | ||
| 25 | file://quagga.default \ | ||
| 26 | file://watchquagga.init \ | ||
| 27 | file://watchquagga.default \ | ||
| 28 | file://volatiles.03_quagga" | ||
| 29 | |||
| 30 | inherit autotools update-rc.d useradd | ||
| 31 | |||
| 32 | EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ | ||
| 33 | --localstatedir=${localstatedir}/run/quagga \ | ||
| 34 | --enable-exampledir=${docdir}/quagga/examples/ \ | ||
| 35 | --enable-vtysh \ | ||
| 36 | --enable-isisd \ | ||
| 37 | --enable-watchquagga \ | ||
| 38 | --enable-ospf-te \ | ||
| 39 | --enable-opaque-lsa \ | ||
| 40 | --enable-ipv6 \ | ||
| 41 | --enable-ospfclient=yes \ | ||
| 42 | --enable-multipath=64 \ | ||
| 43 | --enable-user=quagga \ | ||
| 44 | --enable-group=quagga \ | ||
| 45 | --enable-vty-group=quaggavty \ | ||
| 46 | --enable-configfile-mask=0640 \ | ||
| 47 | --enable-logfile-mask=0640 \ | ||
| 48 | --enable-rtadv \ | ||
| 49 | --enable-tcp-md5" | ||
| 50 | |||
| 51 | do_install () { | ||
| 52 | # Install init script and default settings | ||
| 53 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \ | ||
| 54 | ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles | ||
| 55 | install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga | ||
| 56 | install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga | ||
| 57 | install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga | ||
| 58 | install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga | ||
| 59 | install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
| 60 | # Install quagga | ||
| 61 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ | ||
| 62 | sbindir=${sbindir} \ | ||
| 63 | sysconfdir=${sysconfdir}/quagga \ | ||
| 64 | localstatedir=${localstatedir}/run/quagga | ||
| 65 | |||
| 66 | # Fix hardcoded paths | ||
| 67 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/* | ||
| 68 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga | ||
| 69 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga | ||
| 70 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
| 71 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/* | ||
| 72 | } | ||
| 73 | |||
| 74 | # Split into a main package and separate per-protocol packages | ||
| 75 | PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-babeld ${PN}-bgpd \ | ||
| 76 | ${PN}-ripd ${PN}-ripngd ${PN}-isisd \ | ||
| 77 | ${PN}-ospfclient ${PN}-watchquagga" | ||
| 78 | |||
| 79 | FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*" | ||
| 80 | FILES_${PN}-ospf6d = "${sbindir}/ospf6d" | ||
| 81 | FILES_${PN}-babeld = "${sbindir}/babeld" | ||
| 82 | FILES_${PN}-bgpd = "${sbindir}/bgpd" | ||
| 83 | FILES_${PN}-ripd = "${sbindir}/ripd" | ||
| 84 | FILES_${PN}-ripngd = "${sbindir}/ripngd" | ||
| 85 | FILES_${PN}-isisd = "${sbindir}/isisd" | ||
| 86 | FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*" | ||
| 87 | FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \ | ||
| 88 | ${sysconfdir}/init.d/watchquagga" | ||
| 89 | |||
| 90 | # Indicate that the default files are configuration files | ||
| 91 | CONFFILES_${PN} = "${sysconfdir}/default/quagga" | ||
| 92 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" | ||
| 93 | |||
| 94 | # Stop the names being rewritten due to the internal shared libraries | ||
| 95 | DEBIAN_NOAUTONAME_${PN}-ospfd = "1" | ||
| 96 | DEBIAN_NOAUTONAME_${PN}-ospfclient = "1" | ||
| 97 | |||
| 98 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
| 99 | RDEPENDS_${PN} += "iproute2" | ||
| 100 | |||
| 101 | # Main init script starts all deamons | ||
| 102 | # Seperate init script for watchquagga | ||
| 103 | INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga" | ||
| 104 | INITSCRIPT_NAME_${PN} = "quagga" | ||
| 105 | INITSCRIPT_PARAMS_${PN} = "defaults 15 85" | ||
| 106 | INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga" | ||
| 107 | INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10" | ||
| 108 | |||
| 109 | USERADD_PACKAGES = "${PN}" | ||
| 110 | GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" | ||
| 111 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga quagga" | ||
| 112 | |||
| 113 | pkg_postinst_${PN} () { | ||
| 114 | for f in bgpd babeld isisd ospfd ripngd zebra ripd ospf6d; do touch ${sysconfdir}/quagga/$f.conf; done | ||
| 115 | chown quagga:quaggavty ${sysconfdir}/quagga | ||
| 116 | chown quagga:quagga ${sysconfdir}/quagga/*.conf | ||
| 117 | chmod 750 ${sysconfdir}/quagga | ||
| 118 | chown 640 ${sysconfdir}/quagga/*.conf | ||
| 119 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
| 120 | } | ||
| 121 | |||
| 122 | # Stop apps before uninstall | ||
| 123 | pkg_prerm_${PN} () { | ||
| 124 | ${sysconfdir}/init.d/quagga stop | ||
| 125 | } | ||
| 126 | |||
| 127 | pkg_prerm_${PN}-ospfd () { | ||
| 128 | ${sysconfdir}/init.d/quagga stop ospfd | ||
| 129 | } | ||
| 130 | |||
| 131 | pkg_prerm_${PN}-ospf6d () { | ||
| 132 | ${sysconfdir}/init.d/quagga stop ospf6d | ||
| 133 | } | ||
| 134 | |||
| 135 | pkg_prerm_${PN}-babeld () { | ||
| 136 | ${sysconfdir}/init.d/quagga stop babeld | ||
| 137 | } | ||
| 138 | |||
| 139 | pkg_prerm_${PN}-bgpd () { | ||
| 140 | ${sysconfdir}/init.d/quagga stop bgpd | ||
| 141 | } | ||
| 142 | |||
| 143 | pkg_prerm_${PN}-ripd () { | ||
| 144 | ${sysconfdir}/init.d/quagga stop ripd | ||
| 145 | } | ||
| 146 | |||
| 147 | pkg_prerm_${PN}-ripngd () { | ||
| 148 | ${sysconfdir}/init.d/quagga stop ripngd | ||
| 149 | } | ||
| 150 | |||
| 151 | pkg_prerm_${PN}-isisd () { | ||
| 152 | ${sysconfdir}/init.d/quagga stop isisd | ||
| 153 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb new file mode 100644 index 0000000000..5c403a969f --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | require quagga.inc | ||
| 2 | |||
| 3 | PR = "${INC_PR}.0" | ||
| 4 | |||
| 5 | SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f" | ||
| 6 | SRC_URI[quagga-0.99.21.sha256sum] = "9b8aea9026b4771a28e254a66cbd854723bcd0d71eebd0201d11838d4eb392ee" | ||
| 7 | |||
| 8 | QUAGGASUBDIR = "" | ||
