From fed79332fcf8facabe02d33933676f0b8c466f04 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Wed, 13 Jun 2018 11:37:11 -0500 Subject: [PATCH] New package: bro-2.5.4 --- srcpkgs/binpac | 1 + srcpkgs/binpac-devel | 1 + srcpkgs/bro/files/bro/run | 10 +++++ srcpkgs/bro/patches/musl.patch | 74 ++++++++++++++++++++++++++++++++++ srcpkgs/bro/template | 48 ++++++++++++++++++++++ 5 files changed, 134 insertions(+) create mode 120000 srcpkgs/binpac create mode 120000 srcpkgs/binpac-devel create mode 100644 srcpkgs/bro/files/bro/run create mode 100644 srcpkgs/bro/patches/musl.patch create mode 100644 srcpkgs/bro/template diff --git a/srcpkgs/binpac b/srcpkgs/binpac new file mode 120000 index 00000000000..52815503047 --- /dev/null +++ b/srcpkgs/binpac @@ -0,0 +1 @@ +bro \ No newline at end of file diff --git a/srcpkgs/binpac-devel b/srcpkgs/binpac-devel new file mode 120000 index 00000000000..52815503047 --- /dev/null +++ b/srcpkgs/binpac-devel @@ -0,0 +1 @@ +bro \ No newline at end of file diff --git a/srcpkgs/bro/files/bro/run b/srcpkgs/bro/files/bro/run new file mode 100644 index 00000000000..90eb6a59c0c --- /dev/null +++ b/srcpkgs/bro/files/bro/run @@ -0,0 +1,10 @@ +#!/bin/sh + +BROLOGDIR="/var/log/bro" + +[ -r conf ] && . ./conf + +[ -d ${BROLOGDIR} ] || mkdir -p ${BROLOGDIR} + +cd /var/log/bro +exec bro -i ${INTF:=eth0} ${BROPOLICY} diff --git a/srcpkgs/bro/patches/musl.patch b/srcpkgs/bro/patches/musl.patch new file mode 100644 index 00000000000..e8a2c6da9d5 --- /dev/null +++ b/srcpkgs/bro/patches/musl.patch @@ -0,0 +1,74 @@ +https://github.com/danielguerra69/docker-bro-1 + +--- aux/binpac/lib/binpac.h.in.orig ++++ aux/binpac/lib/binpac.h.in +@@ -4,6 +4,7 @@ + #define binpac_h + + #include ++#include + + #cmakedefine HOST_BIGENDIAN + #ifdef HOST_BIGENDIAN + +--- src/OSFinger.h.orig ++++ src/OSFinger.h +@@ -166,3 +166,57 @@ + #define MATCHFUZZY 0x2 + + #endif ++ ++// For musl-libc ++#ifndef TCPOPT_EOL ++# define TCPOPT_EOL 0 ++#endif ++ ++#ifndef TCPOPT_NOP ++# define TCPOPT_NOP 1 ++#endif ++ ++#ifndef TCPOPT_MAXSEG ++# define TCPOPT_MAXSEG 2 ++#endif ++ ++#ifndef TCPOLEN_MAXSEG ++# define TCPOLEN_MAXSEG 4 ++#endif ++ ++#ifndef TCPOPT_WINDOW ++# define TCPOPT_WINDOW 3 ++#endif ++ ++#ifndef TCPOLEN_WINDOW ++# define TCPOLEN_WINDOW 3 ++#endif ++ ++#ifndef TCPOPT_SACK_PERMITTED ++# define TCPOPT_SACK_PERMITTED 4 /* Experimental */ ++#endif ++ ++#ifndef TCPOLEN_SACK_PERMITTED ++# define TCPOLEN_SACK_PERMITTED 2 ++#endif ++ ++#ifndef TCPOPT_SACK ++# define TCPOPT_SACK 5 /* Experimental */ ++#endif ++ ++#ifndef TCPOPT_TIMESTAMP ++# define TCPOPT_TIMESTAMP 8 ++#endif ++ ++#ifndef TCPOLEN_TIMESTAMP ++# define TCPOLEN_TIMESTAMP 10 ++#endif ++ ++#ifndef TCPOLEN_TSTAMP_APPA ++# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ ++#endif ++ ++#ifndef TCPOPT_TSTAMP_HDR ++# define TCPOPT_TSTAMP_HDR \ ++ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) ++#endif + diff --git a/srcpkgs/bro/template b/srcpkgs/bro/template new file mode 100644 index 00000000000..c5ff0445a5a --- /dev/null +++ b/srcpkgs/bro/template @@ -0,0 +1,48 @@ +# Template file for 'bro' +pkgname=bro +version=2.5.4 +revision=1 +build_style=cmake +nocross="Needs to build part of itself to run, can't be built separately yet." +hostmakedepends="flex pkg-config python3" +makedepends="bind-devel geoip-devel libpcap-devel libressl-devel jemalloc-devel" +short_desc="Advanced framework for network traffic analysis" +maintainer="Andrew Benson " +license="BSD-3-Clause" +homepage="https://www.bro.org" +distfiles="https://www.bro.org/downloads/bro-${version}.tar.gz" +checksum=80daea433fa654f2602cf67b19b9121ff6ad57761bad73cc29020c4f490c5f1f + +case "$XBPS_TARGET_MACHINE" in + *-musl) + makedepends+=" musl-fts-devel" + ;; +esac + +pre_configure() { + case "$XBPS_TARGET_MACHINE" in + *-musl) + sed -i '/set(broxygen/i link_libraries("-lfts")' src/broxygen/CMakeLists.txt + ;; + esac +} + +post_install() { + vsv bro + vlicense COPYING +} + +binpac_package() { + short_desc+=" - protocol parser compiler" + pkg_install() { + vmove /usr/bin/binpac + } +} + +binpac-devel_package() { + short_desc+=" - protocol parser compiler library" + pkg_install() { + vmove /usr/include + vmove "/usr/lib/*.a" + } +}