#!/bin/sh
set -e

# pipewire-pulse.service wants pipewire-session-manager.service
# pipewire-session-manager.service is an alias from both
# wireplumber.service and pipewire-media-session.service.
# This generates a conflict, see https://bugs.debian.org/997818
# To avoid this conflict, we need to remove pipewire-media-session.service
# during the remove step of the package, not only at the purge step.

if [ "$1" = "remove" ]; then
	if [ -z "${DPKG_ROOT:-}" ] && [ -x "/usr/bin/deb-systemd-helper" ] ; then
		deb-systemd-helper --user purge 'pipewire-media-session.service' >/dev/null || true
		deb-systemd-helper --user unmask 'pipewire-media-session.service' >/dev/null || true
	fi
fi

#DEBHELPER#
