commit:     f4bf289499f7d06a2a4a5f6d84ce7084075e2664
Author:     Timothy Kenno Handojo <timkenhan <AT> gmail <DOT> com>
AuthorDate: Thu Feb 15 10:00:47 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Feb 17 05:11:26 2024 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=f4bf2894

ensure package version is on the manpage
- added package version on manpage generation
- added versioning on dist pkg generation
- remove manpage generation from dist

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 989edd3..4b13597 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,12 @@
 #PACKAGE_VERSION = $(shell /bin/grep -F -- GK_V= genkernel | sed 
"s/.*GK_V='\([^']\+\)'/\1/")
+PACKAGE_VERSION = $(file <VERSION)
+ifeq ("$(PACKAGE_VERSION)", "")
 PACKAGE_VERSION = $(shell git describe --tags |sed 's,^v,,g')
+endif
 distdir = genkernel-$(PACKAGE_VERSION)
 MANPAGE = genkernel.8
 # Add off-Git/generated files here that need to be shipped with releases
-EXTRA_DIST = $(MANPAGE) ChangeLog $(KCONF)
+EXTRA_DIST = ChangeLog $(KCONF)
 
 default: all
 
@@ -82,6 +85,7 @@ all: $(BUILD_DIR)/genkernel $(BUILD_DIR)/build-config man 
kconfig
 debug:
        @echo "ARCH_KCONF=$(ARCH_KCONF)"
        @echo "GENERATED_KCONF=$(GENERATED_KCONF)"
+       @echo "PACKAGE_VERSION=$(PACKAGE_VERSION)"
 
 kconfig: $(GENERATED_KCONF)
 man: $(addprefix $(BUILD_DIR)/,$(MANPAGE))
@@ -103,6 +107,7 @@ endif
 
 dist: verify-shellscripts-initramfs verify-doc check-git-repository distclean 
$(EXTRA_DIST)
        mkdir "$(distdir)"
+       echo $(PACKAGE_VERSION) > $(distdir)/VERSION
        git ls-files -z | xargs -0 cp --no-dereference --parents 
--target-directory="$(distdir)" \
                $(EXTRA_DIST)
        tar cf "$(distdir)".tar "$(distdir)"
@@ -124,7 +129,8 @@ distclean: clean
 
 $(BUILD_DIR)/%.8: doc/%.8.txt doc/asciidoc.conf Makefile 
$(BUILD_DIR)/doc/genkernel.8.txt
        a2x --conf-file=doc/asciidoc.conf \
-                --format=manpage -D $(BUILD_DIR) "$(BUILD_DIR)/$<"
+               --format=manpage -D $(BUILD_DIR) 
--attribute="genkernelversion=$(PACKAGE_VERSION)" \
+               "$(BUILD_DIR)/$<"
 
 verify-doc: doc/genkernel.8.txt
        @rm -f faildoc ; \

Reply via email to