Update packaging to build a -mutability package.

This commit is contained in:
Oliver Jowett 2014-12-06 21:47:46 +00:00
parent b7562c302a
commit b4b1c0b920
11 changed files with 67 additions and 38 deletions

15
debian/changelog vendored
View file

@ -1,14 +1,5 @@
dump1090-mr (1.08.2302.14+1-2) unstable; urgency=medium dump1090-mutability (1.08.2302.14+1-mu-1) UNRELEASED; urgency=medium
* Pass --name / --user to start-stop-daemon when starting * Initial release.
* Log to /var/log/dump1090-mr.log (configurable via LOGFILE)
* Log stats once an hour by default (configurable via STATS_INTERVAL)
* Include a logrotate configuration
-- Oliver Jowett <oliver@mutability.co.uk> Sat, 06 Dec 2014 18:37:12 +0000 -- Oliver Jowett <oliver@mutability.co.uk> Sat, 06 Dec 2014 19:44:44 +0000
dump1090-mr (1.08.2302.14+1-1) unstable; urgency=medium
* Initial package release.
-- Oliver Jowett <oliver@mutability.co.uk> Fri, 05 Dec 2014 22:55:41 +0000

13
debian/control vendored
View file

@ -1,13 +1,13 @@
Source: dump1090-mr Source: dump1090-mutability
Section: embedded Section: embedded
Priority: extra Priority: extra
Maintainer: Oliver Jowett <oliver@mutability.co.uk> Maintainer: Oliver Jowett <oliver@mutability.co.uk>
Build-Depends: debhelper(>=8), net-tools, librtlsdr-dev Build-Depends: debhelper(>=8), librtlsdr-dev
Standards-Version: 3.9.3 Standards-Version: 3.9.3
Homepage: https://github.com/MalcolmRobb/dump1090 Homepage: https://github.com/mutability/dump1090
Vcs-Git: https://github.com/mutability/dump1090.git -b mr-pi-package Vcs-Git: https://github.com/mutability/dump1090.git
Package: dump1090-mr Package: dump1090-mutability
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, net-tools, adduser Depends: ${shlibs:Depends}, ${misc:Depends}, net-tools, adduser
Description: ADS-B Ground Station System for RTL-SDR Description: ADS-B Ground Station System for RTL-SDR
@ -17,4 +17,5 @@ Description: ADS-B Ground Station System for RTL-SDR
Includes a mini-webserver that you can access to see aircraft in the vicinity Includes a mini-webserver that you can access to see aircraft in the vicinity
of your receiver. of your receiver.
. .
This is a packaging of MalcomRobb's fork of the original dump1090 version. This is a packaging of the "mutability" fork of dump1090 that includes
sampling at 2.4MHz and other improvements.

6
debian/copyright vendored
View file

