Skip to content

Commit

Permalink
debian: Install systemd units
Browse files Browse the repository at this point in the history
  • Loading branch information
kerel-fs committed Feb 16, 2017
1 parent f8fb805 commit 6b6be06
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Source: rtlsdr-ogn
Section: misc
Priority: optional
Maintainer: Fabian P. Schmidt <[email protected]>
Build-Depends: debhelper (>= 9), libusb-1.0-0-dev, librtlsdr-dev, libconfig-dev, libfftw3-dev, libjpeg-dev
Build-Depends: debhelper (>= 9), dh-systemd, libusb-1.0-0-dev, librtlsdr-dev, libconfig-dev, libfftw3-dev, libjpeg-dev
Standards-Version: 3.9.6
Homepage: http://glidernet.org

Package: rtlsdr-ogn
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, librtlsdr0
Depends: ${shlibs:Depends}, ${misc:Depends}, librtlsdr0, adduser
Description: Open Glider Network receiver for rtl-sdr
rtlsdr-ogn is a software defined radio receiver (SDR) software for the
Open Glider Network, based on the famous rtl-sdr radio receiver tools.
Expand Down
3 changes: 3 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ ogn-rf usr/bin
x64-bin/ogn-decode usr/bin
gsm_scan usr/bin
etc/rtlsdr-ogn.conf
scripts/ogn-rf.service lib/systemd/system
scripts/ogn-decode.socket lib/systemd/system
scripts/ogn-decode.service lib/systemd/system
28 changes: 28 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
# postinst script for rtlsdr-ogn

set -e


case "$1" in
configure)
if ! getent group ogn >/dev/null; then
addgroup --quiet --system ogn
fi
if ! getent passwd ogn >/dev/null; then
adduser --quiet --system --ingroup ogn --no-create-home ogn
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

exit 0
12 changes: 11 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
export DH_VERBOSE = 1

%:
dh $@
dh $@ --with systemd

override_dh_installinit:
dh_systemd_enable --package rtlsdr-ogn --name=ogn-rf.service ogn-rf.service
dh_systemd_enable --package rtlsdr-ogn --name=ogn-decode.service ogn-decode.service
dh_systemd_enable --package rtlsdr-ogn --name=ogn-decode.socket ogn-decode.socket
dh_installinit --package rtlsdr-ogn --no-start --noscripts

override_dh_systemd_start:
dh_systemd_start --package rtlsdr-ogn ogn-rf.service
dh_systemd_start --package rtlsdr-ogn ogn-decode.service

0 comments on commit 6b6be06

Please sign in to comment.