summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch/openvswitch_1.10.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch_1.10.0.bb')
-rw-r--r--recipes-networking/openvswitch/openvswitch_1.10.0.bb118
1 files changed, 118 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..42d4bc44
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch_1.10.0.bb
@@ -0,0 +1,118 @@
1SUMMARY = "OpenvSwitch"
2DESCRIPTION = "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)"
3HOMEPAGE = "http://openvswitch.org/"
4SECTION = "networking"
5LICENSE = "Apache-2"
6
7DEPENDS += "bridge-utils openssl python perl"
8
9RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \
10 python perl perl-module-strict ${PN}-switch ${PN}-controller"
11RDEPENDS_${PN}-controller = "${PN} lsb ${PN}-pki"
12RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen"
13RDEPENDS_${PN}-pki = "${PN}"
14RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch"
15RRECOMMENDS_${PN} += "kernel-module-openvswitch"
16
17# Some installers will fail because of an install order based on
18# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be
19# queued for install later.
20RDEPENDS_${PN} += "sed gawk grep"
21PR = "r4"
22
23SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \
24 file://openvswitch-switch \
25 file://openvswitch-switch-setup \
26 file://openvswitch-controller \
27 file://openvswitch-controller-setup \
28 file://openvswitch-add-target-python-handling.patch \
29 file://openvswitch-add-target-perl-handling.patch \
30 file://configure-Only-link-against-libpcap-on-FreeBSD.patch \
31 "
32
33SRC_URI[md5sum] = "fe8b49efe9f86b57abab00166b971106"
34SRC_URI[sha256sum] = "803966c89d6a5de6d710a2cb4ed73ac8d8111a2c44b12b846dcef8e91ffab167"
35LIC_FILES_CHKSUM = "file://COPYING;md5=49eeb5acb1f5e510f12c44f176c42253"
36
37# Don't compile kernel modules by default since it heavily depends on
38# kernel version. Use the in-kernel module for now.
39# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
40# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
41
42EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python \
43 TARGET_PERL=${bindir}/perl \
44 "
45
46ALLOW_EMPTY_${PN}-pki = "1"
47PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
48
49FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \
50 ${sysconfdir}/default/openvswitch-controller \
51 ${sysconfdir}/openvswitch-controller \
52 ${bindir}/ovs-controller"
53
54FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
55
56FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \
57 ${sysconfdir}/default/openvswitch-switch \
58 "
59# silence a warning
60FILES_${PN} += "${datadir}/ovsdbmonitor"
61FILES_${PN} += "/run"
62
63inherit autotools update-rc.d pkgconfig
64
65INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
66INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
67INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
68
69INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
70INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
71
72do_install_append() {
73 install -d ${D}/${sysconfdir}/default/
74 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
75 install -d ${D}/${sysconfdir}/openvswitch-controller
76 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
77
78 install -d ${D}/${sysconfdir}/init.d/
79 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
80 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
81 true || rm -fr ${D}/${datadir}/${PN}/pki
82}
83
84pkg_postinst_${PN}-pki () {
85 # can't do this offline
86 if [ "x$D" != "x" ]; then
87 exit 1
88 fi
89 if test ! -d $D/${datadir}/${PN}/pki; then
90 ovs-pki init --dir=$D/${datadir}/${PN}/pki
91 fi
92}
93
94pkg_postinst_${PN}-controller () {
95 # can't do this offline
96 if [ "x$D" != "x" ]; then
97 exit 1
98 fi
99
100 if test ! -d $D/${datadir}/${PN}/pki; then
101 ovs-pki init --dir=$D/${datadir}/${PN}/pki
102 fi
103
104 cd $D/${sysconfdir}/openvswitch-controller
105 if ! test -e cacert.pem; then
106 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
107 fi
108 if ! test -e privkey.pem || ! test -e cert.pem; then
109 oldumask=$(umask)
110 umask 077
111 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
112 mv tmp-privkey.pem privkey.pem
113 mv tmp-cert.pem cert.pem
114 mv tmp-req.pem req.pem
115 chmod go+r cert.pem req.pem
116 umask $oldumask
117 fi
118}