avahi: backport CVE fixes from upstream
[feed/packages.git] / utils / audit / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=audit
9 PKG_VERSION:=2.8.5
10 PKG_RELEASE:=7
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=http://people.redhat.com/sgrubb/audit
14 PKG_HASH:=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
15
16 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
17 PKG_LICENSE:=GPL-2.0-or-later
18 PKG_LICENSE_FILES:=COPYING
19 PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
20
21 PKG_FIXUP:=autoreconf
22 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-packages/$(PKG_NAME)-$(PKG_VERSION)
23
24 PKG_BUILD_FLAGS:=no-mips16
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/audit/Default
29 TITLE:=Audit Daemon
30 URL:=http://people.redhat.com/sgrubb/audit/
31 endef
32
33 define Package/audit/Default/description
34 The audit package contains the user space utilities for
35 storing and searching the audit records generated by
36 the audit subsystem in the Linux 2.6 kernel
37 endef
38
39 define Package/libauparse
40 $(call Package/audit/Default)
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE+= (parsing shared library)
44 DEPENDS:= +libaudit
45 endef
46
47 define Package/libauparse/description
48 $(call Package/audit/Default/description)
49 This package contains the audit parsing shared library.
50 endef
51
52 define Package/audit-utils
53 $(call Package/audit/Default)
54 SECTION:=utils
55 CATEGORY:=Utilities
56 TITLE+= (utilities)
57 DEPENDS:= +libaudit +libauparse
58 endef
59
60 define Package/audit-utils/description
61 $(call Package/audit/Default/description)
62 This package contains the audit utilities.
63 endef
64
65 define Package/audit
66 $(call Package/audit/Default)
67 SECTION:=utils
68 CATEGORY:=Utilities
69 TITLE+= (daemon)
70 DEPENDS:= +libaudit +libauparse +audit-utils +libev
71 endef
72
73 define Package/audit/description
74 $(call Package/audit/Default/description)
75 This package contains the audit daemon.
76 endef
77
78 CONFIGURE_VARS += \
79 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
80 CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
81 CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
82 CC_FOR_BUILD="$(HOSTCC)"
83
84 CONFIGURE_ARGS += \
85 --without-libcap-ng \
86 --disable-systemd \
87 --without-python \
88 --without-python3 \
89 --disable-zos-remote
90
91 ifeq ($(ARCH),aarch64)
92 CONFIGURE_ARGS += --with-aarch64
93 else ifeq ($(ARCH),arm)
94 CONFIGURE_ARGS += --with-arm
95 endif
96
97 # We can't use the default, as the default passes $(MAKE_ARGS), which
98 # overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions
99 # passed in CONFIGURE_VARS
100 define Build/Compile
101 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
102 endef
103
104 define Build/Install
105 $(call Build/Install/Default,install)
106 $(SED) 's%^dispatcher *=.*%dispatcher = /usr/sbin/audispd%' $(PKG_INSTALL_DIR)/etc/audit/auditd.conf
107 endef
108
109 define Build/InstallDev
110 $(INSTALL_DIR) $(1)/usr/include
111 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
112 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
113 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
116 endef
117
118 define Package/libauparse/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libauparse.so.* $(1)/usr/lib/
121 endef
122
123 define Package/audit-utils/install
124 $(INSTALL_DIR) $(1)/usr/bin
125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
126 $(INSTALL_DIR) $(1)/usr/sbin
127 $(CP) \
128 $(PKG_INSTALL_DIR)/usr/sbin/{augenrules,audispd,audisp-remote,auditctl,autrace,aureport,ausearch} \
129 $(1)/usr/sbin/
130 endef
131
132 define Package/audit/install
133 $(INSTALL_DIR) $(1)/etc/audit
134 $(CP) $(PKG_INSTALL_DIR)/etc/audit/* $(1)/etc/audit/
135 $(INSTALL_DIR) $(1)/etc/init.d
136 $(INSTALL_BIN) ./files/audit.init $(1)/etc/init.d/audit
137 $(INSTALL_DIR) $(1)/usr/sbin
138 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/auditd $(1)/usr/sbin/
139 endef
140
141 $(eval $(call BuildPackage,libauparse))
142 $(eval $(call BuildPackage,audit-utils))
143 $(eval $(call BuildPackage,audit))