diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-protocols/quagga/quagga.inc | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-protocols/quagga/quagga.inc')
-rw-r--r-- | meta-networking/recipes-protocols/quagga/quagga.inc | 207 |
1 files changed, 207 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 0000000000..60baab8011 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga.inc | |||
@@ -0,0 +1,207 @@ | |||
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.nongnu.org/quagga/" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "GPL-2.0 & LGPL-2.0" | ||
11 | DEPENDS = "readline ncurses perl-native" | ||
12 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'snmp', 'net-snmp', '', d)}" | ||
13 | SNMP_CONF="${@base_contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}" | ||
14 | |||
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ | ||
16 | file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a" | ||
17 | |||
18 | INC_PR = "r2" | ||
19 | |||
20 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
21 | RDEPENDS_${PN} += "iproute2" | ||
22 | |||
23 | QUAGGASUBDIR = "" | ||
24 | # ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old | ||
25 | # versions and leave it empty for recent versions. | ||
26 | SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz;name=quagga-${PV} \ | ||
27 | file://fix-for-lib-inpath.patch \ | ||
28 | file://quagga-0.99.17-libcap.patch \ | ||
29 | file://quagga-fix-CVE-2013-6051.patch \ | ||
30 | file://Zebra-sync-zebra-routing-table-with-the-kernel-one.patch \ | ||
31 | file://quagga.init \ | ||
32 | file://quagga.default \ | ||
33 | file://watchquagga.init \ | ||
34 | file://watchquagga.default \ | ||
35 | file://volatiles.03_quagga \ | ||
36 | file://quagga.pam \ | ||
37 | file://ripd-fix-two-bugs-after-received-SIGHUP.patch \ | ||
38 | file://quagga-Avoid-duplicate-connected-address.patch \ | ||
39 | " | ||
40 | |||
41 | MIRRORS += "http://download.savannah.gnu.org/releases/ http://download-mirror.savannah.gnu.org/releases/ \n" | ||
42 | |||
43 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
44 | PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" | ||
45 | PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam" | ||
46 | |||
47 | inherit autotools update-rc.d useradd | ||
48 | |||
49 | EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ | ||
50 | --localstatedir=${localstatedir}/run/quagga \ | ||
51 | --enable-exampledir=${docdir}/quagga/examples/ \ | ||
52 | --enable-vtysh \ | ||
53 | --enable-isisd \ | ||
54 | --enable-watchquagga \ | ||
55 | --enable-ospf-te \ | ||
56 | --enable-opaque-lsa \ | ||
57 | --enable-ipv6 \ | ||
58 | --enable-ospfclient=yes \ | ||
59 | --enable-multipath=64 \ | ||
60 | --enable-user=quagga \ | ||
61 | --enable-group=quagga \ | ||
62 | --enable-vty-group=quaggavty \ | ||
63 | --enable-configfile-mask=0640 \ | ||
64 | --enable-logfile-mask=0640 \ | ||
65 | --enable-rtadv \ | ||
66 | --enable-linux24-tcp-md5 \ | ||
67 | ap_cv_cc_pie=no \ | ||
68 | ${SNMP_CONF}" | ||
69 | |||
70 | do_install () { | ||
71 | # Install init script and default settings | ||
72 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \ | ||
73 | ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles | ||
74 | install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga | ||
75 | install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga | ||
76 | install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga | ||
77 | install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga | ||
78 | install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
79 | |||
80 | # Install sample configurations for the daemons | ||
81 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
82 | install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample | ||
83 | done | ||
84 | |||
85 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
86 | touch ${D}${sysconfdir}/quagga/$f.conf | ||
87 | done | ||
88 | chown quagga:quaggavty ${D}${sysconfdir}/quagga | ||
89 | chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf | ||
90 | chmod 750 ${D}${sysconfdir}/quagga | ||
91 | chmod 640 ${D}${sysconfdir}/quagga/*.conf | ||
92 | |||
93 | # Install quagga | ||
94 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ | ||
95 | sbindir=${sbindir} \ | ||
96 | sysconfdir=${sysconfdir}/quagga \ | ||
97 | localstatedir=${localstatedir}/run/quagga | ||
98 | |||
99 | # Fix hardcoded paths | ||
100 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/* | ||
101 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga | ||
102 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga | ||
103 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
104 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/* | ||
105 | |||
106 | # Remove generated info dir file, it doesn't belong in the generated | ||
107 | # package. | ||
108 | rm -f ${D}${infodir}/dir | ||
109 | |||
110 | # For PAM | ||
111 | for feature in ${DISTRO_FEATURES}; do | ||
112 | if [ "$feature" = "pam" ]; then | ||
113 | install -D -m 644 ${WORKDIR}/quagga.pam ${D}/${sysconfdir}/pam.d/quagga | ||
114 | break | ||
115 | fi | ||
116 | done | ||
117 | |||
118 | } | ||
119 | |||
120 | # Split into a main package and separate per-protocol packages | ||
121 | PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-babeld ${PN}-bgpd \ | ||
122 | ${PN}-ripd ${PN}-ripngd ${PN}-isisd \ | ||
123 | ${PN}-ospfclient ${PN}-watchquagga" | ||
124 | |||
125 | FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*" | ||
126 | FILES_${PN}-ospf6d = "${sbindir}/ospf6d" | ||
127 | FILES_${PN}-babeld = "${sbindir}/babeld" | ||
128 | FILES_${PN}-bgpd = "${sbindir}/bgpd" | ||
129 | FILES_${PN}-ripd = "${sbindir}/ripd" | ||
130 | FILES_${PN}-ripngd = "${sbindir}/ripngd" | ||
131 | FILES_${PN}-isisd = "${sbindir}/isisd" | ||
132 | FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*" | ||
133 | FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \ | ||
134 | ${sysconfdir}/init.d/watchquagga" | ||
135 | |||
136 | # Indicate that the default files are configuration files | ||
137 | CONFFILES_${PN} = "${sysconfdir}/default/quagga \ | ||
138 | ${sysconfdir}/quagga/bgpd.conf \ | ||
139 | ${sysconfdir}/quagga/vtysh.conf \ | ||
140 | ${sysconfdir}/quagga/babeld.conf \ | ||
141 | ${sysconfdir}/quagga/isisd.conf \ | ||
142 | ${sysconfdir}/quagga/ospfd.conf \ | ||
143 | ${sysconfdir}/quagga/ripngd.conf \ | ||
144 | ${sysconfdir}/quagga/zebra.conf \ | ||
145 | ${sysconfdir}/quagga/ripd.conf \ | ||
146 | ${sysconfdir}/quagga/ospf6d.conf \ | ||
147 | " | ||
148 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" | ||
149 | |||
150 | # Stop the names being rewritten due to the internal shared libraries | ||
151 | DEBIAN_NOAUTONAME_${PN}-ospfd = "1" | ||
152 | DEBIAN_NOAUTONAME_${PN}-ospfclient = "1" | ||
153 | |||
154 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
155 | RDEPENDS_${PN} += "iproute2" | ||
156 | |||
157 | # Main init script starts all deamons | ||
158 | # Seperate init script for watchquagga | ||
159 | INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga" | ||
160 | INITSCRIPT_NAME_${PN} = "quagga" | ||
161 | INITSCRIPT_PARAMS_${PN} = "defaults 15 85" | ||
162 | INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga" | ||
163 | INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10" | ||
164 | |||
165 | # Add quagga's user and group | ||
166 | USERADD_PACKAGES = "${PN}" | ||
167 | GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" | ||
168 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga --shell /bin/false quagga" | ||
169 | |||
170 | pkg_postinst_${PN} () { | ||
171 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
172 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
173 | fi | ||
174 | } | ||
175 | |||
176 | # Stop apps before uninstall | ||
177 | pkg_prerm_${PN} () { | ||
178 | ${sysconfdir}/init.d/quagga stop | ||
179 | } | ||
180 | |||
181 | pkg_prerm_${PN}-ospfd () { | ||
182 | ${sysconfdir}/init.d/quagga stop ospfd | ||
183 | } | ||
184 | |||
185 | pkg_prerm_${PN}-ospf6d () { | ||
186 | ${sysconfdir}/init.d/quagga stop ospf6d | ||
187 | } | ||
188 | |||
189 | pkg_prerm_${PN}-babeld () { | ||
190 | ${sysconfdir}/init.d/quagga stop babeld | ||
191 | } | ||
192 | |||
193 | pkg_prerm_${PN}-bgpd () { | ||
194 | ${sysconfdir}/init.d/quagga stop bgpd | ||
195 | } | ||
196 | |||
197 | pkg_prerm_${PN}-ripd () { | ||
198 | ${sysconfdir}/init.d/quagga stop ripd | ||
199 | } | ||
200 | |||
201 | pkg_prerm_${PN}-ripngd () { | ||
202 | ${sysconfdir}/init.d/quagga stop ripngd | ||
203 | } | ||
204 | |||
205 | pkg_prerm_${PN}-isisd () { | ||
206 | ${sysconfdir}/init.d/quagga stop isisd | ||
207 | } | ||