From 16a21d78397ea13a5ca1b4c22f839ab6626a7580 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 29 Oct 2020 17:05:01 -0600 Subject: [PATCH] scripts: bundle script for requirements Add a bundle.sh script to bundle the requirements of libhtp and suricata-update. This uses a Python like requirements.txt file to specify the URL to download for libhtp and suricata-update. --- requirements.txt | 2 ++ scripts/bundle.sh | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 requirements.txt create mode 100755 scripts/bundle.sh diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..4a1d935583 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +libhtp https://github.com/OISF/libhtp/archive/0.5.x.tar.gz +suricata-update https://github.com/OISF/suricata-update/archive/master.tar.gz diff --git a/scripts/bundle.sh b/scripts/bundle.sh new file mode 100755 index 0000000000..f630403990 --- /dev/null +++ b/scripts/bundle.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env bash + +while IFS= read -r requirement; do + set -- $requirement + case "$1" in + suricata-update) + echo "===> Fetching $1" + (cd suricata-update && + curl -Ls "$2" | tar zxf - --strip-components=1) + ;; + libhtp) + echo "===> Fetching $1" + mkdir -p libhtp + (cd libhtp && + curl -Ls "$2" | tar zxf - --strip-components=1) + ;; + *) + echo "error: unknown requirement: $1" + ;; + esac +done < ./requirements.txt -- 2.47.2