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