mirror of
https://opendev.org/x/pyghmi
synced 2025-01-13 03:08:00 +00:00
68ef96a624
For all supported debian versions, build python3 pyghmi except Wheezy. Change-Id: I9271075cf9e088997a9007341b925dbc7cf476d9
27 lines
798 B
Bash
Executable File
27 lines
798 B
Bash
Executable File
#!/bin/bash
|
|
cd `dirname $0`
|
|
mkdir -p /tmp/pyghmi
|
|
cp -a * .git /tmp/pyghmi
|
|
cd /tmp/pyghmi
|
|
export PYEXEC=python3
|
|
export DSCARGS="--with-python2=True --with-python3=True"
|
|
if grep wheezy /etc/os-release; then
|
|
# wheezy is difficult on pyca, use cryptodomex for that platform
|
|
patch -p1 < wheezy.patch
|
|
# also it's old, use python2 instead of python3
|
|
export PYEXEC=python
|
|
export DSCARGS="--with-python2=True --with-python3=False"
|
|
fi
|
|
# If not PBR, use the setup.py.tmpl
|
|
$PYEXEC -c 'import pbr' || ./makesetup
|
|
VERSION=`$PYEXEC setup.py --version`
|
|
$PYEXEC setup.py sdist
|
|
py2dsc $DSCARGS dist/pyghmi-$VERSION.tar.gz
|
|
shopt -s extglob
|
|
cd deb_dist/!(*.orig)/
|
|
dpkg-buildpackage -rfakeroot -uc -us -i
|
|
cd -
|
|
rm -rf $(find deb_dist -mindepth 1 -maxdepth 1 -type d)
|
|
rm $1/*pyghmi*
|
|
cp deb_dist/* $1/
|