File gen_spec.sh of Package python-squishy

#!/bin/sh

set -ex

cd $(dirname "$0")

OBS_PWD=$(pwd)

# virtual env doesn't like ':' in path and gives this error:
# virtualenv: error: argument dest: destination `pwd` must not contain the path separator (:) as this would break the activation scripts
# and OBS paths pretty much always have one or more ':' so lets use /tmp as workaround

# make sure there is no old files laying around
rm -rf /tmp/squishy-obs-build
mkdir -p /tmp/squishy-obs-build
cd /tmp/squishy-obs-build

# latest release (0.9.0) doesn't support --localfile so install in venv
python3 -m venv build.venv
. build.venv/bin/activate
git clone https://github.com/openSUSE/py2pack
cd py2pack
# known working version
git checkout "959a7544233a2efc25d0818185ade5a97bbcdf66"
pip install -e .
cd ..

git clone https://github.com/squishy-scsi/squishy squishy-git
cd squishy-git
nox -s dist
cd build/dist

SQUISHY_WHL=$(find . -name "*.whl")
SQUISHY_TAR=$(find . -name "*.tar.gz")

unzip $SQUISHY_WHL
METADATA_FILE=$(find . -name "METADATA")
py2pack generate --local --localfile "$METADATA_FILE" squishy
cp python-squishy.spec "$OBS_PWD"
cp "$SQUISHY_TAR" "$OBS_PWD"
openSUSE Build Service is sponsored by