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

Contents of /net-misc/openvswitch/openvswitch-1.9.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Aug 22 04:28:25 2014 UTC (5 years, 3 months ago) by prometheanfire
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
bup

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2471eb3e40ac5ac3)

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

  ViewVC Help
Powered by ViewVC 1.1.20