blob: 6c0a109be0217b163356a9c023d59f6c93ee042f [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "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 python-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 "
30
31PACKAGECONFIG ??= "htp jansson file pcre yaml pcap cap-ng net nfnetlink nss nspr"
32PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'unittests', '', d)}"
33
34PACKAGECONFIG[htp] = "--with-libhtp-includes=${STAGING_INCDIR} --with-libhtp-libraries=${STAGING_LIBDIR}, ,libhtp,"
35PACKAGECONFIG[pcre] = "--with-libpcre-includes=${STAGING_INCDIR} --with-libpcre-libraries=${STAGING_LIBDIR}, ,libpcre ,"
36PACKAGECONFIG[yaml] = "--with-libyaml-includes=${STAGING_INCDIR} --with-libyaml-libraries=${STAGING_LIBDIR}, ,libyaml ,"
37PACKAGECONFIG[pcap] = "--with-libpcap-includes=${STAGING_INCDIR} --with-libpcap-libraries=${STAGING_LIBDIR}, ,libpcap ,"
38PACKAGECONFIG[cap-ng] = "--with-libcap_ng-includes=${STAGING_INCDIR} --with-libcap_ng-libraries=${STAGING_LIBDIR}, ,libcap-ng , "
39PACKAGECONFIG[net] = "--with-libnet-includes=${STAGING_INCDIR} --with-libnet-libraries=${STAGING_LIBDIR}, , libnet,"
40PACKAGECONFIG[nfnetlink] = "--with-libnfnetlink-includes=${STAGING_INCDIR} --with-libnfnetlink-libraries=${STAGING_LIBDIR}, ,libnfnetlink ,"
41PACKAGECONFIG[nfq] = "--enable-nfqueue, --disable-nfqueue,libnetfilter-queue,"
42
43PACKAGECONFIG[jansson] = "--with-libjansson-includes=${STAGING_INCDIR} --with-libjansson-libraries=${STAGING_LIBDIR},,jansson, jansson"
44PACKAGECONFIG[file] = ",,file, file"
45PACKAGECONFIG[nss] = "--with-libnss-includes=${STAGING_INCDIR} --with-libnss-libraries=${STAGING_LIBDIR}, nss, nss,"
46PACKAGECONFIG[nspr] = "--with-libnspr-includes=${STAGING_INCDIR} --with-libnspr-libraries=${STAGING_LIBDIR}, nspr, nspr,"
47PACKAGECONFIG[python] = "--enable-python, --disable-python, python, python"
48PACKAGECONFIG[unittests] = "--enable-unittests, --disable-unittests,"
49
50export logdir = "${localstatedir}/log"
51
52do_install_append () {
53
54 install -d ${D}${sysconfdir}/suricata
55
56 oe_runmake install-conf DESTDIR=${D}
57
58 # mimic move of downloaded rules to e_sysconfrulesdir
59 cp -rf ${WORKDIR}/rules ${D}${sysconfdir}/suricata
60
61 oe_runmake install-rules DESTDIR=${D}
62
63 install -d ${D}${sysconfdir}/suricata ${D}${sysconfdir}/default/volatiles
64 install -m 0644 ${WORKDIR}/volatiles.03_suricata ${D}${sysconfdir}/default/volatiles/volatiles.03_suricata
65
66 install -m 0644 ${S}/threshold.config ${D}${sysconfdir}/suricata
67
68 install -d ${D}${systemd_unitdir}/system
69 sed -e s:/etc:${sysconfdir}:g \
70 -e s:/var/run:/run:g \
71 -e s:/var:${localstatedir}:g \
72 -e s:/usr/bin:${bindir}:g \
73 -e s:/bin/kill:${base_bindir}/kill:g \
74 -e s:/usr/lib:${libdir}:g \
75 ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service
76
77 # Remove /var/run as it is created on startup
78 rm -rf ${D}${localstatedir}/run
79
80}
81
82pkg_postinst_ontarget_${PN} () {
83if [ -e /etc/init.d/populate-volatile.sh ] ; then
84 ${sysconfdir}/init.d/populate-volatile.sh update
85fi
86}
87
88SYSTEMD_PACKAGES = "${PN}"
89
90PACKAGES =+ "${PN}-socketcontrol"
91FILES_${PN} += "${systemd_unitdir}"
92FILES_${PN}-socketcontrol = "${bindir}/suricatasc ${PYTHON_SITEPACKAGES_DIR}"
93
94CONFFILES_${PN} = "${sysconfdir}/suricata/suricata.yaml"
95
96RDEPENDS_${PN}-python = "python"