Organizes 11 projects for Cerbo GX/Venus OS into a single repository: - axiom-nmea: Raymarine LightHouse protocol decoder - dbus-generator-ramp: Generator current ramp controller - dbus-lightning: Blitzortung lightning monitor - dbus-meteoblue-forecast: Meteoblue weather forecast - dbus-no-foreign-land: noforeignland.com tracking - dbus-tides: Tide prediction from depth + harmonics - dbus-vrm-history: VRM cloud history proxy - dbus-windy-station: Windy.com weather upload - mfd-custom-app: MFD app deployment package - venus-html5-app: Custom Victron HTML5 app fork - watermaker: Watermaker PLC control UI Adds root README, .gitignore, project template, and per-project .gitignore files. Sensitive config files excluded via .gitignore with .example templates provided. Made-with: Cursor
69 lines
1.8 KiB
Bash
Executable File
69 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Build script for Venus OS D-Bus service package
|
|
#
|
|
# Usage:
|
|
# ./build-package.sh
|
|
# ./build-package.sh --version 1.0.0
|
|
#
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
VERSION="0.1.0"
|
|
OUTPUT_DIR="$SCRIPT_DIR"
|
|
PACKAGE_NAME="dbus-template"
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--version|-v) VERSION="$2"; shift 2 ;;
|
|
--output|-o) OUTPUT_DIR="$2"; shift 2 ;;
|
|
--help|-h)
|
|
echo "Usage: $0 [--version VERSION] [--output PATH]"
|
|
exit 0
|
|
;;
|
|
*) echo "Unknown option: $1"; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
BUILD_DIR=$(mktemp -d)
|
|
PACKAGE_DIR="$BUILD_DIR/$PACKAGE_NAME"
|
|
|
|
echo "Building $PACKAGE_NAME v$VERSION..."
|
|
|
|
mkdir -p "$PACKAGE_DIR/service/log"
|
|
|
|
# Copy application files -- update this list for your service
|
|
cp "$SCRIPT_DIR/dbus-template.py" "$PACKAGE_DIR/"
|
|
cp "$SCRIPT_DIR/config.py" "$PACKAGE_DIR/"
|
|
|
|
# Copy service and install files
|
|
cp "$SCRIPT_DIR/service/run" "$PACKAGE_DIR/service/"
|
|
cp "$SCRIPT_DIR/service/log/run" "$PACKAGE_DIR/service/log/"
|
|
cp "$SCRIPT_DIR/install.sh" "$PACKAGE_DIR/"
|
|
cp "$SCRIPT_DIR/uninstall.sh" "$PACKAGE_DIR/"
|
|
|
|
# Set permissions
|
|
chmod +x "$PACKAGE_DIR/dbus-template.py"
|
|
chmod +x "$PACKAGE_DIR/install.sh"
|
|
chmod +x "$PACKAGE_DIR/uninstall.sh"
|
|
chmod +x "$PACKAGE_DIR/service/run"
|
|
chmod +x "$PACKAGE_DIR/service/log/run"
|
|
|
|
# Create archive
|
|
mkdir -p "$OUTPUT_DIR"
|
|
TARBALL="$PACKAGE_NAME-$VERSION.tar.gz"
|
|
OUTPUT_ABS="$(cd "$OUTPUT_DIR" && pwd)"
|
|
cd "$BUILD_DIR"
|
|
tar --format=ustar -czf "$OUTPUT_ABS/$TARBALL" "$PACKAGE_NAME"
|
|
rm -rf "$BUILD_DIR"
|
|
|
|
echo "Package: $OUTPUT_ABS/$TARBALL"
|
|
echo ""
|
|
echo "Install on Venus OS:"
|
|
echo " scp $OUTPUT_ABS/$TARBALL root@<device-ip>:/data/"
|
|
echo " ssh root@<device-ip>"
|
|
echo " cd /data && tar -xzf $TARBALL"
|
|
echo " bash /data/$PACKAGE_NAME/install.sh"
|