From 802e964cc0dcd7c7ed7dbf41066d7bf6f60e6f32 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sun, 24 Aug 2025 21:45:18 +0200 Subject: [PATCH] Add automatic changelog generation to Debian package build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/build-deb.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 7534373..129df17 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -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)