diff options
author | Marius Dinu <m95d+git@psihoexpert.ro> | 2024-03-31 14:22:18 +0300 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2024-04-29 00:53:43 +0200 |
commit | ff0bb196ebba5dac4d3e77738c7d79934600b32c (patch) | |
tree | b308ad3585ad69b6d753a5aa7e6235c327e9b46e /package/utils | |
parent | c390c6c7090c7d66471dac6079343a697afc59ba (diff) |
libaudit: update to 3.1.4, join with daemon and utils, rename
Changes:
- new URL for sources (old address is dead)
- daemon and utils from packages feed are merged in here
- only build once
- no need to update at the same time in both places
- update to v3.1.4
- removed unneeded patches
- added audisp-syslog
- removed audispd (no longer exists)
- rename and move to package/utils/audit
- update new path in one dependent package
Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Diffstat (limited to 'package/utils')
-rw-r--r-- | package/utils/audit/Makefile | 184 | ||||
-rw-r--r-- | package/utils/audit/files/audit.init | 16 |
2 files changed, 200 insertions, 0 deletions
diff --git a/package/utils/audit/Makefile b/package/utils/audit/Makefile new file mode 100644 index 0000000000..e36e3ebd53 --- /dev/null +++ b/package/utils/audit/Makefile @@ -0,0 +1,184 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=audit-userspace +PKG_VERSION:=3.1.4 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/linux-audit/audit-userspace/archive/refs/tags/v$(PKG_VERSION).tar.gz? +PKG_HASH:=aec501760acd13ebbe00e78b9b59f795d16a430b1d673628e346cd18905c594b +PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com> +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit + +PKG_CONFIG_DEPENDS:=CONFIG_KERNEL_IO_URING +PKG_FIXUP:=autoreconf + +PKG_BUILD_FLAGS:=no-mips16 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/audit/Default + TITLE:=Audit + URL:=https://github.com/linux-audit/ +endef + +define Package/audit/Default/description + The audit package contains the user space utilities for + storing and searching the audit records generated by + the audit subsystem in the kernel. +endef + +define Package/libaudit +$(call Package/audit/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (libaudit) +endef + +define Package/libaudit/description +$(call Package/audit/Default/description) + This package contains the audit shared library. +endef + +define Package/libauparse +$(call Package/audit/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (libauparse) + DEPENDS:= +libaudit +endef + +define Package/libauparse/description +$(call Package/audit/Default/description) + This package contains the audit parsing shared library. +endef + +define Package/audit-utils +$(call Package/audit/Default) + SECTION:=admin + CATEGORY:=Administration + TITLE+= (utilities) + DEPENDS:= +libaudit +libauparse +endef + +define Package/audit-utils/description +$(call Package/audit/Default/description) + This package contains the audit utilities. +endef + +define Package/auditd +$(call Package/audit/Default) + SECTION:=admin + CATEGORY:=Administration + TITLE+= (daemon) + DEPENDS:= +libaudit +libauparse +audit-utils +libev +endef + +define Package/auditd/description +$(call Package/audit/Default/description) + This package contains the audit daemon. +endef + +CONFIGURE_VARS += \ + LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \ + CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \ + CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \ + CC_FOR_BUILD="$(HOSTCC)" + +CONFIGURE_ARGS += \ + --with-debug \ + --disable-systemd \ + --disable-zos-remote \ + --disable-gssapi-krb5 \ + --without-libcap-ng \ + --without-python \ + --without-python3 \ + --without-golang + +ifeq ($(ARCH),aarch64) +CONFIGURE_ARGS += --with-aarch64 +else ifeq ($(ARCH),arm) +CONFIGURE_ARGS += --with-arm +endif + +HOST_CONFIGURE_ARGS += \ + --disable-systemd \ + --disable-zos-remote \ + --disable-gssapi-krb5 \ + --without-libcap-ng \ + --without-python \ + --without-python3 \ + --without-golang + +define Host/Install + +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/lib $(HOST_MAKE_FLAGS) install + +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/init.d $(HOST_MAKE_FLAGS) install +endef + +# We can't use the default, as the default passes $(MAKE_ARGS), which +# overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions +# passed in CONFIGURE_VARS +define Build/Compile + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) +endef + +define Build/Install + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib $(MAKE_INSTALL_FLAGS) install + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/init.d $(MAKE_INSTALL_FLAGS) install + $(call Build/Install/Default,install) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ +endef + +define Package/libaudit/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudit.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/libaudit.conf $(1)/etc/ +endef + +define Package/libauparse/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libauparse.so* $(1)/usr/lib/ +endef + +define Package/audit-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) \ + $(PKG_INSTALL_DIR)/usr/sbin/{audisp-remote,audisp-syslog,auditctl,augenrules,aureport,ausearch,autrace} \ + $(1)/usr/sbin/ +endef + +define Package/auditd/install + $(INSTALL_DIR) $(1)/etc/audit + $(CP) $(PKG_INSTALL_DIR)/etc/audit/* $(1)/etc/audit/ + # af_unix plugin is not installed. Remove it's .conf. + if [[ -f $(1)/etc/audit/plugins.d/af_unix.conf ]] ; then rm $(1)/etc/audit/plugins.d/af_unix.conf ; fi + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/audit.init $(1)/etc/init.d/audit + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/auditd $(1)/usr/sbin/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libaudit)) +$(eval $(call BuildPackage,libauparse)) +$(eval $(call BuildPackage,audit-utils)) +$(eval $(call BuildPackage,auditd)) diff --git a/package/utils/audit/files/audit.init b/package/utils/audit/files/audit.init new file mode 100644 index 0000000000..4a9f53884b --- /dev/null +++ b/package/utils/audit/files/audit.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2014 OpenWrt.org + +START=11 + +USE_PROCD=1 +PROG=/usr/sbin/auditd + +start_service() { + mkdir -p /var/log/audit + procd_open_instance + procd_set_param command "$PROG" -n + procd_set_param respawn + procd_close_instance + test -f /etc/audit/rules.d/audit.rules && /usr/sbin/auditctl -R /etc/audit/rules.d/audit.rules +} |