diff --git a/data/dpkg/apt.conf.d/99nymea b/data/dpkg/apt.conf.d/99nymea deleted file mode 100644 index d85a9b2f..00000000 --- a/data/dpkg/apt.conf.d/99nymea +++ /dev/null @@ -1,7 +0,0 @@ -# nymea hook to restart nymead after upgrades that change nymea plugins or libraries - -DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; }; -DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1"; - -DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; }; - diff --git a/debian/nymead.install.in b/debian/nymead.install.in index 2fe928e4..60d6ea4d 100644 --- a/debian/nymead.install.in +++ b/debian/nymead.install.in @@ -5,5 +5,4 @@ usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1.0.0 data/systemd/nymead.service /lib/systemd/system/ data/logrotate/nymead /etc/logrotate.d/ data/dbus-1/io.guh.nymead.conf /etc/dbus-1/system.d/ -data/dpkg/apt.conf.d/99nymea /etc/apt/apt.conf.d/ data/dpkg/nymea-upgrade-helper /usr/libexec/ diff --git a/debian/nymead.postinst b/debian/nymead.postinst index 9aeb59f6..9f3d0304 100755 --- a/debian/nymead.postinst +++ b/debian/nymead.postinst @@ -29,6 +29,13 @@ else echo "Failed to set raw socket network capabilities for nymead. Network device discovery will not be available for non root users." fi +# nymea hook to restart nymead after upgrades that change nymea plugins or libraries +cat < /etc/apt/apt.conf.d/99nymea +DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; }; +DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1"; +DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; }; +EOF + #DEBHELPER# exit 0 diff --git a/debian/nymead.prerm b/debian/nymead.prerm new file mode 100644 index 00000000..02fc2b69 --- /dev/null +++ b/debian/nymead.prerm @@ -0,0 +1,29 @@ +#!/bin/sh + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # +# Copyright (C) 2015 - 2022 nymea GmbH # +# # +# This file is part of nymea. # +# # +# nymea is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, version 2 of the License. # +# # +# nymea is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with nymea. If not, see . # +# # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +# apt remove doesn't remove files from /etc unless --purge is given +# but we want to remove /etc/apt/apt.conf.d/99nymea in any case +rm /etc/apt/apt.conf.d/99nymea + +#DEBHELPER# + +exit 0