Skip to content

Commit

Permalink
Remove Python 2 bits from build script
Browse files Browse the repository at this point in the history
- Also make the echo logging a bit clearer with spaces and markers.
- Remove uneeded comments.
- Add another space before in-line comments.
  • Loading branch information
tofu-rocketry committed Sep 11, 2024
1 parent 516cb67 commit 75d7c43
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions scripts/ssm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fi
PACK_TYPE=$1
VERSION=$2
ITERATION=$3
PYTHON_ROOT_DIR=$4 # i.e. /usr/lib/python3.6
PYTHON_ROOT_DIR=$4 # i.e. /usr/lib/python3.6

# Alter library, build and source directories depending on the package
if [[ "$PACK_TYPE" = "deb" ]]; then
Expand All @@ -86,7 +86,7 @@ elif [[ "$PACK_TYPE" = "rpm" ]]; then
if [[ "$BUILD_ASSIGNED" = 0 ]]; then
BUILD_DIR=~/rpmbuild/BUILD
fi
else # If package type is neither deb nor rpm, show an error message and exit
else # If package type is neither deb nor rpm, show an error message and exit
echo "$0 currently only supports 'deb' and 'rpm' packages."
usage;
fi
Expand Down Expand Up @@ -125,9 +125,6 @@ FPM_CORE="fpm -s python \
# Simple Python filter for version specific FPM
if [[ ${PY_NUM:0:1} == "3" ]]; then
echo "Building $VERSION iteration $ITERATION for Python $PY_NUM as $PACK_TYPE."
# python-stomp < 5.0.0 to python-stomp, python to python3/pip3
# edited python-pip3 to python-pip
# slight spelling inconsistencites betwixt OS's

if [[ "$PACK_TYPE" = "deb" ]]; then
FPM_PYTHON="--depends python3 \
Expand All @@ -149,30 +146,6 @@ if [[ ${PY_NUM:0:1} == "3" ]]; then
--depends openssl \
--depends openssl-devel "
fi

elif [[ ${PY_NUM:0:1} == "2" ]]; then
echo "Building $VERSION iteration $ITERATION for Python $PY_NUM as $PACK_TYPE."

if [[ "$PACK_TYPE" = "deb" ]]; then
FPM_PYTHON="--depends python2.7 \
--depends python-pip \
--depends 'python-stomp < 5.0.0' \
--depends python-cryptography \
--depends python-openssl \
--depends python-daemon \
--depends openssl "

# el7 and below, due to yum package versions
elif [[ "$PACK_TYPE" = "rpm" ]]; then
FPM_PYTHON="--depends python2 \
--depends python2-pip \
--depends python2-cryptography \
--depends python2-pyOpenSSL \
--depends python2-daemon \
--depends stomppy \
--depends openssl \
--depends openssl-devel "
fi
fi

# python-bin must always be specified in modern linux
Expand All @@ -189,6 +162,7 @@ PACKAGE_VERSION="--$PACK_TYPE-changelog $SOURCE_DIR/ssm-$VERSION-$ITERATION/CHAN
BUILD_PACKAGE_COMMAND=${FPM_CORE}${FPM_PYTHON}${VERBOSE}${PACKAGE_VERSION}
eval "$BUILD_PACKAGE_COMMAND"

echo
echo "== Generating pleaserun package =="

# When installed, use pleaserun to perform system specific service setup
Expand All @@ -205,7 +179,8 @@ fpm -s pleaserun -t "$PACK_TYPE" \
--package "$BUILD_DIR" \
/usr/bin/ssmreceive

echo "Possible Issues to Fix:"
echo
echo "== Possible Issues to Fix =="
if [ "$OS_EXTENSION" == "_all" ]
then
# Check the resultant debs for 'lint'
Expand Down

0 comments on commit 75d7c43

Please sign in to comment.