5 if [ "%{name}" != "%\{name\}" ]; then
6 # Red Hat ("%{...}" is interpolated at package build time)
9 prefix="${RPM_INSTALL_PREFIX}"
12 script="$(basename "${0}")"
13 pkg="${script%.prerm}"
18 case "${pkgtype}-${1}" in
20 if [ -e /run/systemd/system ]; then
21 systemctl stop "${pkg}" || true
22 systemctl disable "${pkg}" || true
24 if [ -e "${prefix}/share/doc/${pkg}/${pkg}.service" ]; then
25 # Unit files from Python packages get installed by
26 # postinst so we have to remove them explicitly here.
27 rm "/lib/systemd/system/${pkg}/${pkg}.service" || true