diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-01 14:14:19 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-01 16:07:46 +0200 |
commit | 9be3a9c1f09448652e7b91e6722968ac79f5aa4d (patch) | |
tree | 4f008515e902d5cdb8ed9f2ff432e6e2329f4e40 /scripts | |
parent | 2afa0db66f14f4adc9e0f76b893ee0dc580ad557 (diff) | |
download | calcurse-9be3a9c1f09448652e7b91e6722968ac79f5aa4d.zip |
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 12 | ||||
-rw-r--r-- | scripts/calcurse-upgrade.sh.in (renamed from scripts/calcurse-upgrade.sh) | 0 |
2 files changed, 9 insertions, 3 deletions
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 "$@" diff --git a/scripts/calcurse-upgrade.sh b/scripts/calcurse-upgrade.sh.in index bf3f92e..bf3f92e 100644 --- a/scripts/calcurse-upgrade.sh +++ b/scripts/calcurse-upgrade.sh.in |