xmake.lua 4.1 KB

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