wine-staging/debian/wine-staging.postinst

38 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2024-08-09 21:03:03 +02:00
#!/bin/sh
set -e
# Alternatively this check can be disabled by preseeding:
# echo "wine/setcaps boolean false" | debconf-set-selections
. /usr/share/debconf/confmodule
case "$1" in
configure)
if command -v setcap > /dev/null; then
db_get wine/setcaps
# Allow dpkg-reconfigure to remove caps
if test "$RET" = "true"; then
if ! setcap "cap_net_raw=epi" /opt/wine-staging/bin/wineserver; then
echo "Setcap failed on /opt/wine-staging/bin/wineserver, applications that need to send/receive raw IP packets will not work" >&2
fi
else
# setcap -r fails if the xattr is not present
if getcap /opt/wine-staging/bin/wineserver | grep -qs "/opt/wine-staging/bin/wineserver"; then
if ! setcap "-r" /opt/wine-staging/bin/wineserver; then
echo "Setcap -r failed on /opt/wine-staging/bin/wineserver, could not remove capabilities" >&2
fi
fi
fi
fi
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0