diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-07-03 12:59:30 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-07-03 12:59:30 +0000 |
commit | dc926e8580765402b917101d42a8b9afb0547bb4 (patch) | |
tree | 818fd9d507a2929378c02d964fd9c79a9edb50c2 | |
parent | 48b5a55ef49f38272a65befdc61c765dd4fb64ab (diff) | |
download | alpine_aports-dc926e8580765402b917101d42a8b9afb0547bb4.tar.bz2 alpine_aports-dc926e8580765402b917101d42a8b9afb0547bb4.tar.xz alpine_aports-dc926e8580765402b917101d42a8b9afb0547bb4.zip |
main/quagga-nhrp: backport from edge
-rw-r--r-- | main/quagga-nhrp/APKBUILD | 95 | ||||
-rw-r--r-- | main/quagga-nhrp/bgpd-route-selection-crash.patch | 16 | ||||
-rw-r--r-- | main/quagga-nhrp/bgpd.initd | 22 | ||||
-rw-r--r-- | main/quagga-nhrp/dont-hook-core-signals.patch | 20 | ||||
-rw-r--r-- | main/quagga-nhrp/quagga-nhrp.post-install | 9 | ||||
l--------- | main/quagga-nhrp/quagga-nhrp.post-upgrade | 1 | ||||
-rw-r--r-- | main/quagga-nhrp/quagga-nhrp.pre-install | 6 | ||||
-rw-r--r-- | main/quagga-nhrp/zebra.confd | 7 | ||||
-rw-r--r-- | main/quagga-nhrp/zebra.initd | 34 |
9 files changed, 210 insertions, 0 deletions
diff --git a/main/quagga-nhrp/APKBUILD b/main/quagga-nhrp/APKBUILD new file mode 100644 index 0000000000..2fe9f53db8 --- /dev/null +++ b/main/quagga-nhrp/APKBUILD | |||
@@ -0,0 +1,95 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | ||
2 | pkgname=quagga-nhrp | ||
3 | pkgver=0.99.24.1_git20150703 | ||
4 | _commitid=04bd757045dd1c09dec133115d3e8620985b4a00 | ||
5 | pkgrel=0 | ||
6 | pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF, BGP and NHRP." | ||
7 | url="http://git.alpinelinux.org/cgit/user/tteras/quagga/commit/?h=nhrp" | ||
8 | arch="all" | ||
9 | license="GPL-2" | ||
10 | depends="iproute2" | ||
11 | makedepends="gawk texinfo perl autoconf automake libtool c-ares-dev | ||
12 | linux-headers readline-dev ncurses-dev net-snmp-dev libcap-dev" | ||
13 | provides="quagga=0.99" | ||
14 | install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade" | ||
15 | subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg" | ||
16 | pkgusers="quagga" | ||
17 | pkggroups="quagga" | ||
18 | source="quagga-nhrp-$pkgver.tar.bz2::http://git.alpinelinux.org/cgit/user/tteras/quagga/snapshot/quagga-$_commitid.tar.bz2 | ||
19 | bgpd-route-selection-crash.patch | ||
20 | dont-hook-core-signals.patch | ||
21 | bgpd.initd | ||
22 | zebra.initd | ||
23 | zebra.confd | ||
24 | " | ||
25 | |||
26 | _builddir="$srcdir"/quagga-$_commitid | ||
27 | prepare() { | ||
28 | cd "$_builddir" | ||
29 | for i in $source; do | ||
30 | case $i in | ||
31 | *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; | ||
32 | esac | ||
33 | done | ||
34 | ./bootstrap.sh || return 1 | ||
35 | } | ||
36 | |||
37 | build() { | ||
38 | cd "$_builddir" | ||
39 | quagga_cv_ipforward_method=proc \ | ||
40 | ./configure \ | ||
41 | --build=$CBUILD \ | ||
42 | --host=$CHOST \ | ||
43 | --prefix=/usr \ | ||
44 | --disable-static \ | ||
45 | --enable-ospf6d \ | ||
46 | --enable-rtadv \ | ||
47 | --enable-user=quagga \ | ||
48 | --enable-group=quagga \ | ||
49 | --enable-vty-group=quagga \ | ||
50 | --enable-vtysh \ | ||
51 | --enable-snmp \ | ||
52 | --enable-multipath=64 \ | ||
53 | --enable-pimd \ | ||
54 | --sysconfdir=/etc/quagga \ | ||
55 | --enable-exampledir=/usr/share/doc/quagga/ \ | ||
56 | --localstatedir=/var/run/quagga \ | ||
57 | || return 1 | ||
58 | |||
59 | # add CFLAGS to work around textrel issue | ||
60 | make CFLAGS+="-fPIC" || return 1 | ||
61 | } | ||
62 | |||
63 | package() { | ||
64 | cd "$_builddir" | ||
65 | make DESTDIR="$pkgdir" install || return 1 | ||
66 | rm "$pkgdir"/usr/lib/*.la || return 1 | ||
67 | |||
68 | install -o quagga -g quagga -d "$pkgdir"/var/run/quagga | ||
69 | for i in zebra bgpd; do | ||
70 | install -Dm755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/$i | ||
71 | done | ||
72 | for i in ripd ospfd ripngd ospf6d nhrpd; do | ||
73 | ln -s bgpd "$pkgdir"/etc/init.d/$i || return 1 | ||
74 | done | ||
75 | install -Dm644 "$srcdir/zebra.confd" "$pkgdir"/etc/conf.d/zebra | ||
76 | install -o quagga -g quagga -d -m755 "$pkgdir"/etc/quagga | ||
77 | } | ||
78 | md5sums="dbc883c35f149f44f93bfaab5108830b quagga-nhrp-0.99.24.1_git20150703.tar.bz2 | ||
79 | 10c9c745f2f9fdd1d81a4100d44e3313 bgpd-route-selection-crash.patch | ||
80 | 1224ba91ea6b6e81f583bad7813aba98 dont-hook-core-signals.patch | ||
81 | 09a77e2e84e71c43f5a449738c026261 bgpd.initd | ||
82 | 916f1dd1a286ee7b862cda4fe56cbf21 zebra.initd | ||
83 | 34e06a1d2bc602ce691abc9ed169dd15 zebra.confd" | ||
84 | sha256sums="fd1a57c0ff8662953b4deddb52f074254ca3ccd98f912a4904540292cb18dd7c quagga-nhrp-0.99.24.1_git20150703.tar.bz2 | ||
85 | d8d65cc092cf7644b059d4c1b789b223482b0f50ba2cc891da4d71fe083f8cc0 bgpd-route-selection-crash.patch | ||
86 | 4b71588e34ac14f8d6e72e6064b5e4ec302f286ebbe43df94c97411cceb66a23 dont-hook-core-signals.patch | ||
87 | aab037454c6a70cd5cb45e14c47b7dfea358f8d81c7d12418edcf7e58a86c679 bgpd.initd | ||
88 | c1d7526581927e990e687cbd5d08447eb060f76a439475572785b5b90c60c460 zebra.initd | ||
89 | f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd" | ||
90 | sha512sums="a4b6f9838d838a1dce9f9a308b2b0036dbf9e8272cfe2b865f3283d9fd2f500383a09df1734e921ba4c20c2b65de903ef925efb79419d20481d8b4342418a1b1 quagga-nhrp-0.99.24.1_git20150703.tar.bz2 | ||
91 | 3317554cc2470f12eb6694f2ada187be4ccc45976ebf09aa487634bbd7a4820a917f3c202bb9d4736771adf33e5eafa45f7bb8dadd2e9872d5fe7885261714b5 bgpd-route-selection-crash.patch | ||
92 | 5ef5c5e6d70d991b33b13a062e25b6fbde395dceee36aea29384b0640a48d2957ed5f50d416a1f2f770bf69bae2340133e35b1114be7e1fa722eb6d3d021f37a dont-hook-core-signals.patch | ||
93 | 13b5b57e10df013bd2d931abc49bf76b8c4dee59dbceab22c9f151ccb988b2c5f7167f2909027d5e0f990b59da8de115667b02484aee9a67d347625700f6cacd bgpd.initd | ||
94 | 1638a4a64ffd066b1884f7e5a4243edab68739aabd83bd35ea8c9608af7b8623eece1d59fb08feead84e4386b6d1da4220764ccf5fd7f2a9959a8470d5cce86a zebra.initd | ||
95 | 900972c6f98e561dfacf384111251db262326e8764b8c763a5ef639fa11c7949c03eef5e3bce324a4b1964fe45416d2db74ae1b6bc967f7d4ba48c2eeda017c4 zebra.confd" | ||
diff --git a/main/quagga-nhrp/bgpd-route-selection-crash.patch b/main/quagga-nhrp/bgpd-route-selection-crash.patch new file mode 100644 index 0000000000..473e4e564b --- /dev/null +++ b/main/quagga-nhrp/bgpd-route-selection-crash.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c | ||
2 | index 34ba1ab..7ade22f 100644 | ||
3 | --- a/bgpd/bgp_route.c | ||
4 | +++ b/bgpd/bgp_route.c | ||
5 | @@ -553,6 +553,11 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist, | ||
6 | return 0; | ||
7 | |||
8 | /* 13. Neighbor address comparision. */ | ||
9 | + if (new->peer->su_remote == NULL) | ||
10 | + return 0; | ||
11 | + if (exist->peer->su_remote == NULL) | ||
12 | + return 1; | ||
13 | + | ||
14 | ret = sockunion_cmp (new->peer->su_remote, exist->peer->su_remote); | ||
15 | |||
16 | if (ret == 1) | ||
diff --git a/main/quagga-nhrp/bgpd.initd b/main/quagga-nhrp/bgpd.initd new file mode 100644 index 0000000000..bd1e4c6c92 --- /dev/null +++ b/main/quagga-nhrp/bgpd.initd | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/sbin/openrc-run | ||
2 | |||
3 | piddir=/var/run/quagga | ||
4 | pidfile=$piddir/$SVCNAME.pid | ||
5 | command=/usr/sbin/$SVCNAME | ||
6 | command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile" | ||
7 | |||
8 | depend() { | ||
9 | need net zebra | ||
10 | after firewall opennhrp | ||
11 | } | ||
12 | |||
13 | start_pre() { | ||
14 | if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then | ||
15 | eerror "You need to create /etc/quagga/$SVCNAME.conf first." | ||
16 | eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample" | ||
17 | eerror "from quagga-doc package" | ||
18 | return 1 | ||
19 | fi | ||
20 | checkpath --owner quagga:quagga --directory $piddir | ||
21 | } | ||
22 | |||
diff --git a/main/quagga-nhrp/dont-hook-core-signals.patch b/main/quagga-nhrp/dont-hook-core-signals.patch new file mode 100644 index 0000000000..0fa57502d0 --- /dev/null +++ b/main/quagga-nhrp/dont-hook-core-signals.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | diff --git a/lib/sigevent.c b/lib/sigevent.c | ||
2 | index c80a729..1221c25 100644 | ||
3 | --- a/lib/sigevent.c | ||
4 | +++ b/lib/sigevent.c | ||
5 | @@ -244,6 +244,7 @@ static void | ||
6 | trap_default_signals(void) | ||
7 | { | ||
8 | static const int core_signals[] = { | ||
9 | +#if 0 | ||
10 | SIGQUIT, | ||
11 | SIGILL, | ||
12 | #ifdef SIGEMT | ||
13 | @@ -261,6 +262,7 @@ trap_default_signals(void) | ||
14 | #ifdef SIGXFSZ | ||
15 | SIGXFSZ, | ||
16 | #endif | ||
17 | +#endif | ||
18 | }; | ||
19 | static const int exit_signals[] = { | ||
20 | SIGHUP, | ||
diff --git a/main/quagga-nhrp/quagga-nhrp.post-install b/main/quagga-nhrp/quagga-nhrp.post-install new file mode 100644 index 0000000000..b4bcef1e7b --- /dev/null +++ b/main/quagga-nhrp/quagga-nhrp.post-install | |||
@@ -0,0 +1,9 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # early quaggas had an entry in ld.so.conf. We dont need it anymore | ||
4 | if [ -r /etc/ld.so.conf ]; then | ||
5 | sed -i -e '/usr\/lib\/quagga/d' /etc/ld.so.conf | ||
6 | # remove if zero sized | ||
7 | [ -s /etc/ld.so.conf ] || rm /etc/ld.so.conf | ||
8 | fi | ||
9 | exit 0 | ||
diff --git a/main/quagga-nhrp/quagga-nhrp.post-upgrade b/main/quagga-nhrp/quagga-nhrp.post-upgrade new file mode 120000 index 0000000000..1dcbc73fb9 --- /dev/null +++ b/main/quagga-nhrp/quagga-nhrp.post-upgrade | |||
@@ -0,0 +1 @@ | |||
quagga-nhrp.post-install \ No newline at end of file | |||
diff --git a/main/quagga-nhrp/quagga-nhrp.pre-install b/main/quagga-nhrp/quagga-nhrp.pre-install new file mode 100644 index 0000000000..c0fe3c8c56 --- /dev/null +++ b/main/quagga-nhrp/quagga-nhrp.pre-install | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | addgroup -S quagga 2>/dev/null | ||
4 | adduser -S -h /var/run/quagga -s /sbin/nologin -D -G quagga quagga 2>/dev/null | ||
5 | exit 0 | ||
6 | |||
diff --git a/main/quagga-nhrp/zebra.confd b/main/quagga-nhrp/zebra.confd new file mode 100644 index 0000000000..d2deb114e5 --- /dev/null +++ b/main/quagga-nhrp/zebra.confd | |||
@@ -0,0 +1,7 @@ | |||
1 | # Additional command-line parameters to run zebra with: | ||
2 | # -k, --keep_kernel Don't delete old routes which installed by zebra. | ||
3 | # -A, --vty_addr addr Set vty's bind address | ||
4 | # -P, --vty_port port Set vty's port number | ||
5 | # -r, --retain When program terminates, retain added route by zebra. | ||
6 | # -s, --nl-bufsize Set netlink receive buffer size | ||
7 | ZEBRA_OPTS="" | ||
diff --git a/main/quagga-nhrp/zebra.initd b/main/quagga-nhrp/zebra.initd new file mode 100644 index 0000000000..6ab297e74f --- /dev/null +++ b/main/quagga-nhrp/zebra.initd | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/sbin/openrc-run | ||
2 | |||
3 | piddir=/var/run/quagga | ||
4 | pidfile=$piddir/$SVCNAME.pid | ||
5 | command=/usr/sbin/$SVCNAME | ||
6 | command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile" | ||
7 | |||
8 | depend() { | ||
9 | need net | ||
10 | after firewall opennhrp | ||
11 | } | ||
12 | |||
13 | cleanup() { | ||
14 | ebegin "Cleaning up stale zebra routes..." | ||
15 | ip route flush proto zebra | ||
16 | eend $? | ||
17 | } | ||
18 | |||
19 | checkconfig() { | ||
20 | if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then | ||
21 | eerror "You need to create /etc/quagga/$SVCNAME.conf first." | ||
22 | eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample" | ||
23 | eerror "from quagga-doc package" | ||
24 | return 1 | ||
25 | fi | ||
26 | return 0 | ||
27 | } | ||
28 | |||
29 | start_pre() { | ||
30 | checkconfig || return 1 | ||
31 | checkpath --owner quagga:quagga --directory $piddir | ||
32 | cleanup | ||
33 | } | ||
34 | |||