Skip to content

Commit

Permalink
Add dump1090 package with lighttpd support
Browse files Browse the repository at this point in the history
  • Loading branch information
moodytux committed Mar 6, 2021
1 parent 94f5140 commit 1e9a3e4
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions acct-group/dump1090/Manifest
@@ -0,0 +1 @@
EBUILD dump1090-0-r1.ebuild 187 BLAKE2B e29d07425344855e1a1df89d76268ee0dc2e67a60e122f0c004199c09f9cc0259eea9ef52681c7b4ed0a3f688837368acb6cea4d4e492bd4787635c7c3733d42 SHA512 0acedb44bff97a880f5c14899b429d6e1136c9cd9fbb07c7a0b04b3e3e75170b52354b53e949a7a0978f62d2dfd0750b0142dbe387a4e77958770ed65fc332b3
9 changes: 9 additions & 0 deletions acct-group/dump1090/dump1090-0-r1.ebuild
@@ -0,0 +1,9 @@
# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit acct-group

DESCRIPTION="dump1090 program group"
ACCT_GROUP_ID=-1
1 change: 1 addition & 0 deletions acct-user/dump1090/Manifest
@@ -0,0 +1 @@
EBUILD dump1090-0-r1.ebuild 237 BLAKE2B 64defc5b9ae067373432730a9042ea842bc08d091be943cb2191a920795563850a898f4d1de731a10e85db4d12e713208ddfd72b93b2bc38b7999fd7520e813f SHA512 92009457c275cd220611b41cd5c400e7eec8f291005523d7d14e10e1d944ccd598b64f1a1f3ae4de28a3b49eb75ca183235dd75b8ede091f1e0d8dd5fbed813d
11 changes: 11 additions & 0 deletions acct-user/dump1090/dump1090-0-r1.ebuild
@@ -0,0 +1,11 @@
# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit acct-user

DESCRIPTION="dump1090 program user"
ACCT_USER_ID=-1
ACCT_USER_GROUPS=( dump1090 usb )
acct-user_add_deps
4 changes: 4 additions & 0 deletions net-wireless/dump1090/Manifest
@@ -0,0 +1,4 @@
AUX dump1090-tmpfiles 44 BLAKE2B 177e1d54dcf2c60acbd2d1d791ffd367b3e4c37a82b6b1a55f701f0b4bd869c67d38bcc51a861ab627d02f425d412df20a7bf094c9e8cfb63e5d3082b37a81c7 SHA512 7811f705b81b93fab394ad30dab9b3e411a404024771454f037e82f28adca6b1ed67fff67a358b572ddc906044c7bad622f50d713551b9f8cf81245d370e2db5
AUX dump1090.initd-r1 381 BLAKE2B e719c70bc24f03911b0fe99b2e1bda467d5aebfa6245e6e8f69332eae7ad4a0ce13bd78e49934410e1506086af2050e911e0549ced7b2ad6c4c4f6ae41cc18af SHA512 c8c6c9f852897aa6bc02561bb7e523b93720cf28860fae5da8210e2a91902bea2320e880455e94d8738ec19e45aa47e166f3296f7ea009877c30da8548333734
DIST dump1090-4.0.tar.gz 6663754 BLAKE2B bf0a6c8dfd8b2da5ed0e7ae5f7b862c57a54e5d48bc24b29e42ebffec4e0606604fbe4b8502e85df60a3a618568bf9e2eba88e5ad2fdec7fb93043b823435362 SHA512 97dc872e4d0ac8df2f46e17b590e970a62a78baf81e18a9beeb23d37a4401a2e52591ca96cc01e1465b22aa234cf9e88f84a7b0f27d0144b3afeac62f6252c95
EBUILD dump1090-4.0-r1.ebuild 1911 BLAKE2B 463de3a746c3b966ca3163a7cce60d1b2420a3a6bcf490a6496b4dffb149281a83c37db611fa00db211464abef1d5fa61d43ca0d236b3e9d61a362a6a03f6315 SHA512 2e82927e8a852cf2e7e859b07f31a06f7c7178d70ae8e17e6e7c5c40c8b0220bf1e61c42676dcef9f5c3e846a90dc2bd92d51599d6719a469434e8ac5233a39e
88 changes: 88 additions & 0 deletions net-wireless/dump1090/dump1090-4.0-r1.ebuild
@@ -0,0 +1,88 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs readme.gentoo-r1 tmpfiles

DESCRIPTION="Simple Mode S decoder for RTLSDR devices"
HOMEPAGE="https://github.com/flightaware/dump1090"

if [[ ${PV} == *9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/flightaware/${PN}.git"
else
KEYWORDS="amd64 x86"
SRC_URI="https://github.com/flightaware/dump1090/archive/v${PV}.tar.gz -> ${P}.tar.gz"
fi

LICENSE="BSD"
SLOT="0"
IUSE="bladerf +rtlsdr lighttpd"

DEPEND="
sys-libs/ncurses:=[tinfo]
virtual/libusb:1
bladerf? ( net-wireless/bladerf:= )
rtlsdr? ( net-wireless/rtl-sdr:= )
lighttpd? (
www-servers/lighttpd:=
acct-user/dump1090:=
acct-group/dump1090:=
)"
RDEPEND="${DEPEND}"

DISABLE_AUTOFORMATTING="true"
DOC_CONTENTS="
In order to enable lighttpd integration, add:
include \"/usr/share/dump1090-fa/lighttpd.conf\"
onto the end of /etc/lighttpd/lighttpd.conf.
Also, if you don't already have mod_alias enabled, you will
need to enable it in the same file.
"

src_prepare() {
default
sed -i -e 's#-O3 -g -Wall -Wmissing-declarations -Werror -W##' Makefile || die
sed -i -e "s#-lncurses#$($(tc-getPKG_CONFIG) --libs ncurses)#" Makefile || die
}

src_compile() {
emake CC="$(tc-getCC)" \
BLADERF=$(usex bladerf) \
RTLSDR=$(usex rtlsdr)
}

src_install() {
dobin ${PN}
dobin view1090
dodoc README.md
readme.gentoo_create_doc

insinto /usr/share/${PN}-fa/html
doins -r public_html/*

insinto /usr/share/${PN}-fa
doins -r tools

if use lighttpd; then
insinto /usr/share/${PN}-fa
newins debian/lighttpd/89-dump1090-fa.conf lighttpd.conf

newinitd "${FILESDIR}"/dump1090.initd-r1 dump1090

newtmpfiles "${FILESDIR}"/${PN}-tmpfiles ${PN}.conf
fi
}

pkg_postinst() {
if use lighttpd; then
tmpfiles_process /usr/lib/tmpfiles.d/dump1090.conf

readme.gentoo_print_elog
fi
}

1 change: 1 addition & 0 deletions net-wireless/dump1090/files/dump1090-tmpfiles
@@ -0,0 +1 @@
d /run/dump1090-fa 0755 dump1090 dump1090 -
14 changes: 14 additions & 0 deletions net-wireless/dump1090/files/dump1090.initd-r1
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

name="dump1090 Flight Aware Daemon"
command="/usr/bin/dump1090"
command_args="--quiet --net --enable-agc --write-json /run/dump1090-fa/"
command_user="dump1090:dump1090"
pidfile="/run/dump1090-fa.pid"
command_background=true

depend() {
need lighttpd
}

0 comments on commit 1e9a3e4

Please sign in to comment.