74b2e6da48
Snapshots need to be treated special by various distributions Change-Id: I158cb713548920c5a45790bce00c97f2e00a8f32
28 lines
753 B
Bash
Executable File
28 lines
753 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=False --with-python3=True"
|
|
if grep wheezy /etc/os-release; then
|
|
# also it's old, use python2 instead of python3
|
|
export PYEXEC=python
|
|
export DSCARGS=""
|
|
fi
|
|
# If not PBR, use the setup.py.tmpl
|
|
sed -e 's/~/./' ./makesetup > ./makesetup.deb
|
|
chmod +x ./makesetup.deb
|
|
./makesetup.deb
|
|
#$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/*.deb $1/
|