/[gentoo-x86]/net-misc/openvswitch/openvswitch-2.3.2.ebuild
Gentoo

Contents of /net-misc/openvswitch/openvswitch-2.3.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 29 22:36:21 2015 UTC (4 years, 4 months ago) by prometheanfire
Branch: MAIN
CVS Tags: HEAD
bup

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x33ED3FD25AFC78BA)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/openvswitch-2.3.1.ebuild,v 1.3 2015/07/29 17:50:11 zlogene Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit eutils linux-info linux-mod python-single-r1 systemd autotools
10
11 DESCRIPTION="Production quality, multilayer virtual switch"
12 HOMEPAGE="http://openvswitch.org"
13 SRC_URI="http://openvswitch.org/releases/${P}.tar.gz"
14
15 LICENSE="Apache-2.0 GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="debug modules monitor +ssl"
19
20 RDEPEND=">=sys-apps/openrc-0.10.5
21 ssl? ( dev-libs/openssl:= )
22 monitor? (
23 ${PYTHON_DEPS}
24 dev-python/twisted-core
25 dev-python/twisted-conch
26 dev-python/twisted-web
27 dev-python/PyQt4[${PYTHON_USEDEP}]
28 dev-python/zope-interface[${PYTHON_USEDEP}] )
29 debug? ( dev-lang/perl )"
30 DEPEND="${RDEPEND}
31 virtual/pkgconfig"
32
33 CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN"
34 MODULE_NAMES="openvswitch(net:${S}/datapath/linux)"
35 BUILD_TARGETS="all"
36
37 pkg_setup() {
38 if use modules ; then
39 CONFIG_CHECK+=" ~!OPENVSWITCH"
40 kernel_is ge 2 6 32 || die "Linux >= 2.6.32 and <= 3.14 required for userspace modules"
41 kernel_is le 3 14 || die "Linux >= 2.6.32 and <= 3.14 required for userspace modules"
42 linux-mod_pkg_setup
43 else
44 CONFIG_CHECK+=" ~OPENVSWITCH"
45 linux-info_pkg_setup
46 fi
47 use monitor && python-single-r1_pkg_setup
48 }
49
50 src_prepare() {
51 # Never build kernelmodules, doing this manually
52 sed -i \
53 -e '/^SUBDIRS/d' \
54 datapath/Makefile.in || die "sed failed"
55 epatch "${FILESDIR}/xcp-interface-reconfigure-2.3.2.patch"
56 eautoreconf
57 }
58 src_configure() {
59 set_arch_to_kernel
60 use monitor || export ovs_cv_python="no"
61 #pyside is staticly disabled
62 export ovs_cv_pyuic4="no"
63
64 local linux_config
65 use modules && linux_config="--with-linux=${KV_OUT_DIR}"
66
67 PYTHON=python2.7 econf ${linux_config} \
68 --with-rundir=/var/run/openvswitch \
69 --with-logdir=/var/log/openvswitch \
70 --with-pkidir=/etc/ssl/openvswitch \
71 --with-dbdir=/var/lib/openvswitch \
72 $(use_enable ssl) \
73 $(use_enable !debug ndebug)
74 }
75
76 src_compile() {
77 default
78
79 # use monitor && python_fix_shebang \
80 # utilities/ovs-{pcap,tcpundump,test,vlan-test} \
81 # utilities/bugtool/ovs-bugtool
82 if use monitor; then
83 sed -i \
84 's/^#\!\ python2\.7/#\!\/usr\/bin\/env\ python2\.7/' \
85 utilities/ovs-{pcap,parse-backtrace,dpctl-top,l3ping,tcpundump,test,vlan-test} \
86 utilities/bugtool/ovs-bugtool || die "sed died :("
87 fi
88
89 use modules && linux-mod_src_compile
90 }
91
92 src_install() {
93 default
94
95 if use monitor ; then
96 python_domodule "${ED}"/usr/share/openvswitch/python/*
97 rm -r "${ED}/usr/share/openvswitch/python"
98 python_optimize "${ED}/usr/share/ovsdbmonitor"
99 fi
100 # not working without the brcompat_mod kernel module which did not get
101 # included in the kernel and we can't build it anymore
102 rm "${D}/usr/sbin/ovs-brcompatd" "${D}/usr/share/man/man8/ovs-brcompatd.8"
103
104 keepdir /var/{lib,log}/openvswitch
105 keepdir /etc/ssl/openvswitch
106 fperms 0750 /etc/ssl/openvswitch
107
108 rm -rf "${ED}/var/run"
109 use monitor || rmdir "${ED}/usr/share/ovsdbmonitor"
110 use debug || rm "${ED}/usr/bin/ovs-parse-leaks"
111
112 newconfd "${FILESDIR}/ovsdb-server_conf2" ovsdb-server
113 newconfd "${FILESDIR}/ovs-vswitchd_conf" ovs-vswitchd
114 newinitd "${FILESDIR}/ovsdb-server-r1" ovsdb-server
115 newinitd "${FILESDIR}/ovs-vswitchd-r1" ovs-vswitchd
116
117 systemd_dounit "${FILESDIR}/ovsdb-server.service"
118 systemd_dounit "${FILESDIR}/ovs-vswitchd.service"
119 systemd_newtmpfilesd "${FILESDIR}/openvswitch.tmpfiles" openvswitch.conf
120
121 insinto /etc/logrotate.d
122 newins rhel/etc_logrotate.d_openvswitch openvswitch
123
124 use modules && linux-mod_src_install
125 }
126
127 pkg_postinst() {
128 use modules && linux-mod_pkg_postinst
129
130 for pv in ${REPLACING_VERSIONS}; do
131 if ! version_is_at_least 1.9.0 ${pv} ; then
132 ewarn "The configuration database for Open vSwitch got moved in version 1.9.0 from"
133 ewarn " /etc/openvswitch"
134 ewarn "to"
135 ewarn " /var/lib/openvswitch"
136 ewarn "Please copy/move the database manually before running the schema upgrade."
137 ewarn "The PKI files are now supposed to go to /etc/ssl/openvswitch"
138 fi
139 done
140
141 elog "Use the following command to create an initial database for ovsdb-server:"
142 elog " emerge --config =${CATEGORY}/${PF}"
143 elog "(will create a database in /var/lib/openvswitch/conf.db)"
144 elog "or to convert the database to the current schema after upgrading."
145 }
146
147 pkg_config() {
148 local db="${EPREFIX}/var/lib/openvswitch/conf.db"
149 if [ -e "${db}" ] ; then
150 einfo "Database '${db}' already exists, doing schema migration..."
151 einfo "(if the migration fails, make sure that ovsdb-server is not running)"
152 "${EPREFIX}/usr/bin/ovsdb-tool" convert "${db}" "${EPREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "converting database failed"
153 else
154 einfo "Creating new database '${db}'..."
155 "${EPREFIX}/usr/bin/ovsdb-tool" create "${db}" "${EPREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "creating database failed"
156 fi
157 }

  ViewVC Help
Powered by ViewVC 1.1.20