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