EAPI="2" inherit linux-info linux-mod autotools eutils SLOT="0" KEYWORDS="~amd64" IUSE="ovsdmonitor" LICENSE="Apache-2.0" DESCRIPTION="" HOMEPAGE="http://openvswitch.org/" SRC_URI="http://openvswitch.org/releases/${P}.tar.gz" CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN" BUILD_TARGETS="all" BUILD_TARGET_ARCH="${ARCH}" MODULE_NAMES="openvswitch_mod(misc:${S}:datapath/linux/)" DEPEND="" RDEPEND="dev-libs/openssl ovsdmonitor? ( >=dev-lang/python-2.4 dev-python/twisted-conch dev-python/simplejson || ( dev-python/pyside dev-python/PyQt4 ) net-zope/zope-interface ) " # no idea how to realize the tcpdump patching # tcpdump? ( net-analyzer/tcpdump ) src_prepare() { set_arch_to_kernel if linux_chkconfig_present OPENVSWITCH; then elog "Openvswitch kernel support detected, omitting module build." else elog "No openvswitch kernel support detected, building it." elog "If you use kernel 3.3 or newer you may consider using the included openvswitch support instead." fi eautoreconf } src_configure() { set_arch_to_kernel if linux_chkconfig_present OPENVSWITCH; then econf else econf --with-linux="${KERNEL_DIR}" fi } pkg_setup() { if ! linux_chkconfig_present OPENVSWITCH; then linux-mod_pkg_setup linux_chkconfig_module BRIDGE || die "CONFIG_BRIDGE must be built as a _module_ !" BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}" fi } src_install() { if ! linux_chkconfig_present OPENVSWITCH; then linux-mod_src_install fi emake DESTDIR="${D}" install || die 'emake install failed' newconfd "${FILESDIR}"/ovsdb-server_conf ovsdb-server || die "install failed" newconfd "${FILESDIR}"/ovs-vswitchd_conf ovs-vswitchd || die "install failed" doinitd "${FILESDIR}"/ovsdb-server || die "install failed" doinitd "${FILESDIR}"/ovs-vswitchd || die "install failed" } pkg_postinst() { if ! linux_chkconfig_present OPENVSWITCH; then linux-mod_pkg_postinst fi elog "Please add your openvswitch datapath module to:" if has_version sys-apps/openrc; then elog "/etc/conf.d/modules" else elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}" fi }