Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
/config.status
/config.sub
/configure
/debian/daliserver.debhelper.log
/debian/daliserver.postinst.debhelper
/debian/daliserver.postrm.debhelper
/debian/daliserver.prerm.debhelper
/debian/daliserver.substvars
/debian/.debhelper/
/debian/*.debhelper.log
/debian/*.debhelper
/debian/*.substvars
/debian/daliserver/
/debian/daliserver-upstart/
/debian/daliserver-systemd/
/debian/files
/debian/autoreconf.*
/debian/.debhelper
/debian/debhelper-build-stamp
/depcomp
/install-sh
/missing
Expand Down
38 changes: 32 additions & 6 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,35 @@ Vcs-Browser: https://github.com/onitake/daliserver
Package: daliserver
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base
Description: Command multiplexing server for DALI lighting buses
Exposes a DALI (Digital Addressable Lighting Interface) bus to the
local machine by interfacing with the Tridonic DALI USB adapter.
.
Multiple clients can connect to the multiplexer to send commands to and
receive responses from devices connected to the bus.
Conflicts: daliserver-upstart, daliserver-systemd
Description: daliserver
daliserver is a command multiplexing server for the Tridonic DALI USB adapter,
allowing access to a DALI bus from any USB-equipped computer that supports
libusb. This package includes init scripts for sysvinit-based systems, or
systems that include a sysvinit compatibility layer. Only one DALI USB
adapter is supported at a time by this package, and adapters cannot be
hotplugged.

Package: daliserver-upstart
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, upstart
Conflicts: daliserver, daliserver-systemd
Replaces: daliserver
Description: daliserver-upstart
daliserver is a command multiplexing server for the Tridonic DALI USB adapter,
allowing access to a DALI bus from any USB-equipped computer that supports
libusb. This package includes init scripts for upstart-based systems.
Multiple simultaneous DALI USB adapters are supported, and adapters can
be hotplugged.

Package: daliserver-systemd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, systemd (>= 236)
Conflicts: daliserver, daliserver-upstart
Replaces: daliserver
Description: daliserver
daliserver is a command multiplexing server for the Tridonic DALI USB adapter,
allowing access to a DALI bus from any USB-equipped computer that supports
libusb. This package includes init scripts for systemd-based systems.
Multiple simultaneous DALI USB adapters are supported, and adapters can
be hotplugged.
12 changes: 12 additions & 0 deletions debian/daliserver-systemd-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

DEVPATH=/"$(/bin/systemd-escape --unescape ${1})"
BUSNUM=$(cat ${DEVPATH}/busnum)
DEVNUM=$(cat ${DEVPATH}/devnum)
ID_SERIAL_SHORT=$(cat ${DEVPATH}/serial)

source /etc/default/daliserver-systemd

exec /usr/bin/daliserver $DALISERVER_OPTS -u $BUSNUM:$DEVNUM
12 changes: 12 additions & 0 deletions debian/daliserver-systemd.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Additional options for daliserver
# -n enables testing mode without USB connectivity
# -l sets the listening address (use 0.0.0.0 to listen on all interfaces)
# -p changes the port
# -f sets the log file name
DALISERVER_OPTS="-f /var/log/daliserver.log"

# Options set based on serial number of DALI USB for -systemd package variant:
case "$ID_SERIAL_SHORT" in
# 000030A1) DALISERVER_OPTS="-p 55826 -f /var/log/daliserver-cellar.log" ;;
# 0000249A) DALISERVER_OPTS="-p 55827 -f /var/log/daliserver-groundfloor.log" ;;
esac
2 changes: 2 additions & 0 deletions debian/daliserver-systemd.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debian/daliserver-systemd@.service lib/systemd/system
debian/daliserver-systemd-start usr/lib/daliserver-systemd/
5 changes: 5 additions & 0 deletions debian/daliserver-systemd.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
5 changes: 5 additions & 0 deletions debian/daliserver-systemd.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
1 change: 1 addition & 0 deletions debian/daliserver-systemd.udev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="17b5", ATTR{idProduct}=="0020", TAG+="systemd", ENV{SYSTEMD_WANTS}="daliserver-systemd@.service"
7 changes: 7 additions & 0 deletions debian/daliserver-systemd@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Command multiplexing server for Tridonic DALI USB on %i
BindsTo=%i.device
After=%i.device network.target

[Service]
ExecStart=/usr/lib/daliserver-systemd/daliserver-systemd-start %i
12 changes: 12 additions & 0 deletions debian/daliserver-upstart.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Additional options for daliserver
# -n enables testing mode without USB connectivity
# -l sets the listening address (use 0.0.0.0 to listen on all interfaces)
# -p changes the port
# -f sets the log file name
DALISERVER_OPTS="-f /var/log/daliserver.log"

# Options set based on serial number of DALI USB for -upstart package variant:
case "$ID_SERIAL_SHORT" in
# 000030A1) DALISERVER_OPTS="-p 55826 -f /var/log/daliserver-cellar.log" ;;
# 0000249A) DALISERVER_OPTS="-p 55827 -f /var/log/daliserver-groundfloor.log" ;;
esac
23 changes: 23 additions & 0 deletions debian/daliserver-upstart.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# daliserver
#
# daliserver is a command multiplexing server for the Tridonic DALI
# USB adapter, allowing access to a DALI bus from any USB-equipped
# computer that supports libusb.

description "Command multiplexing server for Tridonic DALI USB"
author "Gregor Riepl <onitake@gmail.com>"

start on usb-device-added ID_MODEL_ID='0020' ID_VENDOR_ID='17b5'
stop on usb-device-removed ID_MODEL_ID='0020' ID_VENDOR_ID='17b5'

instance daliserver:$BUSNUM:$DEVNUM

respawn

# The device serial number is in ID_SERIAL_SHORT; this can be
# used in /etc/default/daliserver to set options per device.

script
. /etc/default/daliserver-upstart
exec /usr/bin/daliserver $DALISERVER_OPTS -u $BUSNUM:$DEVNUM
end script
9 changes: 9 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
dh $@ --with autoreconf

override_dh_auto_install:
dh_auto_install -p daliserver --destdir debian/daliserver
dh_auto_install -p daliserver-upstart --destdir debian/daliserver-upstart
dh_auto_install -p daliserver-systemd --destdir debian/daliserver-systemd

override_dh_installinit:
dh_installinit -p daliserver
dh_installinit -p daliserver-upstart -p daliserver-systemd --no-start