From 9be3a9c1f09448652e7b91e6722968ac79f5aa4d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 1 Jun 2012 14:14:19 +0200 Subject: scripts/: Add support for placeholders Allow for specifying placeholders in shell scripts that are replaced during build time. Predefine a "@PACKAGE_VERSION@" placeholder that is replaced with the current version number. Also, rename all shell scripts to ".sh.in". Signed-off-by: Lukas Fleischer --- scripts/Makefile.am | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/Makefile.am') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5502cfd..fc0b83b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -4,10 +4,16 @@ dist_bin_SCRIPTS = \ calcurse-upgrade EXTRA_DIST = \ - calcurse-upgrade.sh + calcurse-upgrade.sh.in CLEANFILES = \ calcurse-upgrade -calcurse-upgrade: calcurse-upgrade.sh - $(AM_V_GEN) $(INSTALL) $< $@ +edit = sed \ + -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' + +calcurse-upgrade: calcurse-upgrade.sh.in + $(AM_V_at)$(RM) "$@" + $(AM_V_GEN)$(edit) <"$(srcdir)/$<" >"$@" + $(AM_V_at)chmod +x "$@" + $(AM_V_at)chmod a-w "$@" -- cgit v1.2.3-54-g00ecf