blob: d6f5937d10ff068862631ef48cbb67256c863361 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "The Suricata Engine is an Open Source Next Generation Intrusion Detection and Prevention Engine"
2
3require suricata.inc
4
5LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=2;md5=c70d8d3310941dcdfcd1e02800a1f548"
6
7SRC_URI += "file://emerging.rules.tar.gz;name=rules"
8
9SRC_URI += " \
10 file://volatiles.03_suricata \
11 file://suricata.yaml \
12 file://suricata.service \
13 file://run-ptest \
14 "
15
16SRC_URI[rules.md5sum] = "205c5e5b54e489207ed892c03ad75b33"
17SRC_URI[rules.sha256sum] = "4aa81011b246875a57181c6a0569ca887845e366904bcaf0043220f33bd69798"
18
19inherit autotools-brokensep pkgconfig python3-dir systemd ptest
20
21CFLAGS += "-D_DEFAULT_SOURCE"
22
23CACHED_CONFIGUREVARS = "ac_cv_header_htp_htp_h=yes ac_cv_lib_htp_htp_conn_create=yes \
24 ac_cv_path_HAVE_WGET=no ac_cv_path_HAVE_CURL=no "
25
26EXTRA_OECONF += " --disable-debug \
27 --enable-non-bundled-htp \
28 --disable-gccmarch-native \
29 --disable-suricata-update \
30 "
31
32PACKAGECONFIG ??= "htp jansson file pcre yaml pcap cap-ng net nfnetlink nss nspr"
33PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'unittests', '', d)}"
34
35PACKAGECONFIG[htp] = "--with-libhtp-includes=${STAGING_INCDIR} --with-libhtp-libraries=${STAGING_LIBDIR}, ,libhtp,"
36PACKAGECONFIG[pcre] = "--with-libpcre-includes=${STAGING_INCDIR} --with-libpcre-libraries=${STAGING_LIBDIR}, ,libpcre ,"
37PACKAGECONFIG[yaml] = "--with-libyaml-includes=${STAGING_INCDIR} --with-libyaml-libraries=${STAGING_LIBDIR}, ,libyaml ,"
38PACKAGECONFIG[pcap] = "--with-libpcap-includes=${STAGING_INCDIR} --with-libpcap-libraries=${STAGING_LIBDIR}, ,libpcap ,"
39PACKAGECONFIG[cap-ng] = "--with-libcap_ng-includes=${STAGING_INCDIR} --with-libcap_ng-libraries=${STAGING_LIBDIR}, ,libcap-ng , "
40PACKAGECONFIG[net] = "--with-libnet-includes=${STAGING_INCDIR} --with-libnet-libraries=${STAGING_LIBDIR}, , libnet,"
41PACKAGECONFIG[nfnetlink] = "--with-libnfnetlink-includes=${STAGING_INCDIR} --with-libnfnetlink-libraries=${STAGING_LIBDIR}, ,libnfnetlink ,"
42PACKAGECONFIG[nfq] = "--enable-nfqueue, --disable-nfqueue,libnetfilter-queue,"
43
44PACKAGECONFIG[jansson] = "--with-libjansson-includes=${STAGING_INCDIR} --with-libjansson-libraries=${STAGING_LIBDIR},,jansson, jansson"
45PACKAGECONFIG[file] = ",,file, file"
46PACKAGECONFIG[nss] = "--with-libnss-includes=${STAGING_INCDIR} --with-libnss-libraries=${STAGING_LIBDIR}, nss, nss,"
47PACKAGECONFIG[nspr] = "--with-libnspr-includes=${STAGING_INCDIR} --with-libnspr-libraries=${STAGING_LIBDIR}, nspr, nspr,"
48PACKAGECONFIG[python] = "--enable-python, --disable-python, python3, python3"
49PACKAGECONFIG[unittests] = "--enable-unittests, --disable-unittests,"
50
51export logdir = "${localstatedir}/log"
52
53do_install_append () {
54
55 install -d ${D}${sysconfdir}/suricata
56
57 oe_runmake install-conf DESTDIR=${D}
58
59 # mimic move of downloaded rules to e_sysconfrulesdir
60 cp -rf ${WORKDIR}/rules ${D}${sysconfdir}/suricata
61
62 oe_runmake install-rules DESTDIR=${D}
63
64 install -d ${D}${sysconfdir}/suricata ${D}${sysconfdir}/default/volatiles
65 install -m 0644 ${WORKDIR}/volatiles.03_suricata ${D}${sysconfdir}/default/volatiles/volatiles.03_suricata
66
67 install -m 0644 ${S}/threshold.config ${D}${sysconfdir}/suricata
68
69 install -d ${D}${systemd_unitdir}/system
70 sed -e s:/etc:${sysconfdir}:g \
71 -e s:/var/run:/run:g \
72 -e s:/var:${localstatedir}:g \
73 -e s:/usr/bin:${bindir}:g \
74 -e s:/bin/kill:${base_bindir}/kill:g \
75 -e s:/usr/lib:${libdir}:g \
76 ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service
77
78 # Remove /var/run as it is created on startup
79 rm -rf ${D}${localstatedir}/run
80
81}
82
83pkg_postinst_ontarget_${PN} () {
84if [ -e /etc/init.d/populate-volatile.sh ] ; then
85 ${sysconfdir}/init.d/populate-volatile.sh update
86fi
87}
88
89SYSTEMD_PACKAGES = "${PN}"
90
91PACKAGES =+ "${PN}-socketcontrol"
92FILES_${PN} += "${systemd_unitdir}"
93FILES_${PN}-socketcontrol = "${bindir}/suricatasc ${PYTHON_SITEPACKAGES_DIR}"
94
95CONFFILES_${PN} = "${sysconfdir}/suricata/suricata.yaml"
96
97RDEPENDS_${PN}-python = "python"