Unverified Commit 5ce1468d authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

suricata: 7.0.10 -> 8.0.2 (#472650)

parents 78eb7aa0 2fc2e374
Loading
Loading
Loading
Loading
+11 −19
Original line number Diff line number Diff line
*** suricata-5.0.0/ebpf/Makefile.in	2019-10-16 22:39:13.174649416 +0200
--- suricata-5.0.0/ebpf/Makefile.in.fixed	2019-10-16 22:38:41.822201802 +0200
***************
*** 527,533 ****
--- a/ebpf/Makefile.in
+++ b/ebpf/Makefile.in
@@ -530,7 +530,7 @@
 @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c
 #      From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm)
  @BUILD_EBPF_TRUE@	${CLANG} -Wall $(BPF_CFLAGS) -O2 \
! @BUILD_EBPF_TRUE@		-I/usr/include/$(build_cpu)-$(build_os)/ \
  @BUILD_EBPF_TRUE@		-D__KERNEL__ -D__ASM_SYSREG_H \
  @BUILD_EBPF_TRUE@		-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
  #      From LLVM-IR to BPF-bytecode in ELF-obj file
--- 527,533 ----
  @BUILD_EBPF_TRUE@$(BPF_TARGETS): %.bpf: %.c
  #      From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm)
  @BUILD_EBPF_TRUE@	${CLANG} -Wall $(BPF_CFLAGS) -O2 \
! @BUILD_EBPF_TRUE@		-idirafter ../bpf_stubs_workaround \
 @BUILD_EBPF_TRUE@	${CLANG} -Wall $(BPF_CFLAGS) -O2 -g \
-@BUILD_EBPF_TRUE@		-I/usr/include/$(build_cpu)-$(build_os)/ \
+@BUILD_EBPF_TRUE@		-idirafter ../bpf_stubs_workaround \
 @BUILD_EBPF_TRUE@		-D__KERNEL__ -D__ASM_SYSREG_H \
 @BUILD_EBPF_TRUE@		-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
 #      From LLVM-IR to BPF-bytecode in ELF-obj file
+11 −25
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
  clang,
  llvm,
  pkg-config,
  makeWrapper,
  elfutils,
  file,
  jansson,
@@ -39,17 +38,21 @@ let
in
stdenv.mkDerivation rec {
  pname = "suricata";
  version = "7.0.10";
  version = "8.0.2";

  src = fetchurl {
    url = "https://www.openinfosecfoundation.org/download/${pname}-${version}.tar.gz";
    hash = "sha256-GX+SXqcBvctKFaygJLBlRrACZ0zZWLWJWPKaW7IU11k=";
    hash = "sha256-nUUMosrb4QGZPpkDOmI0nSvanf2QpqzBvLbMbbdutVE=";
  };

  patches = lib.optionals stdenv.hostPlatform.is64bit [
    # Provide empty gnu/stubs-32.h for eBPF build
    ./bpf_stubs_workaround.patch
  ];

  nativeBuildInputs = [
    clang
    llvm
    makeWrapper
    pkg-config
  ]
  ++ lib.optionals rustSupport [
@@ -90,14 +93,7 @@ stdenv.mkDerivation rec {

  enableParallelBuilding = true;

  patches = lib.optional stdenv.hostPlatform.is64bit ./bpf_stubs_workaround.patch;

  postPatch = ''
    substituteInPlace ./configure \
      --replace "/usr/bin/file" "${file}/bin/file"
    substituteInPlace ./libhtp/configure \
      --replace "/usr/bin/file" "${file}/bin/file"

    mkdir -p bpf_stubs_workaround/gnu
    touch bpf_stubs_workaround/gnu/stubs-32.h
  '';
@@ -116,6 +112,7 @@ stdenv.mkDerivation rec {
    "--enable-python"
    "--enable-unix-socket"
    "--localstatedir=/var"
    "--runstatedir=/run"
    "--sysconfdir=/etc"
    "--with-libhs-includes=${lib.getDev vectorscan}/include/hs"
    "--with-libhs-libraries=${lib.getLib vectorscan}/lib"
@@ -142,17 +139,8 @@ stdenv.mkDerivation rec {
  doCheck = true;

  installFlags = [
    "e_datadir=\${TMPDIR}"
    "e_localstatedir=\${TMPDIR}"
    "e_logdir=\${TMPDIR}"
    "e_logcertsdir=\${TMPDIR}"
    "e_logfilesdir=\${TMPDIR}"
    "e_rundir=\${TMPDIR}"
    "e_sysconfdir=\${out}/etc/suricata"
    "e_sysconfrulesdir=\${out}/etc/suricata/rules"
    "localstatedir=\${TMPDIR}"
    "runstatedir=\${TMPDIR}"
    "sysconfdir=\${out}/etc"
    "DESTDIR=\${out}"
    "prefix=/"
  ];

  installTargets = [
@@ -161,10 +149,8 @@ stdenv.mkDerivation rec {
  ];

  postInstall = ''
    wrapProgram "$out/bin/suricatasc" \
      --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out")
    substituteInPlace "$out/etc/suricata/suricata.yaml" \
      --replace "/etc/suricata" "$out/etc/suricata"
      --replace-fail "/etc/suricata" "${placeholder "out"}/etc/suricata"
  '';

  passthru.tests = { inherit (nixosTests) suricata; };