1
0

Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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:=libaudit
  7. PKG_VERSION:=2.8.5
  8. PKG_RELEASE:=1
  9. PKG_SOURCE_NAME:=audit
  10. PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://people.redhat.com/sgrubb/audit
  12. PKG_HASH:=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
  13. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
  14. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
  19. PKG_FIXUP:=autoreconf
  20. PKG_BUILD_FLAGS:=no-mips16
  21. PKG_INSTALL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/host-build.mk
  24. define Package/libaudit
  25. CATEGORY:=Libraries
  26. TITLE:=Linux Auditing Framework (shared library)
  27. URL:=http://people.redhat.com/sgrubb/audit/
  28. endef
  29. define Package/libaudit/description
  30. This package contains the audit shared library.
  31. endef
  32. CONFIGURE_VARS += \
  33. LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
  34. CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
  35. CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
  36. CC_FOR_BUILD="$(HOSTCC)"
  37. CONFIGURE_ARGS += \
  38. --without-libcap-ng \
  39. --disable-systemd \
  40. --without-python \
  41. --without-python3 \
  42. --disable-zos-remote
  43. ifeq ($(ARCH),aarch64)
  44. CONFIGURE_ARGS += --with-aarch64
  45. else ifeq ($(ARCH),arm)
  46. CONFIGURE_ARGS += --with-arm
  47. endif
  48. HOST_CONFIGURE_ARGS += \
  49. --without-libcap-ng \
  50. --disable-systemd \
  51. --without-python \
  52. --without-python3 \
  53. --disable-zos-remote
  54. MAKE_PATH:=lib
  55. # Host/Compile/default doesn't include $(MAKE_PATH), override to use,
  56. # so we avoid building and installing unnecessary parts on the host.
  57. define Host/Compile
  58. +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(MAKE_PATH) $(HOST_MAKE_FLAGS) all
  59. endef
  60. define Host/Install
  61. +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/lib $(HOST_MAKE_FLAGS) install
  62. +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/init.d $(HOST_MAKE_FLAGS) install
  63. endef
  64. # We can't use the default, as the default passes $(MAKE_ARGS), which
  65. # overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions
  66. # passed in CONFIGURE_VARS
  67. define Build/Compile
  68. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
  69. endef
  70. define Build/Install
  71. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib $(MAKE_INSTALL_FLAGS) install
  72. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/init.d $(MAKE_INSTALL_FLAGS) install
  73. endef
  74. define Build/InstallDev
  75. $(INSTALL_DIR) $(1)/usr/include
  76. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  77. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  78. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  79. $(INSTALL_DIR) $(1)/usr/lib
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  81. endef
  82. define Package/libaudit/install
  83. $(INSTALL_DIR) $(1)/usr/lib
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
  85. $(INSTALL_DIR) $(1)/etc
  86. $(CP) $(PKG_INSTALL_DIR)/etc/libaudit.conf $(1)/etc/
  87. endef
  88. $(eval $(call HostBuild))
  89. $(eval $(call BuildPackage,libaudit))