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