From: Juliana Fajardini Date: Thu, 18 Mar 2021 18:23:23 +0000 (+0000) Subject: scripts/setup-app-layer: fix Makefile.am patch X-Git-Tag: suricata-7.0.0-beta1~1701 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4748826dc77d4b39fed6c27d419cb2f90392124f;p=thirdparty%2Fsuricata.git scripts/setup-app-layer: fix Makefile.am patch adjust lines for patching /src/Makefile.am, as current generated Makefile wasn't building Suricata. Add suggestion to run "./configure" before running "make". Add --logger and --parser options to examples. --- diff --git a/scripts/setup-app-layer.py b/scripts/setup-app-layer.py index 0b375c1ac2..d0f0b0e72b 100755 --- a/scripts/setup-app-layer.py +++ b/scripts/setup-app-layer.py @@ -90,7 +90,7 @@ def patch_makefile_am(protoname): output = io.StringIO() with open("src/Makefile.am") as infile: for line in infile: - if line.startswith("app-layer-template.c"): + if line.lstrip().startswith("app-layer-template."): output.write(line.replace("template", protoname.lower())) output.write(line) open("src/Makefile.am", "w").write(output.getvalue()) @@ -277,7 +277,7 @@ def logger_patch_makefile_am(protoname): output = io.StringIO() with open(filename) as infile: for line in infile: - if line.startswith("output-json-template.c"): + if line.lstrip().startswith("output-json-template."): output.write(line.replace("template", protoname.lower())) output.write(line) open(filename, "w").write(output.getvalue()) @@ -337,7 +337,7 @@ def detect_patch_makefile_am(protoname, buffername): output = io.StringIO() with open(filename) as infile: for line in infile: - if line.startswith("detect-template-buffer.c"): + if line.lstrip().startswith("detect-template-buffer."): new = line.replace("template-buffer", "%s-%s" % ( protoname.lower(), buffername.lower())) output.write(new) @@ -397,8 +397,8 @@ just one or the other use the --parser or --logger command line flags. Examples: - %(progname)s DNP3 - %(progname)s Gopher + %(progname)s --logger DNP3 + %(progname)s --parser Gopher This script can also setup a detect buffer. This is a separate operation that must be done after creating the parser. @@ -545,7 +545,7 @@ The following files have been created and linked into the build: if parser or logger: print(""" -Suricata should now build cleanly. Try running "make". +Suricata should now build cleanly. Try running "./configure" and "make". """) if __name__ == "__main__":