From c5913c6f9f0e93c68d7ca0625443099bd9102b89 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 1 Apr 2025 07:44:12 -0700 Subject: [PATCH] Makefile: inject package name/version/bugreport into pot file Inject the package name and version ("xfsprogs") and the bug reporting URL into the generated gettext .pot file. This isn't strictly necessary, it's more just polish. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn Reviewed-by: Bill O'Donnell --- configure.ac | 1 + include/builddefs.in | 1 + include/buildrules | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f039bc912..715967116 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([include/libxfs.h]) AC_PREFIX_DEFAULT(/usr) +AC_SUBST(PACKAGE_BUGREPORT) # Default CFLAGS if nobody specifies anything else if test "${CFLAGS+set}" != "set"; then diff --git a/include/builddefs.in b/include/builddefs.in index fe2a7824a..04b4e0880 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -42,6 +42,7 @@ PKG_GROUP = @pkg_group@ PKG_RELEASE = @pkg_release@ PKG_VERSION = @pkg_version@ PKG_DISTRIBUTION= @pkg_distribution@ +PKG_BUGREPORT = @PACKAGE_BUGREPORT@ prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/include/buildrules b/include/buildrules index 6b76abced..ae047ac41 100644 --- a/include/buildrules +++ b/include/buildrules @@ -85,9 +85,17 @@ endif endif ifdef POTHEAD +XGETTEXT_FLAGS=\ + --language=C \ + --keyword=_ \ + --keyword=N_ \ + --package-name=$(PKG_NAME) \ + --package-version=$(PKG_VERSION) \ + --msgid-bugs-address=$(PKG_BUGREPORT) + $(POTHEAD): $(XGETTEXTFILES) @echo " [GETTXT] $@" - $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES) + $(Q)$(XGETTEXT) $(XGETTEXT_FLAGS) -o $@ $(XGETTEXTFILES) # Update translations update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po) -- 2.50.1