2020-10-07 10:48:55 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-07 11:13:12 +00:00
|
|
|
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)
|
2020-10-07 10:48:55 +00:00
|
|
|
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
|