/usr/bin/pkgos-dh_auto_install is in openstack-pkg-tools 75.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/bin/sh
set -e
set -x
PKGOS_USE_PY2=yes
PKGOS_USE_PY3=yes
for i in $@ ; do
case "${1}" in
"--no-py3")
PKGOS_USE_PY3=no
shift
;;
"--no-py2")
PKGOS_USE_PY2=no
shift
;;
*)
;;
esac
done
SRC_PKG_NAME=$(dpkg-parsechangelog -SSource)
PY_MODULE_NAME=$(echo ${SRC_PKG_NAME} | sed s/python-//)
if [ "${PKGOS_USE_PY2}" = "yes" ] ; then
PYTHONS=$(pyversions -vr 2>/dev/null)
fi
if [ "${PKGOS_USE_PY3}" = "yes" ] ; then
PYTHON3S=$(py3versions -vr 2>/dev/null)
fi
if [ "${PKGOS_USE_PY2}" = "yes" ] ; then
for pyvers in ${PYTHONS}; do
python${pyvers} setup.py install --install-layout=deb --root $(pwd)/debian/python-${PY_MODULE_NAME}
done
fi
if [ "${PKGOS_USE_PY3}" = "yes" ] ; then
for pyvers in ${PYTHON3S}; do
python${pyvers} setup.py install --install-layout=deb --root $(pwd)/debian/python3-${PY_MODULE_NAME}
done
fi
rm -rf $(pwd)/debian/python*/usr/lib/python*/dist-packages/*.pth
if [ -d $(pwd)/debian/python-${PY_MODULE_NAME}/usr/bin ] ; then
for i in $(pwd)/debian/python-${PY_MODULE_NAME}/usr/bin/* ; do
SCRIPT_NAME=$(basename ${i})
if [ "${PKGOS_USE_PY2}" = "yes" ] ; then
mv $(pwd)/debian/python-${PY_MODULE_NAME}/usr/bin/${SCRIPT_NAME} $(pwd)/debian/python-${PY_MODULE_NAME}/usr/bin/python2-${SCRIPT_NAME}
fi
if [ "${PKGOS_USE_PY3}" = "yes" ] ; then
mv $(pwd)/debian/python3-${PY_MODULE_NAME}/usr/bin/${SCRIPT_NAME} $(pwd)/debian/python3-${PY_MODULE_NAME}/usr/bin/python3-${SCRIPT_NAME}
fi
done
fi
|