summaryrefslogtreecommitdiff
path: root/contrib/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts')
-rw-r--r--contrib/scripts/.gitignore1
-rw-r--r--contrib/scripts/Makefile.am24
-rwxr-xr-xcontrib/scripts/check-texinfo.awk.in59
-rw-r--r--contrib/scripts/gnunet-logread/Makefile.am14
-rwxr-xr-xcontrib/scripts/gnunet-logread/gnunet-logread.in2
5 files changed, 91 insertions, 9 deletions
diff --git a/contrib/scripts/.gitignore b/contrib/scripts/.gitignore
index 547c89185..3b34b9b69 100644
--- a/contrib/scripts/.gitignore
+++ b/contrib/scripts/.gitignore
@@ -1,2 +1,3 @@
gnunet-chk.py
removetrailingwhitespace.py
+check-texinfo.awk
diff --git a/contrib/scripts/Makefile.am b/contrib/scripts/Makefile.am
index 367e5c4c9..f8b7ec3d1 100644
--- a/contrib/scripts/Makefile.am
+++ b/contrib/scripts/Makefile.am
@@ -9,7 +9,16 @@ noinst_SCRIPTS = \
removetrailingwhitespace.py \
gnunet_pyexpect.py \
gnunet_janitor.py \
- gnunet-chk.py
+ gnunet-chk.py \
+ $(awkSCRIPTS)
+
+# FIXME: read into AWK_SCRIPTS autotools builtin.
+if HAVE_AWK
+awkSCRIPTS = \
+ check-texinfo.awk
+else
+awkSCRIPTS =
+endif
bin_SCRIPTS = \
gnunet-bugreport \
@@ -24,13 +33,12 @@ EXTRA_DIST = \
$(SCRIPTS) \
removetrailingwhitespace.py.in \
pydiffer.py.in \
- gnunet-suidfix
+ gnunet-suidfix \
+ check-texinfo.awk.in
CLEANFILES = \
$(noinst_SCRIPTS)
-do_subst = $(AWK) -v py="$(PYTHON)" '{gsub("@PYTHONEXE@",py); print $$0}'
-
# Use SUFFIX Extension rules, they are more portable for every
# implementation of 'make'.
# You'll also run into the "'%' is a GNU make extension warning"
@@ -44,5 +52,11 @@ do_subst = $(AWK) -v py="$(PYTHON)" '{gsub("@PYTHONEXE@",py); print $$0}'
SUFFIXES = .py.in .py
.py.in.py:
- $(do_subst) < $< > $@
+ $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $< > $@
chmod +x $@
+
+if HAVE_AWK
+check-texinfo.awk: check-texinfo.awk.in Makefile
+ $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk
+ chmod +x check-texinfo.awk
+endif
diff --git a/contrib/scripts/check-texinfo.awk.in b/contrib/scripts/check-texinfo.awk.in
new file mode 100755
index 000000000..37e2c9f20
--- /dev/null
+++ b/contrib/scripts/check-texinfo.awk.in
@@ -0,0 +1,59 @@
+#!@AWKEXE@ -f
+#
+# Dedicated to the Public Domain.
+# SPDX-License-Identifier: 0BSD
+#
+# exception to add: ignore license files.
+# exception to add: uref's can go above 79 chars.
+
+
+BEGIN {
+ printf "Running basic texinfo linters\n" ;
+}
+
+{
+ if(/\t/) {
+ printf "...lines containing tabstops?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
+
+{
+ if(length>79) {
+ printf "...line length over 79 chars?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
+
+{
+ if(/@geq\{\}/) {
+ printf "...lines containing macros incompatible with old makeinfo?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
+
+{
+ if (/@footnote\{/) {
+ printf "...lines containing macros incompatible with texi2mdoc?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
+
+{
+ if (/TODO/) {
+ printf "...lines telling us what is left TODO?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+
+ if (/XXX/) {
+ printf "...lines telling us what is left to fix?\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
+
+{
+ if (/wether/) {
+ printf "...lines containing a popular typo\n" ;
+ print FILENAME":"NR":"$0 ;
+ }
+}
diff --git a/contrib/scripts/gnunet-logread/Makefile.am b/contrib/scripts/gnunet-logread/Makefile.am
index 790b58fea..aa92dfe16 100644
--- a/contrib/scripts/gnunet-logread/Makefile.am
+++ b/contrib/scripts/gnunet-logread/Makefile.am
@@ -1,7 +1,7 @@
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
-do_subst = $(AWK) -v py="$(PERL)" '{gsub("@PERLEXE@",py); print $$0}'
+do_subst = $(AWK) -v prl="$(PERL)" -v pfx="$(prefix)" '{if (/@SUBSTPREFIX@/) { gsub("@SUBSTPREFIX@",pfx)}; gsub("@PERLEXE@",prl); print $$0}'
SUFFIXES = .in
@@ -17,9 +17,17 @@ CLEANFILES= \
gnunet-logread \
gnunet-logread-ipc-sdedit
+if GNUNET_LOGREAD
+if HAVE_PERL
+bin_SCRIPTS = \
+ gnunet-logread-ipc \
+ $(CLEANFILES)
+else
noinst_SCRIPTS = \
- $(CLEANFILES) \
- gnunet-logread-ipc
+ gnunet-logread-ipc \
+ $(CLEANFILES)
+endif
+endif
EXTRA_DIST = \
gnunet-logread.in \
diff --git a/contrib/scripts/gnunet-logread/gnunet-logread.in b/contrib/scripts/gnunet-logread/gnunet-logread.in
index e27c1d3fc..ce588b8e6 100755
--- a/contrib/scripts/gnunet-logread/gnunet-logread.in
+++ b/contrib/scripts/gnunet-logread/gnunet-logread.in
@@ -29,7 +29,7 @@ my %levels = ( NONE => 0, ERROR => 1, WARNING => 2, INFO => 4, DEBUG => 8 );
# Message type numbers to names
my %msgtypes;
-my $prefix = $ENV{GNUNET_PREFIX} || '/usr';
+my $prefix = $ENV{GNUNET_PREFIX} || '@SUBSTPREFIX@';
my $filename = "$prefix/include/gnunet/gnunet_protocols.h";
$ipc = $opts{s} || $DEFAULT_SOCKET;