Tightened build script

This commit is contained in:
B.J. Dweck 2020-10-08 15:16:53 +02:00
parent 2792dc5e68
commit 16bbe738a7
2 changed files with 14 additions and 21 deletions

View File

@ -1,40 +1,33 @@
#!/bin/bash
TORCH_VERSION=$(git describe --tags --abbrev=0)
PROJECT=torch-agent-$TORCH_VERSION
if [[ -z "${DEBEMAIL}" ]]; then
DEBEMAIL="$1"
fi
if [[ -z "${DEBEMAIL}" ]]; then
echo "E-mail address required for packaging signing with gpg key!"
echo "Usage: ./make-pkg.sh EMAIL"
echo "Usage: ./build-deb.sh EMAIL"
exit 1
fi
BUILD_DIR=build_deb
TORCH_VERSION=$(git describe --tags --abbrev=0)
DEBIAN_PKG=torch-agent-$TORCH_VERSION
BUILD_DIR=dist
DEB_DIR=$BUILD_DIR/$PROJECT
rm -rf $BUILD_DIR
rm -rf dist
rm -rf $BUILD_DIR/*
mkdir $BUILD_DIR
python3 setup.py clean
python3 setup.py sdist
cp dist/$DEBIAN_PKG.tar.gz $BUILD_DIR/
mkdir -p $DEB_DIR/src/etc/torch
cp -r debian $DEB_DIR/
cp torch.conf $DEB_DIR/src/etc/torch/
cd $BUILD_DIR
tar -xzmf $DEBIAN_PKG.tar.gz
cd ..
PKG_ROOT=$BUILD_DIR/$DEBIAN_PKG
mkdir -p $PKG_ROOT/src/etc/torch
cp -r debian $PKG_ROOT/
cp torch.conf $PKG_ROOT/src/etc/torch/
cd $PKG_ROOT
tar -xzmf $PROJECT.tar.gz
cd $PROJECT
export USER=`whoami`
dh_make --createorig -e $DEBEMAIL -s -y
dpkg-buildpackage -k$DEBEMAIL

Binary file not shown.