2020-10-08 13:20:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
if [[ -z "${DEB_EMAIL}" ]]; then
|
|
|
|
DEB_EMAIL="$1"
|
2020-10-08 13:20:42 +00:00
|
|
|
fi
|
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
if [[ -z "${DEB_EMAIL}" ]]; then
|
2020-10-08 13:20:42 +00:00
|
|
|
echo "E-mail address required for packaging signing with gpg key!"
|
|
|
|
echo "Usage: ./build-deb.sh EMAIL"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
TORCH_VERSION=$(git describe --tags --abbrev=0)
|
|
|
|
PROJECT=torch-agent-$TORCH_VERSION
|
|
|
|
|
2020-10-08 13:20:42 +00:00
|
|
|
BUILD_DIR=dist
|
|
|
|
DEB_DIR=$BUILD_DIR/$PROJECT
|
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
rm -rf "${BUILD_DIR:?}/"*
|
2020-10-08 13:20:42 +00:00
|
|
|
|
|
|
|
python3 setup.py sdist
|
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
mkdir -p "$DEB_DIR/src/etc/torch"
|
|
|
|
cp -r debian "$DEB_DIR/"
|
|
|
|
cp torch.conf "$DEB_DIR/src/etc/torch/"
|
2020-10-08 13:20:42 +00:00
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
cd $BUILD_DIR || exit
|
|
|
|
tar -xzmf "$PROJECT.tar.gz"
|
2020-10-08 13:20:42 +00:00
|
|
|
|
2020-10-19 22:07:57 +00:00
|
|
|
cd "$PROJECT" || exit
|
|
|
|
export USER
|
|
|
|
USER=$(whoami)
|
|
|
|
dh_make --createorig -e "$DEB_EMAIL" -s -y
|
|
|
|
dpkg-buildpackage -k"$DEB_EMAIL"
|