diff --git a/Installation/debian/postinst.in b/Installation/debian/postinst.in index 9479b9da40..71ba7ca9cb 100755 --- a/Installation/debian/postinst.in +++ b/Installation/debian/postinst.in @@ -62,21 +62,21 @@ db_stop if test "@CPACK_SYSTEMD_FOUND@" -eq 1 ; then # This will only remove masks created by d-s-h on package removal. - deb-systemd-helper unmask arangodb3.service >/dev/null || true + deb-systemd-helper unmask @CPACK_PACKAGE_NAME@.service >/dev/null || true # was-enabled defaults to true, so new installations run enable. - if deb-systemd-helper --quiet was-enabled arangodb3.service; then + if deb-systemd-helper --quiet was-enabled @CPACK_PACKAGE_NAME@.service; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. - deb-systemd-helper enable arangodb3.service >/dev/null || true + deb-systemd-helper enable @CPACK_PACKAGE_NAME@.service >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. - deb-systemd-helper update-state arangodb3.service >/dev/null || true + deb-systemd-helper update-state @CPACK_PACKAGE_NAME@.service >/dev/null || true fi # Automatically added by dh_systemd_start if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true - deb-systemd-invoke start arangodb3.service >/dev/null || true + deb-systemd-invoke start @CPACK_PACKAGE_NAME@.service >/dev/null || true fi # End automatically added section else diff --git a/Installation/debian/prerm b/Installation/debian/prerm.in similarity index 73% rename from Installation/debian/prerm rename to Installation/debian/prerm.in index e6f80c2062..c9a75d5414 100755 --- a/Installation/debian/prerm +++ b/Installation/debian/prerm.in @@ -3,13 +3,13 @@ set -e # Automatically added by dh_installinit if [ -x "/etc/init.d/arangodb3" ]; then - invoke-rc.d arangodb3 stop || exit $? + invoke-rc.d @CPACK_PACKAGE_NAME@ stop || exit $? fi # End automatically added section set -e # Automatically added by dh_systemd_start if [ -d /run/systemd/system ] && [ "$1" = remove ]; then - deb-systemd-invoke stop arangodb3.service >/dev/null + deb-systemd-invoke stop .service >/dev/null fi # End automatically added section diff --git a/cmake/packages/deb.cmake b/cmake/packages/deb.cmake index 9f621e2433..4b7d980a36 100644 --- a/cmake/packages/deb.cmake +++ b/cmake/packages/deb.cmake @@ -37,16 +37,18 @@ configure_file ( "${PROJECT_SOURCE_DIR}/Installation/debian/postinst.in" "${PROJECT_BINARY_DIR}/Installation/debian/postinst" NEWLINE_STYLE UNIX) - - +configure_file ( + "${PROJECT_SOURCE_DIR}/Installation/debian/prerm.in" + "${PROJECT_BINARY_DIR}/Installation/debian/prerm" + NEWLINE_STYLE UNIX) + list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/Installation/debian/templates" "${PROJECT_BINARY_DIR}/Installation/debian/config" "${PROJECT_BINARY_DIR}/Installation/debian/postinst" "${PROJECT_SOURCE_DIR}/Installation/debian/preinst" - "${PROJECT_SOURCE_DIR}/Installation/debian/postrm" - "${PROJECT_SOURCE_DIR}/Installation/debian/prerm") + "${PROJECT_SOURCE_DIR}/Installation/debian/postrm") ################################################################################ # specify which target archcitecture the package is going to be: