From d3cd87d1aa0c39838738d5924be1668e0a2400ca Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 14 Apr 2025 15:14:05 +0200 Subject: [PATCH] Version and release scripting Version number moved to a separate file as a primary source of truth. Added tools/release-commit to make the release process a little bit faster. Fixes #218 --- Makefile.in | 2 ++ VERSION | 1 + doc/Makefile | 6 ++-- doc/bird.sgml | 4 +-- tools/gendist | 2 +- tools/make-archive | 2 +- tools/release-commit | 84 ++++++++++++++++++++++++++++++++++++++++++++ tools/version | 56 +++++++++++++++++++++-------- 8 files changed, 136 insertions(+), 21 deletions(-) create mode 100644 VERSION create mode 100755 tools/release-commit diff --git a/Makefile.in b/Makefile.in index b09d02036..321fe817e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,7 +43,9 @@ objdir := @objdir@ exedir := @exedir@ # Find out which version we are actually building +# This is rewritten by the release tools by hardcoded version VERSION := $(strip $(shell bash $(srcdir)/tools/version)) + CFLAGS += -DBIRD_VERSION='"$(VERSION)"' ifeq ($(objdir),.) diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..5c6fb5489 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.17 diff --git a/doc/Makefile b/doc/Makefile index c17648877..5a0679b9c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -20,18 +20,18 @@ $(o)prog.sgml: $(srcdir)/tools/progdoc $(objdir)/.dir-stamp $(srcdir)/tools/progdoc $(srcdir) $@ $(o)%.sgml: $(s)%.sgml $(objdir)/.dir-stamp - cp $< $@ + sed 's#{{ VERSION }}#$(VERSION)#' <$< >$@ $(o)%.html: $(o)%.sgml cd $(dir $@) && $(toolsdir)/linuxdoc -B html $(notdir $<) ifeq ($(PANDOC),) -$(o)%.md: $(s)%.sgml +$(o)%.md: $(o)%.sgml @echo "ERROR: No pandoc available, install pandoc to build documentation" @false else LINUXDOC_PANDOC_PARSER := $(srcdir)/tools/linuxdoc.lua -$(o)%.md: $(s)%.sgml $(LINUXDOC_PANDOC_PARSER) $(objdir)/.dir-stamp +$(o)%.md: $(o)%.sgml $(LINUXDOC_PANDOC_PARSER) $(objdir)/.dir-stamp $(PANDOC) -f $(LINUXDOC_PANDOC_PARSER) -s -t markdown -o $@ $< $(o)%-singlepage.html: $(o)%.md diff --git a/doc/bird.sgml b/doc/bird.sgml index d33c7b34c..3b35adffb 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1,7 +1,7 @@