From 929b68010b357893a3d2e4515e1d6516f332cf98 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 6 Jun 2016 00:14:48 +0300 Subject: Write maintainer scripts --- dh_runit | 3 ++- postinst-runit | 23 +++++++++++++++++++++++ prerm-runit | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/dh_runit b/dh_runit index dec7c5a..2e3414a 100755 --- a/dh_runit +++ b/dh_runit @@ -90,7 +90,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { doit('cp', '-r', $path, "$sv_dir/$name"); } if ($enable -eq 'enable' && !$DH{NO_ENABLE}) { + autoscript($pkg, 'postinst', 'postinst-runit', "s/#NAME#/$name/"); } + autoscript($pkg, 'prerm', 'prerm-runit', "s/#NAME#/$name/"); } } - diff --git a/postinst-runit b/postinst-runit index e69de29..3a51832 100644 --- a/postinst-runit +++ b/postinst-runit @@ -0,0 +1,23 @@ +SV_ABS_DIR=/var/lib/runit/service +SV_DIR=/etc/service +mkdir -p "$SV_ABS_DIR" +if [ ! -e "$SV_DIR" ] ; then + ln -s "$SV_ABS_DIR" "$SV_DIR" +fi + +if [ "$(readlink -f "$SV_DIR")" != "$SV_ABS_DIR" ] ; then + cat <