You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
3.8 KiB

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