[hamradio-commits] [dump1090] 321/373: Initial Debian packaging.
Matthew Ernisse
mernisse-guest at moszumanska.debian.org
Thu Oct 23 14:58:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
mernisse-guest pushed a commit to branch backport
in repository dump1090.
commit f97b6069011d2430b3e492f967ebb9ba1295b7d9
Author: Matthew Ernisse <mernisse at ub3rgeek.net>
Date: Sun Aug 17 03:52:41 2014 +0000
Initial Debian packaging.
---
Makefile | 27 ++-----
debian/changelog | 5 ++
debian/compat | 1 +
debian/control | 14 ++++
debian/copyright | 37 +++++++++
debian/docs | 2 +
debian/dump1090.default | 12 +++
debian/dump1090.dirs | 4 +
debian/dump1090.examples | 2 +
debian/init.d | 164 +++++++++++++++++++++++++++++++++++++++
debian/lintian-overrides | 4 +
debian/patches/00-makefile.patch | 58 ++++++++++++++
debian/patches/series | 1 +
debian/rules | 17 ++++
debian/source/format | 1 +
15 files changed, 327 insertions(+), 22 deletions(-)
diff --git a/Makefile b/Makefile
index c0464c5..6bfe9ee 100644
--- a/Makefile
+++ b/Makefile
@@ -2,22 +2,20 @@
# When building a package or installing otherwise in the system, make
# sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local
#
-
PROGNAME=dump1090
-ifndef PREFIX
-PREFIX=/usr/local
-endif
-
+ifdef PREFIX
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/$(PROGNAME)
EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\"
+endif
CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr`
LIBS=`pkg-config --libs librtlsdr` -lpthread -lm
CC=gcc
-all: dump1090 ppup1090 view1090
+
+all: dump1090 view1090
%.o: %.c
$(CC) $(CFLAGS) $(EXTRACFLAGS) -c $<
@@ -25,23 +23,8 @@ all: dump1090 ppup1090 view1090
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
$(CC) -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
-ppup1090: ppup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
- $(CC) -g -o ppup1090 ppup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o coaa1090.obj $(LIBS) $(LDFLAGS)
-
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
$(CC) -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
clean:
- rm -f *.o dump1090 ppup1090 view1090
-
-install: installbin installhtml
-
-installbin:
- install -m755 dump1090 $(BINDIR)
- install -m755 ppup1090 $(BINDIR)
- install -m755 view1090 $(BINDIR)
-
-installhtml:
- install -d -m 755 $(SHAREDIR)
- cp -R public_html/* $(SHAREDIR)
-
+ rm -f *.o dump1090 view1090
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..d5808dd
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+dump1090 (1.09.0608.14-1) unstable; urgency=low
+
+ * Initial release
+
+ -- Matthew Ernisse <mernisse at ub3rgeek.net> Sat, 16 Aug 2014 20:26:47 +0000
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..10d86cd
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,14 @@
+Source: dump1090
+Section: utils
+Priority: extra
+Maintainer: Matthew Ernisse <mernisse at ub3rgeek.net>
+Build-Depends: debhelper (>= 8.0.0), dpkg-dev (>= 1.16.1~), pkg-config, librtlsdr0-dev
+Standards-Version: 3.9.3
+Homepage: https://github.com/MalcolmRobb/dump1090
+
+Package: dump1090
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, librtlsdr0
+Description: ADS-B decoder software for the Realtek SDR
+ Receive and decode ADS-B and Mode-S traffic via a compatible
+ Realtek software-defined radio module.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..1b687b3
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: dump1090
+Source: https://github.com/MalcolmRobb/dump1090
+
+Files: *
+Copyright: 2009-2013 Salvatore Sanfilippo <antirez at gmail.com>
+ 2013-2014 Malcom Robb
+License: BSD-3-Clause
+
+Files: debian/*
+Copyright: 2014 Matthew Ernisse <mernisse at ub3rgeek.net>
+License: BSD-3-Clause
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..6f77277
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+README.md
+TODO
diff --git a/debian/dump1090.default b/debian/dump1090.default
new file mode 100644
index 0000000..34b25c5
--- /dev/null
+++ b/debian/dump1090.default
@@ -0,0 +1,12 @@
+# Change to "yes" to start the daemon
+RUN="no"
+
+# Set your lattitude and longitiude.
+LAT=""
+LON=""
+
+# Set to your PPM offset if you have calibrated your dongle
+PPM=""
+
+# Additional options that are passed to the daemon.
+DAEMON_ARGS="--net --fix --phase-enhance --enable-agc --net-ro-size 500 --net-ro-rate 5 --quiet"
diff --git a/debian/dump1090.dirs b/debian/dump1090.dirs
new file mode 100644
index 0000000..7faf9e1
--- /dev/null
+++ b/debian/dump1090.dirs
@@ -0,0 +1,4 @@
+usr/bin
+usr/sbin
+usr/share/dump1090/public_html
+
diff --git a/debian/dump1090.examples b/debian/dump1090.examples
new file mode 100644
index 0000000..a03c7f6
--- /dev/null
+++ b/debian/dump1090.examples
@@ -0,0 +1,2 @@
+tools/*
+testfiles/* testfiles
diff --git a/debian/init.d b/debian/init.d
new file mode 100644
index 0000000..49e53d4
--- /dev/null
+++ b/debian/init.d
@@ -0,0 +1,164 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: dump1090
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: ADS-B decoder daemon for the Realtek SDR
+# Description: Decodes and displays or transmits to remote
+# servers ADS-B and Mode-S traffic using the
+# Realtek software defined radio USB dongle.
+### END INIT INFO
+
+# Author: Matthew Ernisse <mernisse at ub3rgeek.net>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+RUN=no
+DESC=dump1090 # Introduce a short description here
+NAME=dump1090 # Introduce the short server's name here
+DAEMON=/usr/sbin/dump1090 # Introduce the server's location here
+DAEMON_ARGS="" # Arguments to run the daemon with
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Exit if we aren't configured to run
+if [ "$RUN" = "no" ]; then
+ exit 0
+fi
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+# Handle default options
+if [ -n "$LAT" ]; then
+ DAEMON_ARGS="$DAEMON_ARGS --lat $LAT"
+fi
+
+if [ -n "$LON" ]; then
+ DAEMON_ARGS="$DAEMON_ARGS --lon $LON"
+fi
+
+if [ -n "$PPM" ]; then
+ DAEMON_ARGS="$DAEMON_ARGS --ppm $PPM"
+fi
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+ # Return
+ # 0 if daemon has been started
+ # 1 if daemon was already running
+ # 2 if daemon could not be started
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+ || return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
+ --background -- $DAEMON_ARGS \
+ || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+ # Return
+ # 0 if daemon has been stopped
+ # 1 if daemon was already stopped
+ # 2 if daemon could not be stopped
+ # other if a failure occurred
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ # Many daemons don't delete their pidfiles when they exit.
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+ #reload|force-reload)
+ #
+ # If do_reload() is not implemented then leave this commented out
+ # and leave 'force-reload' as an alias for 'restart'.
+ #
+ #log_daemon_msg "Reloading $DESC" "$NAME"
+ #do_reload
+ #log_end_msg $?
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented then remove the
+ # 'force-reload' alias
+ #
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+:
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
new file mode 100644
index 0000000..0f08d1a
--- /dev/null
+++ b/debian/lintian-overrides
@@ -0,0 +1,4 @@
+binary-without-manpage usr/sbin/dump1090
+binary-without-manpage usr/sbin/ppup1090
+binary-without-manpage usr/bin/view1090
+new-package-should-close-itp-bug
diff --git a/debian/patches/00-makefile.patch b/debian/patches/00-makefile.patch
new file mode 100644
index 0000000..e2e5c9e
--- /dev/null
+++ b/debian/patches/00-makefile.patch
@@ -0,0 +1,58 @@
+--- a/Makefile
++++ b/Makefile
+@@ -4,18 +4,20 @@
+ #
+ PROGNAME=dump1090
+
+-ifdef PREFIX
+-BINDIR=$(PREFIX)/bin
+-SHAREDIR=$(PREFIX)/share/$(PROGNAME)
+-EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\"
+-endif
+-
+-CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr`
+-LIBS=`pkg-config --libs librtlsdr` -lpthread -lm
++BINDIR=$(DESTDIR)/usr/bin
++SBINDIR=$(DESTDIR)/usr/sbin
++SHAREDIR=$(DESTDIR)/usr/share/$(PROGNAME)
++EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)/public_html\"
++
++CFLAGS=-O2 -g -Wall -W $(shell pkg-config --cflags librtlsdr)
++CFLAGS += $(shell dpkg-buildflags --get CFLAGS)
++CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
++CFLAGS += $(shell dpkg-buildflags --get CXXFLAGS)
++LIBS=$(shell pkg-config --libs librtlsdr) -lpthread -lm
++LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
+ CC=gcc
+
+-
+-all: dump1090 view1090
++all: dump1090 ppup1090 view1090
+
+ %.o: %.c
+ $(CC) $(CFLAGS) $(EXTRACFLAGS) -c $<
+@@ -23,8 +25,23 @@
+ dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
+ $(CC) -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
+
++ppup1090: ppup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
++ $(CC) -g -o ppup1090 ppup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o coaa1090.obj $(LIBS) $(LDFLAGS)
++
+ view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
+ $(CC) -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
+
+ clean:
+- rm -f *.o dump1090 view1090
++ rm -f *.o dump1090 ppup1090 view1090
++
++install: installbin installhtml
++
++installbin:
++ install -m755 dump1090 $(SBINDIR)
++ install -m755 ppup1090 $(SBINDIR)
++ install -m755 view1090 $(BINDIR)
++
++installhtml:
++ install -d -m 755 $(SHAREDIR)/public_html
++ cp -R public_html/* $(SHAREDIR)/public_html
++
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..60f8f85
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00-makefile.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..999968b
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build:
+ dh_testdir
+ dh_auto_build
+
+%:
+ dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git
More information about the pkg-hamradio-commits
mailing list