Add automatic changelog generation to Debian package build

The build script now automatically generates a proper Debian changelog from
git history between version tags. Features:

- Proper Debian changelog format with version, urgency, and timestamp
- Automatic version detection using git describe --tags
- Change list from previous version tag to current commit
- Compressed storage as per Debian standards (changelog.gz)
- Fallback logic for initial releases when no previous tags exist

The changelog is installed to /usr/share/doc/skyview/changelog.gz following
Debian packaging best practices.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-24 21:45:18 +02:00
commit 802e964cc0

View file

@ -69,6 +69,45 @@ echo_info " beast-dump: $(file "$DEB_DIR/usr/bin/beast-dump")"
chmod +x "$DEB_DIR/usr/bin/skyview"
chmod +x "$DEB_DIR/usr/bin/beast-dump"
# Generate changelog from git history
echo_info "Generating changelog from git history..."
CHANGELOG_DIR="$DEB_DIR/usr/share/doc/skyview"
mkdir -p "$CHANGELOG_DIR"
# Get the current version and previous version
CURRENT_VERSION=$(git describe --tags --always)
PREV_VERSION=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_VERSION" ]; then
echo_info "Generating changelog from $PREV_VERSION to $CURRENT_VERSION"
# Create changelog with proper Debian format
{
echo "skyview ($CURRENT_VERSION) unstable; urgency=medium"
echo ""
echo " Changes since $PREV_VERSION:"
git log --pretty=format:" * %s" "$PREV_VERSION..HEAD" | head -20
echo ""
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
echo ""
} > "$CHANGELOG_DIR/changelog"
else
echo_info "No previous version found, generating initial changelog"
# Create initial changelog
{
echo "skyview ($CURRENT_VERSION) unstable; urgency=medium"
echo ""
echo " * Initial release"
echo " * Multi-source ADS-B aircraft tracker with Beast format support"
echo ""
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
echo ""
} > "$CHANGELOG_DIR/changelog"
fi
# Compress changelog as per Debian standards
gzip -9 "$CHANGELOG_DIR/changelog"
echo_info "Generated changelog: $CHANGELOG_DIR/changelog.gz"
# Get package info
VERSION=$(grep "Version:" "$DEB_DIR/DEBIAN/control" | cut -d' ' -f2)
PACKAGE=$(grep "Package:" "$DEB_DIR/DEBIAN/control" | cut -d' ' -f2)