summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-12-02 17:34:07 +0000
committerng0 <ng0@n0.is>2019-12-02 17:34:07 +0000
commit339d7a7d8ca789f9777501c3092e5c7ea0c4850a (patch)
tree5110bf9188f3c0c6d102cd4bf45d2325a5ff4136 /bin
parent79ff68acae7e4774881d6bc53fc5c639da4a2e7b (diff)
parentfdf8c95a33fe6c81c93cd17ed7a38b8b55df7d54 (diff)
Merge branch 'master' into netbsd-supportnetbsd-support
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile.am6
-rwxr-xr-xbin/dosubst.awk47
2 files changed, 53 insertions, 0 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
new file mode 100644
index 000000000..6c11e26ef
--- /dev/null
+++ b/bin/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = \
+ dosubst.awk \
+ grephdr.sh \
+ grepsrc.sh \
+ pogen.sh \
+ rename.sh
diff --git a/bin/dosubst.awk b/bin/dosubst.awk
new file mode 100755
index 000000000..3ed0403dd
--- /dev/null
+++ b/bin/dosubst.awk
@@ -0,0 +1,47 @@
+# Dedicated to the public domain.
+# SPDX-License-Identifier: 0BSD
+#
+# awk script to substitute variables in scripts and applications.
+#
+# You can pass these variables to it in Makefiles or on the
+# commandline:
+# bdir="$(bindir)"
+# py="$(PYTHON)"
+# awkay="$(AWK_BINARY)"
+# pfx="$(prefix)"
+# prl="$(PERL)"
+# sysconfdirectory="$(sysconfdir)"
+# pkgdatadirectory="$(pkgdatadir)"
+
+{
+
+ if (/@bindirectory@/) {
+ gsub("@bindirectory@",bdir) ;
+ }
+
+ if (/@PYTHONEXE@/) {
+ gsub("@PYTHONEXE@",py) ;
+ }
+
+ if (/@AWKEXE@/) {
+ gsub("@AWKEXE@",awkay) ;
+ }
+
+ if (/@SUBSTPREFIX@/) {
+ gsub("@SUBSTPREFIX@",pfx) ;
+ }
+
+ if (/@PERLEXE@/) {
+ gsub("@PERLEXE@",prl) ;
+ }
+
+ if (/@SYSCONFDIR@/) {
+ gsub("@SYSCONFDIR@",sysconfdirectory) ;
+ }
+
+ if (/@PKGDATADIRECTORY@/) {
+ gsub("@PKGDATADIRECTORY@",pkgdatadirectory) ;
+ }
+
+ print $0 ;
+}