lorcon: complete with proper ruby implementation ! :-) thanks to Flameeyes for beating me like a 2$ hooker

This commit is contained in:
Zero_Chaos 2012-11-27 01:09:59 +00:00
parent 1fd21e4415
commit 9550b986be
2 changed files with 44 additions and 18 deletions

View file

@ -1 +1 @@
EBUILD lorcon-9999.ebuild 1539 SHA256 b01cc8a8078a236cc3c96cfe1dcac8f50168a79afb483aa21b94aa4f7d245f55 SHA512 6e1e1ddce6cf70ee1f0cb10d651fa4a9202b9fa1b1ac300e55d1bd8bbd6dc6423e4493c94bf27a747f208c51df52b72effee689428869a5c0e52eed2f967f6ff WHIRLPOOL c9b2353d895772ad1bc92239ee10e17b42968316563610d02819408c9f68fae563a20863c8f60c52122497cf25dcc5cc8b5b90924686f2279baaab63a37dae31
EBUILD lorcon-9999.ebuild 2010 SHA256 1824bd6e24b3cce2be41fd74f7bcbe2f502d8867926686ceab135f0319a96772 SHA512 6d7cb9a0eb91d5e7c09ba45a536b5131c37c2d635d8c7be470a755166ff8215672aaf4000bd3967855679dcb2e1e35999405f2fc452c4db29e177d140dce4d06 WHIRLPOOL 28f62b1b61725282168334339109b0ad330f8c8e6f6571b691eab9eb88be4b960e59e00a9cb8e2a3b194da9247fd881ea01817f3a4689c0a3fbf6adf546234d4

View file

@ -8,11 +8,13 @@ PYTHON_DEPEND="python? 2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"
inherit git-2 distutils
USE_RUBY="ruby18 ruby19"
RUBY_OPTIONAL=yes
inherit git-2 distutils ruby-ng
DESCRIPTION="A generic library for injecting 802.11 frames"
HOMEPAGE="http://802.11ninja.net/lorcon"
SRC_URI=""
EGIT_REPO_URI="https://code.google.com/p/lorcon/"
LICENSE="GPL-2"
@ -20,45 +22,56 @@ SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="python ruby"
DEPEND="${RDEPEND}"
RDEPEND="dev-libs/libnl"
DEPEND="ruby? ( $(ruby_implementations_depend) )"
RDEPEND="${DEPEND}
dev-libs/libnl"
S="${WORKDIR}"/all
pkg_setup() {
if use python; then
python_pkg_setup;
DISTUTILS_SETUP_FILES=("${S}/pylorcon2|setup.py")
fi
use ruby && ruby-ng_pkg_setup
}
src_unpack() {
git-2_src_unpack
use ruby && ruby-ng_src_unpack
}
src_prepare() {
use python && distutils_src_prepare
sed -i 's#<lorcon2/lorcon.h>#"../lorcon.h"#' pylorcon2/PyLorcon2.c
sed -i 's#find_library("orcon2", "lorcon_list_drivers", "lorcon2/lorcon.h") and ##' ruby-lorcon/extconf.rb
sed -i "s#-I/usr/include/lorcon2#-I${S}/#" ruby-lorcon/extconf.rb
sed -i "s#-I/usr/include/lorcon2#-I${WORKDIR}/all#" ruby-lorcon/extconf.rb
sed -i 's#<lorcon2/lorcon.h>#"../lorcon.h"#' ruby-lorcon/Lorcon2.h
use ruby && ruby-ng_src_prepare
}
src_configure() {
default_src_configure
use ruby && ruby-ng_src_configure
}
src_compile() {
emake
default_src_compile
if use python; then
LDFLAGS+=" -L${S}/.libs/"
distutils_src_compile
fi
if use ruby; then
cd "${S}"/ruby-lorcon
ruby extconf.rb
sed -i "s#-L\.#-L. -L${S}/.libs -lorcon2 #g" Makefile
emake
fi
use ruby && ruby-ng_src_compile
}
src_install () {
src_install() {
emake DESTDIR="${ED}" install
use python && distutils_src_install
if use ruby; then
cd "${S}"/ruby-lorcon
emake DESTDIR="${ED}" install
fi
use ruby && ruby-ng_src_install
}
src_test() {
:
}
pkg_postinst() {
@ -67,3 +80,16 @@ pkg_postinst() {
pkg_postrm() {
use python && distutils_pkg_postrm
}
each_ruby_configure() {
${RUBY} -C "ruby-lorcon" extconf.rb
sed -i "s#-L\.#-L. -L${WORKDIR}/all/.libs -lorcon2 #g" ruby-lorcon/Makefile
}
each_ruby_compile() {
emake -C ruby-lorcon
}
each_ruby_install() {
DESTDIR="${ED}" emake -C ruby-lorcon install
}