feat: Add Debian packaging script, enhance configuration loading with multi-path support, and enable config saving.

This commit is contained in:
Zin Bo Thit
2026-02-10 13:48:21 +06:30
parent 3bd86901f7
commit 476977dc83
6 changed files with 446 additions and 194 deletions

57
scripts/build_deb.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
# Manual .deb packaging script for C2LInspecz
set -e
PKG_NAME="c2linspecz"
VERSION="0.1.0"
ARCH="amd64"
BUILD_DIR="target/debian_pkg"
echo "Building .deb package for $PKG_NAME v$VERSION..."
# Clean up previous build
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR/DEBIAN
mkdir -p $BUILD_DIR/usr/bin
mkdir -p $BUILD_DIR/usr/share/applications
mkdir -p $BUILD_DIR/etc/c2linspecz
# Copy binary (must be built with cargo build --release first)
if [ ! -f target/release/c2linspecz ]; then
echo "Error: target/release/c2linspecz not found. Please run 'cargo build --release' first."
exit 1
fi
cp target/release/c2linspecz $BUILD_DIR/usr/bin/
# Copy config template
cp config.json $BUILD_DIR/etc/c2linspecz/
# Create desktop entry
cat <<EOF > $BUILD_DIR/usr/share/applications/c2linspecz.desktop
[Desktop Entry]
Name=C2LInspecz
Comment=Automated POS Diagnostic & Health Monitoring Tool
Exec=/usr/bin/c2linspecz
Terminal=false
Type=Application
Categories=Utility;System;
Icon=utilities-system-monitor
EOF
# Create control file
cat <<EOF > $BUILD_DIR/DEBIAN/control
Package: $PKG_NAME
Version: $VERSION
Section: utils
Priority: optional
Architecture: $ARCH
Maintainer: Code2Lab Team <support@code2lab.com>
Description: Automated POS Diagnostic & Health Monitoring Tool
This tool is designed to identify, troubleshoot, and resolve issues within the POS ecosystem.
EOF
# Build the package
dpkg-deb --build $BUILD_DIR "target/${PKG_NAME}_${VERSION}_${ARCH}.deb"
echo "Package generated at target/${PKG_NAME}_${VERSION}_${ARCH}.deb"