summaryrefslogtreecommitdiffstats
path: root/recipes-security/audit/audit_2.2.1.bb
blob: 34cfda1b575a9a06e310c0781f9a2cbfd84d5e70 (plain)
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
SUMMARY = "User space tools for kernel auditing"
DESCRIPTION = "The audit package contains the user space utilities for \
storing and searching the audit records generated by the audit subsystem \
in the Linux kernel."
HOMEPAGE = "http://people.redhat.com/sgrubb/audit/"
SECTION = "base"
PR = "r1"
LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"

SRC_URI = "http://people.redhat.com/sgrubb/audit/audit-${PV}.tar.gz \
	   file://disable-ldap.patch \
	   file://audit-python.patch"

SRC_URI += "file://2.2.1-audit-for-cross-compiling.patch \
	   file://audit-python-configure.patch \
	   file://sbin-in-usr.patch \
	   file://auditd"

inherit autotools

SRC_URI[md5sum] = "dc099fcb2f9242d47ecc35b46d71dfd1"
SRC_URI[sha256sum] = "9865ca89f5b975ccf25441ddf45a874448f2bba944005aa8cd5e3c3148713a63"

DEPENDS += "python tcp-wrappers libcap-ng linux-libc-headers (>= 2.6.30)"

EXTRA_OECONF += "--without-prelude --with-libwrap --enable-gssapi-krb5=no --disable-ldap --with-libcap-ng=yes --with-python=yes"

EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' PYINC='${STAGING_INCDIR}/$(PYLIBVER)'"

SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher"
DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \
interface to the audit system, audispd. These plugins can do things \
like relay events to remote machines or analyze events for suspicious \
behavior."

PACKAGES =+ "audispd-plugins ${PN}-libs"
PACKAGES += "${PN}-python"

FILES_${PN}-libs += "${sysconfdir}/libaudit.conf ${libdir}/libaudit.so.1* ${libdir}/libauparse.so.*"
FILES_${PN} += "${bindir} ${sbindir}"
FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \
	${sysconfdir}/audisp/plugins.d/au-remote.conf \
	${base_sbindir}/audisp-remote ${localstatedir}/spool/audit \
	${mandir}/man8/audisp-remote.8 ${mandir}/man5/audisp-remote.conf.5"
FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug"
FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"

# The executables in lib/, which are named as gen_*_h, will run on the hosts to create
# *_tables.h/*tabs.h header files for the targets.
# In some old hosts, build will fail because some .h files in the old linux-libc-headers (<= 2.6.29)
# has incomplete DEFINE lists for the audit system.
do_compile_prepend() {
	mkdir -p ${S}/lib/linux
	cp -f ${STAGING_INCDIR}/linux/audit.h ${S}/lib/linux/
	cp -f ${STAGING_INCDIR}/linux/elf-em.h ${S}/lib/linux/
	cp -f ${STAGING_INCDIR}/linux/net.h ${S}/lib/linux/
	mkdir -p ${S}/lib/sys
	cp -f ${STAGING_INCDIR}/sys/mount.h ${S}/lib/sys/
	cp -f ${STAGING_INCDIR}/sys/personality.h ${S}/lib/sys/
	mkdir -p ${S}/lib/bits
	cp -f ${STAGING_INCDIR}/bits/socket.h ${S}/lib/bits
}

do_install_append() {
	rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a
	rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la

	# reuse auditd config
	[ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default
	mv ${D}/etc/sysconfig/auditd ${D}/etc/default
	rmdir ${D}/etc/sysconfig/

	# replace init.d
	install -D -m 0755 ${S}/../auditd ${D}/etc/init.d/auditd
	rm -rf ${D}/etc/rc.d
}