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
This commit is contained in:
parent
ff974a9d4a
commit
73b43239e9
19 changed files with 705 additions and 21 deletions
49
build-deb.sh
Executable file
49
build-deb.sh
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#!/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue