summaryrefslogtreecommitdiff
path: root/package/audit/audit.mk
blob: 329f8c5aca13c8cc4c1c9410b5477f61263ff51b (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
################################################################################
#
# audit
#
################################################################################

AUDIT_VERSION = 2.4.4
AUDIT_SITE = http://people.redhat.com/sgrubb/audit
AUDIT_LICENSE = GPLv2
AUDIT_LICENSE_FILES = COPYING

AUDIT_INSTALL_STAGING = YES

AUDIT_CONF_OPTS = --without-python --without-python3 --disable-zos-remote

ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
AUDIT_DEPENDENCIES += libcap-ng
AUDIT_CONF_OPTS += --with-libcap-ng=yes
else
AUDIT_CONF_OPTS += --with-libcap-ng=no
endif

# For i386, x86-64 and PowerPC, the system call tables are
# unconditionally included. However, for ARM(eb) and AArch64, then
# need to be explicitly enabled.

ifeq ($(BR2_arm)$(BR2_armeb),y)
AUDIT_CONF_OPTS += --with-arm
endif
ifeq ($(BR2_aarch64),y)
AUDIT_CONF_OPTS += --with-aarch64
endif

ifeq ($(BR2_INIT_SYSTEMD),y)
AUDIT_CONF_OPTS += --enable-systemd
else
AUDIT_CONF_OPTS += --disable-systemd
endif

define AUDIT_INSTALL_INIT_SYSV
	$(INSTALL) -D -m 755 package/audit/S01auditd $(TARGET_DIR)/etc/init.d/S01auditd
endef

define AUDIT_INSTALL_INIT_SYSTEMD
	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
	ln -fs ../../../../usr/lib/systemd/system/auditd.service \
		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/auditd.service

	mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
	$(INSTALL) -D -m 644 package/audit/audit_tmpfiles.conf \
		$(TARGET_DIR)/usr/lib/tmpfiles.d/audit.conf
endef

define AUDIT_INSTALL_CLEANUP
	$(RM) -rf $(TARGET_DIR)/etc/rc.d
	$(RM) -rf $(TARGET_DIR)/etc/sysconfig
endef
AUDIT_POST_INSTALL_TARGET_HOOKS += AUDIT_INSTALL_CLEANUP

$(eval $(autotools-package))