Update debian packaging script

This commit is contained in:
silverpill 2022-04-30 23:12:45 +00:00
parent fac0172159
commit 03c442ad88
2 changed files with 16 additions and 2 deletions

View file

@ -9,18 +9,32 @@ ARCH=$(dpkg --print-architecture)
PACKAGE_DIR="target/debian/tmp"
WEB_DIR="$1"
# Package info
rm -rf $PACKAGE_DIR
mkdir -p $PACKAGE_DIR/DEBIAN
cp contrib/debian_control_file $PACKAGE_DIR/DEBIAN/control
cp contrib/debian/* $PACKAGE_DIR/DEBIAN/
echo "Version: $VERSION" >> $PACKAGE_DIR/DEBIAN/control
echo "Architecture: $ARCH" >> $PACKAGE_DIR/DEBIAN/control
# Binaries
mkdir -p $PACKAGE_DIR/usr/bin
cp target/release/mitra $PACKAGE_DIR/usr/bin/mitra
cp target/release/mitractl $PACKAGE_DIR/usr/bin/mitractl
# Config directory
mkdir -p $PACKAGE_DIR/etc/mitra
# Config example
mkdir -p $PACKAGE_DIR/usr/share/mitra/examples
cp config.yaml.example $PACKAGE_DIR/usr/share/mitra/examples/config.yaml
# Service
mkdir -p $PACKAGE_DIR/lib/systemd/system
cp contrib/mitra.service $PACKAGE_DIR/lib/systemd/system/mitra.service
# Webapp
mkdir -p $PACKAGE_DIR/usr/share/mitra
# https://people.debian.org/~neilm/webapps-policy/ch-issues.html#s-issues-fhs
cp -r $WEB_DIR $PACKAGE_DIR/usr/share/mitra/www
dpkg-deb --build target/debian/tmp target/debian/mitra_$VERSION_$ARCH.deb
dpkg-deb --build target/debian/tmp target/debian/mitra_${VERSION}_${ARCH}.deb