diff options
author | Amy Fong <amy.fong@windriver.com> | 2015-01-29 13:28:08 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-02-03 14:10:55 -0500 |
commit | 32158754790dfdd32a404aa609f4709a0753c9d5 (patch) | |
tree | bed5c39888d3d51ce43402350d75e09144833a93 /recipes-networking/openvswitch/openvswitch_2.1.3.bb | |
parent | 2905d87e7e4f11573e9c12ed85ff70e4aefc701f (diff) | |
download | meta-virtualization-32158754790dfdd32a404aa609f4709a0753c9d5.tar.gz |
openvswitch: restructure recipes
Add openvswitch.inc, removing common parts out of openvswitch*.bb
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch_2.1.3.bb')
-rw-r--r-- | recipes-networking/openvswitch/openvswitch_2.1.3.bb | 119 |
1 files changed, 9 insertions, 110 deletions
diff --git a/recipes-networking/openvswitch/openvswitch_2.1.3.bb b/recipes-networking/openvswitch/openvswitch_2.1.3.bb index c3a29aa4..dc6c7e3d 100644 --- a/recipes-networking/openvswitch/openvswitch_2.1.3.bb +++ b/recipes-networking/openvswitch/openvswitch_2.1.3.bb | |||
@@ -1,35 +1,15 @@ | |||
1 | SUMMARY = "OpenvSwitch" | 1 | require openvswitch.inc |
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 | 2 | ||
7 | DEPENDS += "bridge-utils openssl python perl" | ||
8 | |||
9 | RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ | ||
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" | 3 | RRECOMMENDS_${PN} += "kernel-module-openvswitch" |
16 | 4 | ||
17 | RDEPENDS_${PN}-ptest += "python-logging python-syslog python-argparse python-io \ | 5 | RDEPENDS_${PN}-ptest += "\ |
18 | python-fcntl python-shell python-lang python-xml python-math \ | 6 | python-logging python-syslog python-argparse python-io \ |
19 | python-datetime python-netclient python sed" | 7 | python-fcntl python-shell python-lang python-xml python-math \ |
20 | 8 | python-datetime python-netclient python sed \ | |
21 | # Some installers will fail because of an install order based on | 9 | " |
22 | # rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be | ||
23 | # queued for install later. | ||
24 | RDEPENDS_${PN} += "sed gawk grep" | ||
25 | 10 | ||
26 | SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ | 11 | SRC_URI += "\ |
27 | file://openvswitch-switch \ | 12 | http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ |
28 | file://openvswitch-switch-setup \ | ||
29 | file://openvswitch-controller \ | ||
30 | file://openvswitch-controller-setup \ | ||
31 | file://openvswitch-add-target-python-handling.patch \ | ||
32 | file://openvswitch-add-target-perl-handling.patch \ | ||
33 | file://openvswitch-add-more-target-python-substitutions.patch \ | 13 | file://openvswitch-add-more-target-python-substitutions.patch \ |
34 | file://openvswitch-add-ptest.patch \ | 14 | file://openvswitch-add-ptest.patch \ |
35 | file://run-ptest \ | 15 | file://run-ptest \ |
@@ -40,91 +20,10 @@ SRC_URI[sha256sum] = "43a2562fe5e8e48e997bfdb04691ffaaaefe73069b5699654538bf2f16 | |||
40 | 20 | ||
41 | LIC_FILES_CHKSUM = "file://COPYING;md5=e03b0d9c4115c44518594e5618e653f8" | 21 | LIC_FILES_CHKSUM = "file://COPYING;md5=e03b0d9c4115c44518594e5618e653f8" |
42 | 22 | ||
43 | # Don't compile kernel modules by default since it heavily depends on | 23 | inherit ptest |
44 | # kernel version. Use the in-kernel module for now. | ||
45 | # distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" | ||
46 | # EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" | ||
47 | |||
48 | EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python \ | ||
49 | TARGET_PERL=${bindir}/perl \ | ||
50 | " | ||
51 | |||
52 | ALLOW_EMPTY_${PN}-pki = "1" | ||
53 | PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki" | ||
54 | |||
55 | FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \ | ||
56 | ${sysconfdir}/default/openvswitch-controller \ | ||
57 | ${sysconfdir}/openvswitch-controller \ | ||
58 | ${bindir}/ovs-controller" | ||
59 | |||
60 | FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd" | ||
61 | |||
62 | FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \ | ||
63 | ${sysconfdir}/default/openvswitch-switch \ | ||
64 | " | ||
65 | # silence a warning | ||
66 | FILES_${PN} += "${datadir}/ovsdbmonitor" | ||
67 | FILES_${PN} += "/run" | ||
68 | |||
69 | inherit autotools update-rc.d ptest | ||
70 | 24 | ||
71 | EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" | 25 | EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" |
72 | 26 | ||
73 | do_install_ptest() { | 27 | do_install_ptest() { |
74 | oe_runmake test-install | 28 | oe_runmake test-install |
75 | } | 29 | } |
76 | |||
77 | INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller" | ||
78 | INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" | ||
79 | INITSCRIPT_PARAMS_${PN}-switch = "defaults 71" | ||
80 | |||
81 | INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller" | ||
82 | INITSCRIPT_PARAMS_${PN}-controller = "defaults 72" | ||
83 | |||
84 | do_install_append() { | ||
85 | install -d ${D}/${sysconfdir}/default/ | ||
86 | install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch | ||
87 | install -d ${D}/${sysconfdir}/openvswitch-controller | ||
88 | install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller | ||
89 | |||
90 | install -d ${D}/${sysconfdir}/init.d/ | ||
91 | install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller | ||
92 | install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch | ||
93 | true || rm -fr ${D}/${datadir}/${PN}/pki | ||
94 | } | ||
95 | |||
96 | pkg_postinst_${PN}-pki () { | ||
97 | # can't do this offline | ||
98 | if [ "x$D" != "x" ]; then | ||
99 | exit 1 | ||
100 | fi | ||
101 | if test ! -d $D/${datadir}/${PN}/pki; then | ||
102 | ovs-pki init --dir=$D/${datadir}/${PN}/pki | ||
103 | fi | ||
104 | } | ||
105 | |||
106 | pkg_postinst_${PN}-controller () { | ||
107 | # can't do this offline | ||
108 | if [ "x$D" != "x" ]; then | ||
109 | exit 1 | ||
110 | fi | ||
111 | |||
112 | if test ! -d $D/${datadir}/${PN}/pki; then | ||
113 | ovs-pki init --dir=$D/${datadir}/${PN}/pki | ||
114 | fi | ||
115 | |||
116 | cd $D/${sysconfdir}/openvswitch-controller | ||
117 | if ! test -e cacert.pem; then | ||
118 | ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem | ||
119 | fi | ||
120 | if ! test -e privkey.pem || ! test -e cert.pem; then | ||
121 | oldumask=$(umask) | ||
122 | umask 077 | ||
123 | ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null | ||
124 | mv tmp-privkey.pem privkey.pem | ||
125 | mv tmp-cert.pem cert.pem | ||
126 | mv tmp-req.pem req.pem | ||
127 | chmod go+r cert.pem req.pem | ||
128 | umask $oldumask | ||
129 | fi | ||
130 | } | ||