@ -1,10 +1,10 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dump1090 Upstream-Name: dump1090
Upstream-Contact: https://github.com/MalcolmRobb Upstream-Contact: Oliver Jowett <oliver@mutability.co.uk>
Source: https://github.com/MalcolmRobb/dump1090 Source: https://github.com/mutability/dump1090
Files: * Files: *
Copyright: Salvatore Sanfilippo, Malcom Robb and other contributors. Copyright: Salvatore Sanfilippo, Malcom Robb, Oliver Jowett and other contributors.
License: BSD-3-Clause License: BSD-3-Clause
Files: debian/* Files: debian/*

View file

@ -1 +0,0 @@
public_html/* usr/share/dump1090-mr

View file

@ -1,4 +1,4 @@
# Defaults for dump1090-mr # Defaults for dump1090-mutability
# This is a POSIX shell fragment # This is a POSIX shell fragment
# Set to "yes" to start dump1090 on boot. # Set to "yes" to start dump1090 on boot.
@ -8,7 +8,7 @@ START_DUMP1090="no"
DUMP1090_USER="dump1090" DUMP1090_USER="dump1090"
# Logfile to log to # Logfile to log to
#LOGFILE="/var/log/dump1090-mr.log" #LOGFILE="/var/log/dump1090-mutability.log"
# #
# The following options are all optional - defaults if not provided are # The following options are all optional - defaults if not provided are
@ -31,6 +31,9 @@ DUMP1090_USER="dump1090"
# RTLSDR frequency correction in PPM # RTLSDR frequency correction in PPM
#PPM=0 #PPM=0
# If yes, enable sampling at 2.4MHz. Otherwise, 2.0MHz is used.
#OVERSAMPLE=no
# #
# Decoding options # Decoding options
# #
@ -79,8 +82,8 @@ DUMP1090_USER="dump1090"
# Minimum output buffer size per write, in bytes. # Minimum output buffer size per write, in bytes.
#NET_OUTPUT_SIZE=5 #NET_OUTPUT_SIZE=5
# Maximum buffering time before writing. In units of approx 64ms (don't ask..). # Maximum buffering time before writing, in seconds.
#NET_OUTPUT_RATE=5 #NET_OUTPUT_INTERVAL=1
# TCP buffer size order. Power-of-two based - buffer size is 2^(n+16). # TCP buffer size order. Power-of-two based - buffer size is 2^(n+16).
#NET_BUFFER=0 #NET_BUFFER=0
@ -95,5 +98,11 @@ DUMP1090_USER="dump1090"
# Interval (in seconds) between logging stats to the logfile. 0 disables. # Interval (in seconds) between logging stats to the logfile. 0 disables.
#STATS_INTERVAL=3600 #STATS_INTERVAL=3600
# Path to write json state to (for use with an external webserver). Blank disables.
#JSON_DIR=/run/dump1090-mutability
# Interval between writing json state (in seconds). 0 disables.
#JSON_INTERVAL=1
# Additional options that are passed to the Daemon. # Additional options that are passed to the Daemon.
#EXTRA_ARGS="" #EXTRA_ARGS=""

View file

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: dump1090-mr # Provides: dump1090-mutability
# Required-Start: $remote_fs # Required-Start: $remote_fs
# Required-Stop: $remote_fs # Required-Stop: $remote_fs
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: dump1090 daemon (MalcolmRobb variant) # Short-Description: dump1090 daemon (mutability variant)
# Description: Receives ADS-B messages from a RTLSDR dongle # Description: Receives ADS-B messages from a RTLSDR dongle
# and makes them available to other applications via # and makes them available to other applications via
# a variety of network protocols. # a variety of network protocols.
@ -15,8 +15,8 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script # PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="dump1090-mr daemon" DESC="dump1090-mutability daemon"
NAME=dump1090-mr NAME=dump1090-mutability
DAEMON=/usr/bin/$NAME DAEMON=/usr/bin/$NAME
ARGS="--quiet" ARGS="--quiet"
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
@ -32,6 +32,7 @@ LOGFILE=/var/log/$NAME.log
DEVICE=0 DEVICE=0
GAIN=max GAIN=max
PPM=0 PPM=0
OVERSAMPLE=no
FIX_CRC=no FIX_CRC=no
PHASE_ENHANCE=no PHASE_ENHANCE=no
AGGRESSIVE=no AGGRESSIVE=no
@ -45,7 +46,7 @@ BEAST_INPUT_PORT=30004
BEAST_OUTPUT_PORT=30005 BEAST_OUTPUT_PORT=30005
NET_HEARTBEAT=60 NET_HEARTBEAT=60
NET_OUTPUT_SIZE=5 NET_OUTPUT_SIZE=5
NET_OUTPUT_RATE=5 NET_OUTPUT_INTERVAL=1
NET_BUFFER=0 NET_BUFFER=0
BIND_ADDRESS= BIND_ADDRESS=
STATS_INTERVAL=3600 STATS_INTERVAL=3600
@ -68,6 +69,7 @@ case "x$GAIN" in
*) ARGS="$ARGS --gain $GAIN" ;; *) ARGS="$ARGS --gain $GAIN" ;;
esac esac
if [ "x$PPM" != "x0" ]; then ARGS="$ARGS --ppm $PPM"; fi if [ "x$PPM" != "x0" ]; then ARGS="$ARGS --ppm $PPM"; fi
if [ "x$OVERSAMPLE" != "x0" ]; then ARGS="$ARGS --oversample"; fi
# decoder: # decoder:
if [ "x$FIX_CRC" = "xyes" ]; then ARGS="$ARGS --fix"; fi if [ "x$FIX_CRC" = "xyes" ]; then ARGS="$ARGS --fix"; fi
@ -85,12 +87,14 @@ if [ "x$BEAST_INPUT_PORT" != "x30004" ]; then ARGS="$ARGS --net-bi-port $BEAST_I
if [ "x$BEAST_OUTPUT_PORT" != "x30005" ]; then ARGS="$ARGS --net-bo-port $BEAST_OUTPUT_PORT"; fi if [ "x$BEAST_OUTPUT_PORT" != "x30005" ]; then ARGS="$ARGS --net-bo-port $BEAST_OUTPUT_PORT"; fi
if [ "x$NET_HEARTBEAT" != "x60" ]; then ARGS="$ARGS --net-heartbeat $NET_HEARTBEAT"; fi if [ "x$NET_HEARTBEAT" != "x60" ]; then ARGS="$ARGS --net-heartbeat $NET_HEARTBEAT"; fi
if [ "x$NET_OUTPUT_SIZE" != "x0" ]; then ARGS="$ARGS --net-ro-size $NET_OUTPUT_SIZE"; fi if [ "x$NET_OUTPUT_SIZE" != "x0" ]; then ARGS="$ARGS --net-ro-size $NET_OUTPUT_SIZE"; fi
if [ "x$NET_OUTPUT_RATE" != "x0" ]; then ARGS="$ARGS --net-ro-rate $NET_OUTPUT_RATE"; fi if [ "x$NET_OUTPUT_INTERVAL" != "x0" ]; then ARGS="$ARGS --net-ro-interval $NET_OUTPUT_INTERVAL"; fi
if [ "x$NET_BUFFER" != "x0" ]; then ARGS="$ARGS --net-buffer $NET_BUFFER"; fi if [ "x$NET_BUFFER" != "x0" ]; then ARGS="$ARGS --net-buffer $NET_BUFFER"; fi
if [ -n "$BIND_ADDRESS" ]; then ARGS="$ARGS --net-bind-address $BIND_ADDRESS"; fi if [ -n "$BIND_ADDRESS" ]; then ARGS="$ARGS --net-bind-address $BIND_ADDRESS"; fi
# misc: # misc:
if [ "x$STATS_INTERVAL" != "x0" ]; then ARGS="$ARGS --stats-every $STATS_INTERVAL"; fi if [ "x$STATS_INTERVAL" != "x0" ]; then ARGS="$ARGS --stats-every $STATS_INTERVAL"; fi
if [ "x$JSON_DIR" != "x" ]; then ARGS="$ARGS --write-json $JSON_DIR"; fi
if [ "x$JSON_INTERVAL" != "x1" ]; then ARGS="$ARGS --write-json-every $JSON_INTERVAL"; fi
if [ -n "$EXTRA_ARGS" ]; then ARGS="$ARGS $EXTRA_ARGS"; fi if [ -n "$EXTRA_ARGS" ]; then ARGS="$ARGS $EXTRA_ARGS"; fi
# Load the VERBOSE setting and other rcS variables # Load the VERBOSE setting and other rcS variables
@ -118,6 +122,16 @@ do_start()
start-stop-daemon --start --quiet --pidfile $PIDFILE --name $NAME --user $DUMP1090_USER --exec $DAEMON --test > /dev/null \ start-stop-daemon --start --quiet --pidfile $PIDFILE --name $NAME --user $DUMP1090_USER --exec $DAEMON --test > /dev/null \
|| return 1 || return 1
# create JSON_DIR with the appropriate permissions
# (it is on /run by default, so will be lost on reboot)
if [ "x$JSON_DIR" != "x" ]; then
if [ ! -e $JSON_DIR ]; then
(mkdir $JSON_DIR && chmod 0755 $JSON_DIR && chown $DUMP1090_USER $JSON_DIR) || log_warning_msg "Failed to create $JSON_DIR"
fi
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE --name $NAME --user $DUMP1090_USER --chuid $DUMP1090_USER --make-pidfile --background --no-close --exec $DAEMON -- \ start-stop-daemon --start --quiet --pidfile $PIDFILE --name $NAME --user $DUMP1090_USER --chuid $DUMP1090_USER --make-pidfile --background --no-close --exec $DAEMON -- \
$ARGS >>$LOGFILE 2>&1 \ $ARGS >>$LOGFILE 2>&1 \
|| return 2 || return 2

2
debian/dump1090-mutability.install vendored Normal file
View file

@ -0,0 +1,2 @@
public_html/* usr/share/dump1090-mutability
debian/lighttpd/* etc/lighttpd/conf-available

View file

@ -1,4 +1,4 @@
/var/log/dump1090-mr.log { /var/log/dump1090-mutability.log {
weekly weekly
rotate 4 rotate 4
copytruncate copytruncate

View file

@ -20,7 +20,7 @@ set -e
case "$1" in case "$1" in
configure) configure)
adduser --system --home /usr/share/dump1090-mr --no-create-home --quiet dump1090 adduser --system --home /usr/share/dump1090-mutability --no-create-home --quiet dump1090
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

13
debian/lighttpd/90-dump1090.conf vendored Normal file
View file

@ -0,0 +1,13 @@
# Allows access to the static files that provide the dump1090 map view,
# and also to the dynamically-generated json parts that contain aircraft
# data and are periodically written by the dump1090 daemon.
url.redirect += (
"^/dump1090/$" => "/dump1090/gmap.html",
"^/dump1090$" => "/dump1090/gmap.html"
)
alias.url += (
"/dump1090/data/" => "/run/dump1090-mutability/",
"/dump1090/" => "/usr/share/dump1090-mutability/"
)

8
debian/rules vendored
View file

@ -15,13 +15,13 @@ DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildflags.mk
override_dh_auto_build: override_dh_auto_build:
dh_auto_build -- 'EXTRACFLAGS=-DHTMLPATH=\"/usr/share/dump1090-mr\"' dh_auto_build -- 'EXTRACFLAGS=-DHTMLPATH=\"/usr/share/dump1090-mutability\"'
override_dh_install: override_dh_install:
dh_install dh_install
install -d debian/dump1090-mr/usr/bin install -d debian/dump1090-mutability/usr/bin
cp -a dump1090 debian/dump1090-mr/usr/bin/dump1090-mr cp -a dump1090 debian/dump1090-mutability/usr/bin/dump1090-mutability
cp -a view1090 debian/dump1090-mr/usr/bin/view1090-mr cp -a view1090 debian/dump1090-mutability/usr/bin/view1090-mutability
%: %:
dh $@ dh $@