]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
scripts/setup-app-layer: fix Makefile.am patch
authorJuliana Fajardini <jufajardini@gmail.com>
Thu, 18 Mar 2021 18:23:23 +0000 (18:23 +0000)
committerVictor Julien <victor@inliniac.net>
Thu, 1 Apr 2021 13:46:46 +0000 (15:46 +0200)
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.

scripts/setup-app-layer.py

index 0b375c1ac290cde2b4f611786485df0c442c3b46..d0f0b0e72be9495f4f8b5aac13d9a7aef36800d6 100755 (executable)
@@ -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__":