Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

chore: update debian package #77

Merged
merged 1 commit into from
Jul 17, 2018
Merged
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
2 changes: 1 addition & 1 deletion debian/beamium.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="beamium"
NAME=beamium
DAEMON=/usr/sbin/$NAME
DAEMON=/usr/bin/$NAME
PID_FILE=/var/run/$NAME.pid
USER="beamium"
GROUP="beamium"
Expand Down
2 changes: 1 addition & 1 deletion debian/beamium.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
debug/beamium usr/sbin
release/beamium usr/bin
etc/beamium/config.yaml
6 changes: 5 additions & 1 deletion debian/beamium.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ case "$1" in
configure)
chown -R beamium:beamium /var/log/beamium
chown -R beamium:beamium /opt/beamium
# fix rights on logrotate
if [ -f "/etc/logrotate.d/$SERVICE" ]; then
chown root:root /etc/logrotate.d/$SERVICE
fi
registerService
STATUS=$(statusService) || true
if [ "$STATUS" = "$SERVICE is running." ] ; then
echo "$SERVICE is running: not restarting it."
echo "$SERVICE is running: not restarting it."
else
startService
fi
Expand Down
15 changes: 15 additions & 0 deletions debian/beamium.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

SERVICE=beamium
PID_FILE=/var/run/$SERVICE.pid

case "$1" in
install)
# create a beamium group and user
Expand All @@ -11,6 +14,18 @@ case "$1" in
;;

upgrade)
# remove old sysV if present
if systemctl status >/dev/null 2>&1; then
if [ -x "/etc/init.d/$SERVICE" ]; then
update-rc.d $SERVICE remove || true
fi
# stop old process
if [ -f "$PID_FILE" ]; then
pkill -9 --pidfile "$PID_FILE"
rm -f $PID_FILE
deb-systemd-invoke stop $SERVICE.service
fi
fi
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion debian/beamium.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target

[Service]
EnvironmentFile=-/etc/default/beamium
ExecStart=/usr/sbin/beamium --config=/etc/beamium/config.yaml
ExecStart=/usr/bin/beamium --config=/etc/beamium/config.yaml
Restart=on-failure
User=beamium
Group=beamium
Expand Down
6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Source: beamium
Section: default
Priority: extra
Maintainer: Aurélien Nephtali <aurelien.nephtali@corp.ovh.com>
Build-Depends: debhelper (>= 8.0.0), git, pkg-config, libssl-dev, lsb-release
Maintainer: Kevin GEORGES <kevin.georges@corp.ovh.com>
Build-Depends: debhelper (>= 8.0.0), dh-systemd (>= 1.5), git, pkg-config, libssl-dev, lsb-release
Standards-Version: 3.9.6
Homepage: https://github.com/runabove/beamium
Homepage: https://github.com/ovh/beamium

Package: beamium
Architecture: i386 amd64
Expand Down
8 changes: 7 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#export DH_VERBOSE=1

BUILD_DIR=$(CURDIR)/debian/tmp
DISTRIBUTION = $(shell lsb_release -cs)
VERSION = $(shell cat Cargo.toml | grep version | head -1 | awk -F "\"" '{print $$2}')
PACKAGEVERSION = $(VERSION)-$(DISTRIBUTION)
export CARGO_TARGET_DIR=$(BUILD_DIR)

DEBIAN_VERSION = $(shell lsb_release -rs | cut -d . -f 1)
Expand All @@ -21,7 +24,7 @@ endif
dh $@ ${DH_ARGS}

override_dh_auto_build:
cargo build
cargo build --release

override_dh_install:
mkdir -p $(BUILD_DIR)/etc/beamium
Expand All @@ -30,3 +33,6 @@ override_dh_install:

override_dh_prep:
dh_prep -Xdebian/tmp

override_dh_gencontrol:
dh_gencontrol -- -v$(PACKAGEVERSION)