wine-staging/debian/wine-staging-i386.postinst

38 lines
1.2 KiB
Plaintext
Raw 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/wine-preloader; then
echo "Setcap failed on /opt/wine-staging/bin/wine-preloader, 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/wine-preloader | grep -qs "/opt/wine-staging/bin/wine-preloader"; then
if ! setcap "-r" /opt/wine-staging/bin/wine-preloader; then
echo "Setcap -r failed on /opt/wine-staging/bin/wine-preloader, 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