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 <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-06-01 14:14:19 +02:00
parent 2afa0db66f
commit 9be3a9c1f0
3 changed files with 10 additions and 4 deletions

View File

@ -27,4 +27,4 @@ src/utils.c
src/vars.c
src/wins.c
scripts/calcurse-upgrade.sh
scripts/calcurse-upgrade.sh.in

View File

@ -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 "$@"