net-misc/openvswitch: fixing install when using monitor
authorMatthew Thode <prometheanfire@gentoo.org>
Tue, 4 Oct 2016 20:18:46 +0000 (15:18 -0500)
committerMatthew Thode <prometheanfire@gentoo.org>
Tue, 4 Oct 2016 20:19:06 +0000 (15:19 -0500)
Package-Manager: portage-2.3.0

net-misc/openvswitch/openvswitch-2.6.0.ebuild

index b80877a35fb3c94133805aefae142316af9b6005..e757a2443457f7632088f6df87d44fbebd711f86 100644 (file)
@@ -48,7 +48,6 @@ pkg_setup() {
                CONFIG_CHECK+=" ~OPENVSWITCH"
                linux-info_pkg_setup
        fi
-       use monitor && python-r1_pkg_setup
 }
 
 src_prepare() {
@@ -69,7 +68,7 @@ src_configure() {
        local linux_config
        use modules && linux_config="--with-linux=${KV_OUT_DIR}"
 
-       PYTHON=python2.7 econf ${linux_config} \
+       econf ${linux_config} \
                --with-rundir=/var/run/openvswitch \
                --with-logdir=/var/log/openvswitch \
                --with-pkidir=/etc/ssl/openvswitch \
@@ -81,26 +80,22 @@ src_configure() {
 src_compile() {
        default
 
-#      use monitor && python_fix_shebang \
-#              utilities/ovs-{pcap,tcpundump,test,vlan-test} \
-#              utilities/bugtool/ovs-bugtool
-       if use monitor; then
-               sed -i \
-                       's/^#\!\ python2\.7/#\!\/usr\/bin\/env\ python2\.7/' \
-                       utilities/ovs-{pcap,parse-backtrace,dpctl-top,l3ping,tcpundump,test,vlan-test} \
-                       utilities/bugtool/ovs-bugtool || die "sed died :("
-       fi
-
        use modules && linux-mod_src_compile
 }
 
 src_install() {
        default
+       for SCRIPT in ovs-{pcap,parse-backtrace,dpctl-top,l3ping,tcpundump,test,vlan-test} bugtool/ovs-bugtool; do
+               python_replicate_script utilities/"${SCRIPT}"
+       done
 
        if use monitor ; then
-               python_domodule "${ED}"/usr/share/openvswitch/python/*
+               python_install() {
+                       python_domodule "${ED}"/usr/share/openvswitch/python/*
+                       python_optimize "${ED}/usr/share/ovsdbmonitor"
+               }
+               python_foreach_impl python_install
                rm -r "${ED}/usr/share/openvswitch/python"
-               python_optimize "${ED}/usr/share/ovsdbmonitor"
        fi
        # not working without the brcompat_mod kernel module which did not get
        # included in the kernel and we can't build it anymore