#!/bin/bash # analog of %post/%posttrans RPM scriptlet # For details see: # 1. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#summary-of-ways-maintainer-scripts-are-called # 2. https://www.debian.org/doc/debian-policy/ap-flowcharts.html # Arguments in short: # "$1" == "configure" - RPM post/posttrans # "$1" == "abort-upgrade" - upgrade package error # "$1" == "abort-remove" - remove package error # "python-cllib DEBIAN POSTINST STARTED" cl_venv_path='/opt/cloudlinux/venv' sharepath='/usr/share/python-cllib' python_sitelib="$(/opt/cloudlinux/venv/bin/python3 -c "import sysconfig, sys; sys.stdout.write(sysconfig.get_path('purelib'))")" bundled_hooks_inuse_tmp='/usr/share/cloudlinux/hooks/.inuse.tmp' if [ "$1" = "configure" ]; then ######################## # RPM post /usr/share/python-cllib/scriptlets/rpm_post.sh "$cl_venv_path" "$bundled_hooks_inuse_tmp" ######################## # RPM posttrans /usr/share/python-cllib/scriptlets/rpm_posttrans.sh "$sharepath" "$python_sitelib" "$bundled_hooks_inuse_tmp" fi; # Override permissions for flags directory during upgrade chmod 711 /opt/cloudlinux/flags/ chmod 711 /opt/cloudlinux/flags/available-flags.d/ chmod 711 /opt/cloudlinux/flags/enabled-flags.d/ # "python-cllib DEBIAN POSTINST FINISHED" exit 0