diff options
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch_1.10.0.bb')
-rw-r--r-- | recipes-networking/openvswitch/openvswitch_1.10.0.bb | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch_1.10.0.bb b/recipes-networking/openvswitch/openvswitch_1.10.0.bb new file mode 100644 index 00000000..2e894540 --- /dev/null +++ b/recipes-networking/openvswitch/openvswitch_1.10.0.bb | |||
@@ -0,0 +1,102 @@ | |||
1 | SUMMARY = "OpenvSwitch" | ||
2 | DESCRIPTION = "Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag)" | ||
3 | HOMEPAGE = "http://openvswitch.org/" | ||
4 | SECTION = "networking" | ||
5 | LICENSE = "Apache-2" | ||
6 | |||
7 | DEPENDS += "bridge-utils openssl python perl" | ||
8 | |||
9 | RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid \ | ||
10 | python perl perl-module-strict ${PN}-switch ${PN}-controller" | ||
11 | RDEPENDS_${PN}-controller = "${PN} lsb ${PN}-pki" | ||
12 | RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" | ||
13 | RDEPENDS_${PN}-pki = "${PN}" | ||
14 | RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch" | ||
15 | RRECOMMENDS_${PN} += "kernel-module-openvswitch" | ||
16 | |||
17 | PR = "r0" | ||
18 | |||
19 | SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ | ||
20 | file://openvswitch-switch \ | ||
21 | file://openvswitch-switch-setup \ | ||
22 | file://openvswitch-controller \ | ||
23 | file://openvswitch-controller-setup \ | ||
24 | " | ||
25 | |||
26 | SRC_URI[md5sum] = "e9004202b0e10c0de9870f19d2044f11" | ||
27 | SRC_URI[sha256sum] = "825730db82c7b46a142f057a43345590c299e66704ef7a88d9ed4ffd0c3d6b64" | ||
28 | LIC_FILES_CHKSUM = "file://COPYING;md5=49eeb5acb1f5e510f12c44f176c42253" | ||
29 | |||
30 | # Don't compile kernel modules by default since it heavily depends on | ||
31 | # kernel version. Use the in-kernel module for now. | ||
32 | # distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" | ||
33 | # EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" | ||
34 | |||
35 | ALLOW_EMPTY_${PN}-pki = "1" | ||
36 | PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki" | ||
37 | |||
38 | FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \ | ||
39 | ${sysconfdir}/default/openvswitch-controller \ | ||
40 | ${sysconfdir}/openvswitch-controller \ | ||
41 | ${bindir}/ovs-controller" | ||
42 | |||
43 | FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd" | ||
44 | |||
45 | FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \ | ||
46 | ${sysconfdir}/default/openvswitch-switch \ | ||
47 | " | ||
48 | # silence a warning | ||
49 | FILES_${PN} += "${datadir}/ovsdbmonitor" | ||
50 | |||
51 | inherit autotools update-rc.d | ||
52 | |||
53 | INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller" | ||
54 | INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" | ||
55 | INITSCRIPT_PARAMS_${PN}-switch = "defaults 71" | ||
56 | |||
57 | INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller" | ||
58 | INITSCRIPT_PARAMS_${PN}-controller = "defaults 72" | ||
59 | |||
60 | do_install_append() { | ||
61 | install -d ${D}/${sysconfdir}/default/ | ||
62 | install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch | ||
63 | install -d ${D}/${sysconfdir}/openvswitch-controller | ||
64 | install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller | ||
65 | |||
66 | install -d ${D}/${sysconfdir}/init.d/ | ||
67 | install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller | ||
68 | install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch | ||
69 | true || rm -fr ${D}/${datadir}/${PN}/pki | ||
70 | } | ||
71 | |||
72 | pkg_postinst_${PN}-pki () { | ||
73 | # can't do this offline | ||
74 | if [ "x$D" != "x" ]; then | ||
75 | exit 1 | ||
76 | fi | ||
77 | if test ! -d $D/${datadir}/${PN}/pki; then | ||
78 | ovs-pki init --dir=$D/${datadir}/${PN}/pki | ||
79 | fi | ||
80 | } | ||
81 | |||
82 | pkg_postinst_${PN}-controller () { | ||
83 | # can't do this offline | ||
84 | if [ "x$D" != "x" ]; then | ||
85 | exit 1 | ||
86 | fi | ||
87 | |||
88 | cd $D/${sysconfdir}/openvswitch-controller | ||
89 | if ! test -e cacert.pem; then | ||
90 | ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem | ||
91 | fi | ||
92 | if ! test -e privkey.pem || ! test -e cert.pem; then | ||
93 | oldumask=$(umask) | ||
94 | umask 077 | ||
95 | ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null | ||
96 | mv tmp-privkey.pem privkey.pem | ||
97 | mv tmp-cert.pem cert.pem | ||
98 | mv tmp-req.pem req.pem | ||
99 | chmod go+r cert.pem req.pem | ||
100 | umask $oldumask | ||
101 | fi | ||
102 | } | ||