Switch python installation to use DevStack's setup_dev_lib()

This function does a number of things, specifically it handles the
DevStack USE_PYTHON3 switch transparently so we can run both major
Python versions.

The setup.cfg file in both cgcs_patch and tsconfig are really only
used by setup_dev_lib() right now, making the switch to use pbr
is beyond what I want to do here.

Change-Id: If91248303cba9e6056ac2bc4b7e8771cf193de01
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
Dean Troyer 2019-05-03 18:51:27 -05:00
parent 0a0475b815
commit e3d3b200e6
2 changed files with 29 additions and 20 deletions

View File

@ -0,0 +1,21 @@
[metadata]
license_files = LICENSE
name = cgcs_patch
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
[files]
packages =
cgcs_patch
[wheel]
universal = 1

View File

@ -21,8 +21,11 @@ set -o xtrace
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/starlingx/update.git}
STXUPDATE_DIR=${GITDIR[$STX_UPDATE_NAME]}
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch
GITDIR["sw-patch"]=$STX_PATCH_DIR/cgcs-patch
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig
GITDIR["tsconfig"]=$TSCONFIG_DIR/tsconfig
# STX_INST_DIR should be a non-root-writable place to install build artifacts
STX_INST_DIR=${STX_INST_DIR:-/usr/local}
@ -36,14 +39,7 @@ STX_SUDO="sudo"
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
function install_sw_patch {
pushd $STX_PATCH_DIR/cgcs-patch
sudo python setup.py install \
--root=/ \
--install-lib=$PYTHON_SITE_DIR \
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
popd
setup_dev_lib "sw-patch"
local stx_patch_sbindir=$STX_SBIN_DIR
local stx_patch_sysconfdir=/etc/
@ -59,16 +55,8 @@ function install_sw_patch {
}
function install_tsconfig {
# no setup.cfg in tsconfig, so we can not use pip install -e
# setup_dev_lib "tsconfig"
pushd $TSCONFIG_DIR/tsconfig
sudo python setup.py install \
--root=/ \
--install-lib=$PYTHON_SITE_DIR \
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
popd
setup_dev_lib "tsconfig"
$STX_SUDO install -d -m 755 $STX_BIN_DIR
$STX_SUDO install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
}