-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
100 lines (90 loc) · 2.62 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
MAINTAINER = "Bo Bayles <bbayles+netsa@gmail.com>"
VERSION = 20211019
PROC_ARCH ?= amd64
TARGET_ROOT = $(shell pwd)/packaging/root
YAF_PREFIX = ${TARGET_ROOT}/opt/yaf
SILK_PREFIX = ${TARGET_ROOT}/opt/silk
LIBFIXBUF_PREFIX = ${TARGET_ROOT}/opt/libfixbuf
OUTPUT_DIR = $(shell pwd)/packaging/output
libfixbuf:
mkdir -p ${LIBFIXBUF_PREFIX}
(cd libfixbuf-src; \
autoreconf -if; \
./configure --prefix="${LIBFIXBUF_PREFIX}")
make -j -C libfixbuf-src
make -C libfixbuf-src install
yaf:
mkdir -p ${YAF_PREFIX}
(cd yaf-src; \
autoreconf -if; \
PKG_CONFIG_PATH="${LIBFIXBUF_PREFIX}/lib/pkgconfig" ./configure \
--prefix="${YAF_PREFIX}")
make -j -C yaf-src
make -C yaf-src install
silk:
mkdir -p ${SILK_PREFIX}
(cd silk-src; \
autoreconf -if; \
./configure \
--with-libfixbuf="${LIBFIXBUF_PREFIX}/lib/pkgconfig" \
--enable-ipv6 \
--prefix="${SILK_PREFIX}")
make -j -C silk-src
make -C silk-src install
deb:
fpm \
-s dir \
-t deb \
-n netsa-pkg \
-v ${VERSION} \
-p packaging/output/netsa-pkg.deb \
-a ${PROC_ARCH} \
--maintainer ${MAINTAINER} \
--category admin \
--force \
--description "YAF and SiLK from CERT NetSA Security Suite" \
--license "GPL version 2, LGPL version 2.1" \
--depends libglib2.0-0 \
--depends liblzo2-2 \
--depends libltdl7 \
--depends libpcap0.8 \
--depends libsnappy1v5 \
--depends zlib1g \
--after-install packaging/scripts/postinst.sh \
--after-remove packaging/scripts/postrm.sh \
--deb-no-default-config-files \
packaging/root/=/
rpm:
fpm \
-s dir \
-t rpm \
-n netsa-pkg \
-v ${VERSION} \
-p packaging/output/netsa-pkg.rpm \
-a ${PROC_ARCH} \
--maintainer ${MAINTAINER} \
--category admin \
--force \
--description "YAF and SiLK from CERT NetSA Security Suite" \
--license "GPL version 2, LGPL version 2.1" \
--depends glib2 \
--depends libpcap \
--depends libtool-ltdl \
--depends lzo \
--depends snappy \
--depends zlib \
--after-install packaging/scripts/postinst.sh \
--after-remove packaging/scripts/postrm.sh \
packaging/root/=/
build_deb: libfixbuf yaf silk deb
build_rpm: libfixbuf yaf silk rpm
build_ubuntu:
$(eval IMAGE_ID = $(shell docker build --force-rm -q -f "packaging/scripts/buildimage_ubuntu-16.04/Dockerfile" .))
docker run -v "${OUTPUT_DIR}:/netsa-pkg/packaging/output" $(IMAGE_ID) /usr/bin/make build_deb
chmod -R 776 ${OUTPUT_DIR}/*
build_centos:
$(eval IMAGE_ID = $(shell docker build --force-rm -q -f "packaging/scripts/buildimage_centos-7/Dockerfile" .))
docker run -v "${OUTPUT_DIR}:/netsa-pkg/packaging/output" $(IMAGE_ID) /usr/bin/make build_rpm
chmod -R 776 ${OUTPUT_DIR}/*
clean:
git clean -dxf