xmake.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package("audit")
  2. set_description("Userspace components of the audit framework.")
  3. add_urls("https://github.com/linux-audit/audit-userspace/archive/refs/tags/$(version).tar.gz",
  4. "https://github.com/linux-audit/audit-userspace.git")
  5. add_versions("v4.1.2", "5c638bbeef9adb6c5715d3a60f0f5adb93e9b81633608af13d23c61f5e5db04d")
  6. add_configs("listener", {description = "Enable auditd network listener support.", default = true, type = "boolean"})
  7. add_configs("zos_remote", {description = "Enable audisp zos remote plugin.", default = true, type = "boolean"})
  8. add_configs("legacy_actions", {description = "Enable legacy actions.", default = true, type = "boolean"})
  9. add_configs("gssapi_krb5", {description = "Enable gssapi kerberos 5 support.", default = true, type = "boolean"})
  10. add_configs("experimental", {description = "Enable experimental audit components.", default = false, type = "boolean"})
  11. add_configs("arm", {description = "Enable armeabi processor support.", default = false, type = "boolean"})
  12. add_configs("aarch64", {description = "Enable aarch64 processor support.", default = false, type = "boolean"})
  13. add_configs("riscv", {description = "Enable risc-v processor support.", default = false, type = "boolean"})
  14. add_configs("apparmor", {description = "Enable apparmor events.", default = false, type = "boolean"})
  15. add_configs("io_uring", {description = "Enable io_uring support.", default = false, type = "boolean"})
  16. add_configs("nftables", {description = "Use nftables. (default is nftables)", default = true, type = "boolean"})
  17. add_configs("libcap_ng", {description = "Add libcap-ng support.", default = true, type = "boolean"})
  18. add_deps("autotools")
  19. on_load(function (package)
  20. if package:config("zos_remote") then
  21. package:add("deps", "openldap")
  22. end
  23. if package:config("gssapi_krb5") then
  24. package:add("deps", "krb5")
  25. end
  26. if package:config("libcap_ng") then
  27. package:add("deps", "libcap-ng")
  28. end
  29. end)
  30. on_install("linux", function (package)
  31. local configs = {
  32. "--disable-dependency-tracking",
  33. "--without-python3",
  34. "--without-golang"
  35. }
  36. table.insert(configs, "--enable-listener=" .. (package:config("listener") and "yes" or "no"))
  37. table.insert(configs, "--enable-zos-remote=" .. (package:config("zos_remote") and "yes" or "no"))
  38. table.insert(configs, "--enable-legacy-actions=" .. (package:config("legacy_actions") and "yes" or "no"))
  39. table.insert(configs, "--enable-gssapi-krb5=" .. (package:config("gssapi_krb5") and "yes" or "no"))
  40. table.insert(configs, "--enable-experimental=" .. (package:config("experimental") and "yes" or "no"))
  41. table.insert(configs, "--with-arm=" .. (package:config("arm") and "yes" or "no"))
  42. table.insert(configs, "--with-aarch64=" .. (package:config("aarch64") and "yes" or "no"))
  43. table.insert(configs, "--with-riscv=" .. (package:config("riscv") and "yes" or "no"))
  44. table.insert(configs, "--with-apparmor=" .. (package:config("apparmor") and "yes" or "no"))
  45. table.insert(configs, "--with-io_uring=" .. (package:config("io_uring") and "yes" or "no"))
  46. table.insert(configs, "--with-nftables=" .. (package:config("nftables") and "yes" or "no"))
  47. table.insert(configs, "--with-libcap-ng=" .. (package:config("libcap_ng") and "yes" or "no"))
  48. io.replace("src/Makefile.am", "SUBDIRS = test", "SUBDIRS = ", {plain = true})
  49. io.replace("auparse/Makefile.am", "SUBDIRS = . test", "SUBDIRS = .", {plain = true})
  50. local packagedeps = {}
  51. for _, dep in ipairs(package:librarydeps()) do
  52. table.insert(packagedeps, dep:name())
  53. end
  54. import("package.tools.autoconf").install(package, configs, {packagedeps = packagedeps})
  55. end)
  56. on_test(function (package)
  57. assert(package:has_cfuncs("audit_get_session", {includes = "libaudit.h"}))
  58. end)