From 7bbcf7eab290c8b9f683f71838009933df2295b5 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Wed, 22 Jun 2022 03:45:57 -0300 Subject: build: use TARNAME instead of NAME for paths PACKAGE_TARNAME is the same as PACKAGE_NAME but normalized, so it should be safer to use in paths. For example, on a downstream project, if spaces or shell metacharacters are added to the package name, a path that uses PACKAGE_TARNAME should keep working. From the manual of GNU Autoconf (version 2.69): > -- Macro: AC_INIT (PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL]) > Process any command-line arguments and perform initialization and > verification. > > Set the name of the PACKAGE and its VERSION. These are typically > used in '--version' support, including that of 'configure'. The > optional argument BUG-REPORT should be the email to which users > should send bug reports. The package TARNAME differs from > PACKAGE: the latter designates the full package name (e.g., 'GNU > Autoconf'), while the former is meant for distribution tar ball > names (e.g., 'autoconf'). It defaults to PACKAGE with 'GNU ' > stripped, lower-cased, and all characters other than > alphanumerics and underscores are changed to '-'. Note also that by default (on autoconf v2.69), `docdir=@docdir@` in config.mk.in expands to the following in config.mk: docdir=${datarootdir}/doc/${PACKAGE_TARNAME} --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a3b2bf0eb..0ea19a48a 100644 --- a/Makefile +++ b/Makefile @@ -221,14 +221,14 @@ dist: config.mk make distclean mv config.status.old config.status mv config.sh.old config.sh - rm -fr $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.xz - mkdir -p $(NAME)-$(VERSION)/test - cp -a $(DISTFILES) $(NAME)-$(VERSION) - cp -a $(DISTFILES_TEST) $(NAME)-$(VERSION)/test - rm -rf $(NAME)-$(VERSION)/src/tools - find $(NAME)-$(VERSION) -name .svn -delete - tar -cJvf $(NAME)-$(VERSION).tar.xz $(NAME)-$(VERSION) - rm -fr $(NAME)-$(VERSION) + rm -fr $(TARNAME)-$(VERSION) $(TARNAME)-$(VERSION).tar.xz + mkdir -p $(TARNAME)-$(VERSION)/test + cp -a $(DISTFILES) $(TARNAME)-$(VERSION) + cp -a $(DISTFILES_TEST) $(TARNAME)-$(VERSION)/test + rm -rf $(TARNAME)-$(VERSION)/src/tools + find $(TARNAME)-$(VERSION) -name .svn -delete + tar -cJvf $(TARNAME)-$(VERSION).tar.xz $(TARNAME)-$(VERSION) + rm -fr $(TARNAME)-$(VERSION) asc: config.mk ./mkasc.sh $(VERSION) @@ -240,11 +240,11 @@ deb-apparmor: dist config.sh ./mkdeb.sh -apparmor --enable-apparmor test-compile: dist config.mk - cd test/compile; ./compile.sh $(NAME)-$(VERSION) + cd test/compile; ./compile.sh $(TARNAME)-$(VERSION) .PHONY: rpms rpms: src/man config.mk - ./platform/rpm/mkrpm.sh $(NAME) $(VERSION) + ./platform/rpm/mkrpm.sh $(TARNAME) $(VERSION) extras: all $(MAKE) -C extras/firetools -- cgit v1.2.3-54-g00ecf