# Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit cmake-utils perl-module DESCRIPTION="nfqueue-bindings is a set of high-level modules for several languages (Python and Perl, for the moment), for libnetfilter_queue" HOMEPAGE="http://software.inl.fr/trac/wiki/nfqueue-bindings" SRC_URI="http://software.inl.fr/releases/nfqueue-bindings/${P}.tar.gz" KEYWORDS="~x86 ~amd64" SLOT="0" LICENSE="GPL-3" IUSE="perl python" DEPEND="python? ( virtual/python ) perl? ( dev-lang/perl ) net-libs/libnetfilter_queue dev-lang/swig" src_unpack() { useq python || useq perl || die "At least one supported language must be selected." unpack ${A} perl_set_version # Fix include Perl search directory sed -i "/SET[[:space:]]*([[:space:]]*PERL_POSSIBLE_INCLUDE_PATHS/a\ ${ARCH_LIB}/CORE" ${P}/FindPerlLibs2.cmake # Fix Perl destination directory sed -i "/DESTINATION/s#\(perl\${PERL_VERSION}\)#\1/site_perl/${PERL_VERSION}/${ARCH_LIB##*/}#g" ${P}/perl/CMakeLists.txt # Disable Perl/Python from USE flags useq perl || sed -i '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*perl[[:space:]]*)/s/^/#/g' ${P}/CMakeLists.txt useq python || sed -i '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*python[[:space:]]*)/s/^/#/g' ${P}/CMakeLists.txt } src_install() { echo "Site: $SITE_ARCH and $SITE_LIB" emake DESTDIR="${D}" install PREFIX=/usr || die }