deb-bootupd/build-deb.sh
robojerk 73b43239e9
Some checks failed
Build deb-bootupd Artifacts / build (push) Failing after 6m14s
Simple Build and Upload / build (push) Failing after 2m0s
Add Debian packaging and update Forgejo workflow
- Add complete Debian packaging configuration (debian/ directory)
- Create build-deb.sh script for building packages
- Update Forgejo workflow to build and upload .deb artifacts
- Add comprehensive version naming for both binary and Debian artifacts
- Update .gitignore to exclude build artifacts and packaging files
- Add PACKAGING.md documentation
- Add test-deb.sh for testing package installation
2025-08-10 11:30:19 -07:00

49 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
set -e
# Build script for deb-bootupd Debian package
# This script builds a proper .deb package following Debian packaging standards
echo "🐳 Building deb-bootupd Debian package..."
# Check if we're in the right directory
if [ ! -f "Cargo.toml" ] || [ ! -d "debian" ]; then
echo "❌ Error: This script must be run from the deb-bootupd root directory"
exit 1
fi
# Check for required tools
command -v dpkg-buildpackage >/dev/null 2>&1 || { echo "❌ Error: dpkg-buildpackage not found. Install build-essential and devscripts."; exit 1; }
command -v lintian >/dev/null 2>&1 || { echo "⚠️ Warning: lintian not found. Install lintian for package validation."; }
# Clean previous builds
echo "🧹 Cleaning previous build artifacts..."
rm -rf target/ debian/deb-bootupd/ *.deb *.changes *.buildinfo *.dsc
# Build the package
echo "🔨 Building Debian package..."
dpkg-buildpackage -b -uc -us
# Check if build was successful
if [ $? -eq 0 ]; then
echo "✅ Package built successfully!"
# List generated files
echo "📦 Generated files:"
ls -la ../*.deb ../*.changes ../*.buildinfo ../*.dsc 2>/dev/null || echo "No package files found in parent directory"
# Validate package with lintian if available
if command -v lintian >/dev/null 2>&1; then
echo "🔍 Running lintian validation..."
lintian ../*.changes || echo "⚠️ Lintian found some issues (see above)"
fi
echo ""
echo "🎉 deb-bootupd Debian package built successfully!"
echo "📦 Install with: sudo dpkg -i ../deb-bootupd_*.deb"
echo "🔧 Fix dependencies with: sudo apt-get install -f"
else
echo "❌ Package build failed!"
exit 1
fi