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/quagga.inc | |
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/quagga.inc')
-rw-r--r-- | meta-networking/recipes-protocols/quagga/quagga.inc | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc new file mode 100644 index 000000000..6ee2455be --- /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 | } | ||