torch-agent/make-pkg.sh

34 lines
699 B
Bash
Executable File

#!/bin/bash
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"
exit 1
fi
TORCH_VERSION=$(git describe --tags)
DEBIAN_PKG=torch-agent-$TORCH_VERSION
PKG_ROOT=build/$DEBIAN_PKG
rf -rf $PKG_ROOT
mkdir -p $PKG_ROOT
cp -r debian $PKG_ROOT
mkdir -p $PKG_ROOT/src/etc/torch
cp torch.conf $PKG_ROOT/src/etc/torch/
mkdir -p $PKG_ROOT/src/usr/share/torch-agent
cp torch-agent.py $PKG_ROOT/src/usr/share/torch-agent/
cp torch-agent.service $PKG_ROOT/debian/
cd $PKG_ROOT
export USER=`whoami`
dh_make --createorig -e $DEBEMAIL -s -y
dpkg-buildpackage -k$DEBEMAIL