From 03c442ad8863be4a4526ac224031362ae62466e3 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sat, 30 Apr 2022 23:12:45 +0000 Subject: [PATCH] Update debian packaging script --- .../{debian_control_file => debian/control} | 0 scripts/build_deb.sh | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) rename contrib/{debian_control_file => debian/control} (100%) diff --git a/contrib/debian_control_file b/contrib/debian/control similarity index 100% rename from contrib/debian_control_file rename to contrib/debian/control diff --git a/scripts/build_deb.sh b/scripts/build_deb.sh index 3c5517c..6a54db8 100755 --- a/scripts/build_deb.sh +++ b/scripts/build_deb.sh @@ -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