Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openvswitch/
Date: Fri, 21 Sep 2018 22:32:29
Message-Id: 1537569133.2fdaed9ffb402570f8d6c7afdf28b5587e1bf370.prometheanfire@gentoo
1 commit: 2fdaed9ffb402570f8d6c7afdf28b5587e1bf370
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 21 22:26:35 2018 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 21 22:32:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fdaed9f
7
8 net-misc/openvswitch: 2.10.0 bup
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.10
11
12 net-misc/openvswitch/Manifest | 1 +
13 net-misc/openvswitch/openvswitch-2.10.0.ebuild | 152 +++++++++++++++++++++++++
14 2 files changed, 153 insertions(+)
15
16 diff --git a/net-misc/openvswitch/Manifest b/net-misc/openvswitch/Manifest
17 index bccf494b887..fb7dc29fbd4 100644
18 --- a/net-misc/openvswitch/Manifest
19 +++ b/net-misc/openvswitch/Manifest
20 @@ -1,2 +1,3 @@
21 +DIST openvswitch-2.10.0.tar.gz 7528705 BLAKE2B a04e6e823a40e9a3a2d2ffd79a881b1f1e2063333a911b9b213eb1ae10d35c4716778e9897f264216889fd7db75b4f89c3e05b34040ce01ab29f0844b4b0cbb2 SHA512 f118c1c4ab4e126c3343023b03007ca9819c3c5a5ea42eaffaabdc7c50ecddede3e258574dbe0de95ed3be2e3d101612f5bdb423a7adb679987f4e501183a216
22 DIST openvswitch-2.7.2.tar.gz 6192414 BLAKE2B aea61637fe04d27d4c97e733987e843ef932bdd9e1d463c391e258a2b4461866a897c5063859708126c564e42ef99ab63a4b8fac8335bdc78531c46217abd945 SHA512 790a715dd31729893a1c21af4197400b7362569d15cb763cbbab82830c5f5168d2dea0cb40282faa17734a2ad967bc40d02b8f4f92ea585164386d2aa0719470
23 DIST openvswitch-2.8.1.tar.gz 6746474 BLAKE2B b41c77e7653a621c4954a8d752d569971f67db7e09a586da5e57ca4b6882ba3c478437ba8ac47b151c08068fa9c1cdb0f74f8630821e5d721ceb2accef75a3a1 SHA512 b9e90b49bb91aef80942b146e7e324b74f8961342dcc7836f2551ea976a69d66506a3a739bcb01a926b3b3874c7e4312de02965738a1536a342ab95f935d92f7
24
25 diff --git a/net-misc/openvswitch/openvswitch-2.10.0.ebuild b/net-misc/openvswitch/openvswitch-2.10.0.ebuild
26 new file mode 100644
27 index 00000000000..c7dbad710b1
28 --- /dev/null
29 +++ b/net-misc/openvswitch/openvswitch-2.10.0.ebuild
30 @@ -0,0 +1,152 @@
31 +# Copyright 1999-2018 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
37 +
38 +inherit autotools eutils linux-info linux-mod python-r1 systemd versionator
39 +
40 +DESCRIPTION="Production quality, multilayer virtual switch"
41 +HOMEPAGE="https://www.openvswitch.org"
42 +SRC_URI="https://www.openvswitch.org/releases/${P}.tar.gz"
43 +
44 +LICENSE="Apache-2.0 GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~arm64 ~x86"
47 +IUSE="debug modules monitor +ssl"
48 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
49 +
50 +RDEPEND="
51 + ssl? ( dev-libs/openssl:0= )
52 + ${PYTHON_DEPS}
53 + ~dev-python/ovs-2.9.2[${PYTHON_USEDEP}]
54 + || (
55 + dev-python/twisted[conch,${PYTHON_USEDEP}]
56 + dev-python/twisted-web[${PYTHON_USEDEP}]
57 + )
58 + dev-python/zope-interface[${PYTHON_USEDEP}]
59 + debug? ( dev-lang/perl )"
60 +DEPEND="${RDEPEND}
61 + virtual/pkgconfig"
62 +
63 +PATCHES="${FILESDIR}/xcp-interface-reconfigure-2.3.2.patch"
64 +
65 +CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN"
66 +MODULE_NAMES="openvswitch(net:${S}/datapath/linux)"
67 +BUILD_TARGETS="all"
68 +
69 +pkg_setup() {
70 + if use modules ; then
71 + CONFIG_CHECK+=" ~!OPENVSWITCH"
72 + kernel_is ge 3 10 0 || die "Linux >= 3.10.0 and <= 4.8 required for userspace modules"
73 + # docs state 4.17.x code states 4.15.x
74 + kernel_is le 4 15 999 || die "Linux >= 3.10.0 and <= 4.12 required for userspace modules"
75 + linux-mod_pkg_setup
76 + else
77 + CONFIG_CHECK+=" ~OPENVSWITCH"
78 + linux-info_pkg_setup
79 + fi
80 +}
81 +
82 +src_prepare() {
83 + # Never build kernelmodules, doing this manually
84 + sed -i \
85 + -e '/^SUBDIRS/d' \
86 + datapath/Makefile.in || die "sed failed"
87 + eautoreconf
88 + default
89 +}
90 +
91 +src_configure() {
92 + set_arch_to_kernel
93 + # monitor is statically enabled for bug 596206
94 + # use monitor || export ovs_cv_python="no"
95 + # pyside is staticly disabled
96 + export ovs_cv_pyuic4="no"
97 +
98 + local linux_config
99 + use modules && linux_config="--with-linux=${KV_OUT_DIR}"
100 +
101 + econf ${linux_config} \
102 + --with-rundir=/var/run/openvswitch \
103 + --with-logdir=/var/log/openvswitch \
104 + --with-pkidir=/etc/ssl/openvswitch \
105 + --with-dbdir=/var/lib/openvswitch \
106 + $(use_enable ssl) \
107 + $(use_enable !debug ndebug)
108 +}
109 +
110 +src_compile() {
111 + default
112 +
113 + use modules && linux-mod_src_compile
114 +}
115 +
116 +src_install() {
117 + default
118 +
119 + local SCRIPT
120 + if use monitor; then
121 + for SCRIPT in ovs-{pcap,parse-backtrace,dpctl-top,l3ping,tcpdump,tcpundump,test,vlan-test} bugtool/ovs-bugtool; do
122 + sed -e '1s|^.*$|#!/usr/bin/python|' -i utilities/"${SCRIPT}"
123 + python_foreach_impl python_doscript utilities/"${SCRIPT}"
124 + done
125 + rm -r "${ED%/}"/usr/share/openvswitch/python || die
126 + fi
127 +
128 + keepdir /var/{lib,log}/openvswitch
129 + keepdir /etc/ssl/openvswitch
130 + fperms 0750 /etc/ssl/openvswitch
131 +
132 + rm -rf "${ED%/}"/var/run || die
133 +
134 + newconfd "${FILESDIR}/ovsdb-server_conf2" ovsdb-server
135 + newconfd "${FILESDIR}/ovs-vswitchd_conf" ovs-vswitchd
136 + newinitd "${FILESDIR}/ovsdb-server-r1" ovsdb-server
137 + newinitd "${FILESDIR}/ovs-vswitchd-r1" ovs-vswitchd
138 +
139 + systemd_dounit "${FILESDIR}/ovsdb-server.service"
140 + systemd_dounit "${FILESDIR}/ovs-vswitchd.service"
141 + systemd_newtmpfilesd "${FILESDIR}/openvswitch.tmpfiles" openvswitch.conf
142 +
143 + insinto /etc/logrotate.d
144 + newins rhel/etc_logrotate.d_openvswitch openvswitch
145 +
146 + use modules && linux-mod_src_install
147 +}
148 +
149 +pkg_postinst() {
150 + use modules && linux-mod_pkg_postinst
151 +
152 + local pv
153 + for pv in ${REPLACING_VERSIONS}; do
154 + if ! version_is_at_least 1.9.0 ${pv} ; then
155 + ewarn "The configuration database for Open vSwitch got moved in version 1.9.0 from"
156 + ewarn " /etc/openvswitch"
157 + ewarn "to"
158 + ewarn " /var/lib/openvswitch"
159 + ewarn "Please copy/move the database manually before running the schema upgrade."
160 + ewarn "The PKI files are now supposed to go to /etc/ssl/openvswitch"
161 + fi
162 + done
163 +
164 + elog "Use the following command to create an initial database for ovsdb-server:"
165 + elog " emerge --config =${CATEGORY}/${PF}"
166 + elog "(will create a database in /var/lib/openvswitch/conf.db)"
167 + elog "or to convert the database to the current schema after upgrading."
168 +}
169 +
170 +pkg_config() {
171 + local db="${EROOT%/}"/var/lib/openvswitch/conf.db
172 + if [[ -e "${db}" ]] ; then
173 + einfo "Database '${db}' already exists, doing schema migration..."
174 + einfo "(if the migration fails, make sure that ovsdb-server is not running)"
175 + ovsdb-tool convert "${db}" \
176 + "${EROOT%/}"/usr/share/openvswitch/vswitch.ovsschema || die "converting database failed"
177 + else
178 + einfo "Creating new database '${db}'..."
179 + ovsdb-tool create "${db}" \
180 + "${EROOT%/}"/usr/share/openvswitch/vswitch.ovsschema || die "creating database failed"
181 + fi
182 +}