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)