#! /bin/sh set -e if [ ! -f /etc/python3.14/sitecustomize.py ]; then cat <<-EOF # Empty sitecustomize.py to avoid a dangling symlink EOF fi case "$1" in configure) # Create empty directories in /usr/local if [ -e /etc/staff-group-for-usr-local ]; then perm=2755; group=staff else perm=755; group=root fi if [ ! -e /usr/local/lib/python3.14 ]; then mkdir -p /usr/local/lib/python3.14 2> /dev/null || true chmod $perm /usr/local/lib/python3.14 2> /dev/null || true chown root:$group /usr/local/lib/python3.14 2> /dev/null || true fi if command -v update-binfmts >/dev/null; then update-binfmts --import python3.14 fi ;; esac if [ "$1" = configure ]; then # only available before removal of the packaging package rm -f /etc/python3.14/sysconfig.cfg if ls -L /usr/lib/python3.14/sitecustomize.py >/dev/null 2>&1; then filt='cat' else filt='fgrep -v sitecustomize.py' fi files=$(dpkg -L libpython3.14-minimal:amd64 \ | sed -n '/^\/usr\/lib\/python3.14\/.*\.py$/p' | $filt) if [ -n "$files" ]; then /usr/bin/python3.14 -E -S /usr/lib/python3.14/py_compile.py $files if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then /usr/bin/python3.14 -E -S -O /usr/lib/python3.14/py_compile.py $files fi else echo >&2 "python3.14-minimal: can't get files for byte-compilation" fi bc=no #if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \ # || [ -f /var/lib/python/python3.14_installed ]; then # bc=yes #fi if ! grep -sq '^supported-versions[^#]*python3.14' /usr/share/python/debian_defaults then # FIXME: byte compile anyway? bc=no fi if [ "$bc" = yes ]; then # new installation or installation of first version with hook support if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python3.14..." fi version=$(dpkg -s python3.14-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python3/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python3.14 "$2" "$version" done if [ -f /var/lib/python/python3.14_installed ]; then rm -f /var/lib/python/python3.14_installed rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null fi fi fi # Automatically added by dh_usrlocal/13.31 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ]; then ( default_mode=0755 default_user=root default_group=root if [ -e /etc/staff-group-for-usr-local ]; then default_mode=02775 default_group=staff fi while read line; do set -- $line dir="$1"; mode="$2"; user="$3"; group="$4" if [ "$mode" = "default" ]; then mode="$default_mode" user="$default_user" group="$default_group" fi if [ ! -e "$dir" ]; then if mkdir "$dir" 2>/dev/null; then if chown "$user":"$group" "$dir" ; then chmod "$mode" "$dir" || true fi fi fi done ) << DATA /usr/local/lib default /usr/local/lib/python3.14 default /usr/local/lib/python3.14/dist-packages default DATA fi # End automatically added section exit 0