blue_hydra: nearly correct ebuild, deps are missing a bit but specified better

This commit is contained in:
Rick Farina (Zero_Chaos) 2016-07-25 16:50:47 -04:00
parent 92a6355d97
commit c26a37a582
No known key found for this signature in database
GPG key ID: A5DD1427DD11F94A

View file

@ -8,7 +8,7 @@ DESCRIPTION="bluetooth discovery service built on top of bluez"
HOMEPAGE="https://github.com/pwnieexpress/blue_hydra"
SRC_URI=""
LICENSE="BSD-3"
LICENSE="BSD-4"
SLOT="0"
USE_RUBY="ruby21"
inherit git-r3 ruby-ng
@ -16,16 +16,21 @@ inherit git-r3 ruby-ng
KEYWORDS=""
EGIT_REPO_URI="https://github.com/pwnieexpress/blue_hydra.git"
EGIT_CHECKOUT_DIR="${WORKDIR}"/all
IUSE="ubertooth"
IUSE="development ubertooth"
DEPEND=""
PDEPEND="dev-python/dbus-python
net-wireless/bluez[test-programs]
ubertooth? ( net-wireless/ubertooth )"
ruby_add_bdepend "dev-ruby/bundler"
ruby_add_rdepend "dev-ruby/dm-core
dev-ruby/dm-sqlite-adapter"
test_deps="dev-ruby/rake dev-ruby/rspec:*"
ruby_add_bdepend "dev-ruby/bundler
test? ( ${test_deps} )"
ruby_add_rdepend "dev-ruby/dm-migrations
dev-ruby/dm-sqlite-adapter
dev-ruby/dm-timestamps
development? ( dev-ruby/pry
${test_deps} )"
#RUBY_S="${WORKDIR}/${P}"
@ -37,11 +42,26 @@ all_ruby_unpack () {
fi
}
#each_ruby_prepare() {
# sed -e \
# "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" \
# -i "bin/blue_hydra" || die "Conversion of shebang in 'bin/blue_hydra' failed"
#}
all_ruby_prepare() {
[ -f Gemfile.lock ] && rm Gemfile.lock
if ! use development; then
sed -i -e "/^group :development do/,/^end$/d" Gemfile || die
fi
if ! use test; then
sed -i -e "/^group :test do/,/^end$/d" Gemfile || die
fi
if ! use test && ! use development; then
sed -i -e "/^group :development, :test do/,/^end$/d" Gemfile || die
fi
}
each_ruby_prepare() {
if [ -f Gemfile ]
then
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die
fi
}
each_ruby_test() {
${RUBY} -S rspec || die
@ -64,10 +84,7 @@ each_ruby_install() {
cat <<-EOF > "${ED}"/usr/sbin/blue_hydra
#! /bin/sh
cd /usr/$(get_libdir)/${PN}
if [ -f Gemfile.lock ]; then
rm Gemfile.lock
fi
${RUBY} -S bundle exec ./bin/blue_hydra \$@
exec ${RUBY} -S ./bin/blue_hydra \$@
EOF
fperms +x /usr/sbin/blue_hydra
}