]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
audit: build only libaudit
authorDaniel Golle <daniel@makrotopia.org>
Mon, 31 Aug 2020 20:49:36 +0000 (21:49 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 31 Aug 2020 20:51:45 +0000 (21:51 +0100)
Turns out auditd depends on libev. Lets have that in packages.git.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/libs/libaudit/Makefile [moved from package/utils/audit/Makefile with 55% similarity]
package/libs/libaudit/files/audit.init [moved from package/utils/audit/files/audit.init with 100% similarity]
package/libs/libaudit/patches/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch [moved from package/utils/audit/patches/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch with 100% similarity]
package/libs/libaudit/patches/0002-fix-gcc-10.patch [moved from package/utils/audit/patches/0002-fix-gcc-10.patch with 100% similarity]

similarity index 55%
rename from package/utils/audit/Makefile
rename to package/libs/libaudit/Makefile
index f29e50128943ca77bbfb37190da8de6e0922b607..f478ae5dd0f7810a4acbe8824cdb15dcc7d5e211 100644 (file)
@@ -5,55 +5,36 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=audit
+PKG_NAME:=libaudit
 PKG_VERSION:=2.8.5
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_NAME:=audit
+PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://people.redhat.com/sgrubb/audit
 PKG_HASH:=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
-
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
+
 PKG_FIXUP:=autoreconf
 
 PKG_USE_MIPS16:=0
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
-
-define Package/audit/Default
-  SECTION:=utils
-  TITLE:=Audit Daemon
-  URL:=http://people.redhat.com/sgrubb/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 Linux 2.6 kernel
-endef
+include $(INCLUDE_DIR)/host-build.mk
 
 define Package/libaudit
-$(call Package/audit/Default)
   CATEGORY:=Libraries
-  TITLE+= (library)
-  DEPENDS:=+@KERNEL_AUDIT
+  TITLE:=Linux Auditing Framework (shared library)
+  URL:=http://people.redhat.com/sgrubb/audit/
 endef
 
 define Package/libaudit/description
-$(call Package/audit/Default/description)
- This package contains the audit shared library.
-endef
-
-define Package/audit
-$(call Package/audit/Default)
-  CATEGORY:=Utilities
-  TITLE+= (daemon)
-  DEPENDS:= +libaudit
-endef
-
-define Package/audit/description
-$(call Package/audit/Default/description)
- This package contains the audit daemon.
+       This package contains the audit shared library.
 endef
 
 CONFIGURE_VARS += \
@@ -69,6 +50,12 @@ CONFIGURE_ARGS += \
        --without-python3 \
        --disable-zos-remote
 
+HOST_CONFIGURE_ARGS += \
+       --without-python \
+       --without-python3 \
+       --disable-zos-remote \
+       --without-libcap-ng
+
 ifeq ($(ARCH),aarch64)
 CONFIGURE_ARGS += --with-aarch64
 else ifeq ($(ARCH),arm)
@@ -79,12 +66,12 @@ endif
 # 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)
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib
 endef
 
 define Build/Install
-       $(call Build/Install/Default,install)
-       $(SED) 's%^dispatcher *=.*%dispatcher = /usr/sbin/audispd%' $(PKG_INSTALL_DIR)/etc/audit/auditd.conf
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib $(MAKE_INSTALL_FLAGS) install
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)/init.d $(MAKE_INSTALL_FLAGS) install
 endef
 
 define Build/InstallDev
@@ -103,25 +90,4 @@ define Package/libaudit/install
        $(CP) $(PKG_INSTALL_DIR)/etc/libaudit.conf $(1)/etc/
 endef
 
-define Package/audit/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/* $(1)/usr/sbin/
-       $(INSTALL_DIR) $(1)/etc/audit
-       $(CP) $(PKG_INSTALL_DIR)/etc/audit/* $(1)/etc/audit/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/audit.init $(1)/etc/init.d/audit
-endef
-
-include $(INCLUDE_DIR)/host-build.mk
-
-HOST_CONFIGURE_ARGS += \
-        --without-python \
-        --without-python3 \
-        --disable-zos-remote \
-        --without-libcap-ng
-
-$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libaudit))
-$(eval $(call BuildPackage,audit))