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

Contents of /net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 18 08:41:29 2012 UTC (4 years, 7 months ago) by dev-zero
Branch: MAIN
Add init.d-script for ovs-controller

(Portage version: 2.1.11/cvs/Linux x86_64)

1 # Copyright 1999-2012 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.6.1-r1.ebuild,v 1.2 2012/07/18 07:53:05 dev-zero Exp $
4
5 EAPI=4
6
7 PYTHON_DEPEND="monitor? 2"
8
9 inherit eutils linux-info python
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"
18 IUSE="debug monitor +pyside +ssl"
19
20 RDEPEND="ssl? ( dev-libs/openssl )
21 monitor? ( dev-python/twisted
22 dev-python/twisted-conch
23 dev-python/twisted-web
24 pyside? ( dev-python/pyside )
25 !pyside? ( dev-python/PyQt4 )
26 net-zope/zope-interface )
27 debug? ( dev-lang/perl )"
28 DEPEND="${RDEPEND}
29 virtual/pkgconfig"
30
31 CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN ~OPENVSWITCH"
32
33 pkg_setup() {
34 linux-info_pkg_setup
35 python_set_active_version 2
36 python_pkg_setup
37 }
38
39 src_configure() {
40 set_arch_to_kernel
41 use monitor || export ovs_cv_python="no"
42 use pyside || export ovs_cv_pyuic4="no"
43 local modconf
44 econf ${modconf} \
45 --with-rundir=/var/run/openvswitch \
46 --with-logdir=/var/log/openvswitch \
47 --with-pkidir=/etc/openvswitch/pki \
48 $(use_enable ssl) \
49 $(use_enable !debug ndebug)
50 }
51
52 src_compile() {
53 default
54
55 use monitor && python_convert_shebangs 2 \
56 utilities/ovs-{pcap,tcpundump,test,vlan-test} \
57 utilities/bugtool/ovs-bugtool \
58 ovsdb/ovsdbmonitor/ovsdbmonitor
59 }
60
61 src_install() {
62 default
63
64 if use monitor ; then
65 insinto $(python_get_sitedir)
66 doins -r "${D}"/usr/share/openvswitch/python/*
67 rm -r "${D}/usr/share/openvswitch/python"
68 fi
69 # not working without the brcompat_mod kernel module which did not get
70 # included in the kernel and we can't build it anymore
71 rm "${D}/usr/sbin/ovs-brcompatd" "${D}/usr/share/man/man8/ovs-brcompatd.8"
72
73 keepdir /var/log/openvswitch
74 keepdir /etc/openvswitch/pki
75
76 rm -rf "${D}/var/run"
77 use monitor || rmdir "${D}/usr/share/openvswitch/ovsdbmonitor"
78 use debug || rm "${D}/usr/bin/ovs-parse-leaks"
79
80 newconfd "${FILESDIR}/ovsdb-server_conf" ovsdb-server
81 newconfd "${FILESDIR}/ovs-vswitchd_conf" ovs-vswitchd
82 newconfd "${FILESDIR}/ovs-controller_conf" ovs-controller
83 doinitd "${FILESDIR}/ovsdb-server"
84 doinitd "${FILESDIR}/ovs-vswitchd"
85 doinitd "${FILESDIR}/ovs-controller"
86
87 insinto /etc/logrotate.d
88 newins rhel/etc_logrotate.d_openvswitch openvswitch
89 }
90
91 pkg_postinst() {
92 use monitor && python_mod_optimize /usr/share/openvswitch/ovsdbmonitor ovs ovstest
93
94 elog "Use the following command to create an initial database for ovsdb-server:"
95 elog " emerge --config =${CATEGORY}/${PF}"
96 elog "(will create a database in /etc/openvswitch/conf.db)"
97 elog "or to convert the database to the current schema after upgrading."
98 }
99
100 pkg_postrm() {
101 use monitor && python_mod_cleanup /usr/share/openvswitch/ovsdbmonitor ovs ovstest
102 }
103
104 pkg_config() {
105 local db="${PREFIX}/etc/openvswitch/conf.db"
106 if [ -e "${db}" ] ; then
107 einfo "Database '${db}' already exists, doing schema migration..."
108 einfo "(if the migration fails, make sure that ovsdb-server is not running)"
109 "${PREFIX}/usr/bin/ovsdb-tool" convert "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "converting database failed"
110 else
111 einfo "Creating new database '${db}'..."
112 "${PREFIX}/usr/bin/ovsdb-tool" create "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "creating database failed"
113 fi
114 }

  ViewVC Help
Powered by ViewVC 1.1.20