2024-05-13 21:24:10 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, bash, buildPackages
|
|
|
|
, libtool, linuxHeaders, python3, swig
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# Enabling python support while cross compiling would be possible, but the
|
|
|
|
# configure script tries executing python to gather info instead of relying on
|
|
|
|
# python3-config exclusively
|
2024-05-13 21:24:10 +00:00
|
|
|
, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform, }:
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "audit";
|
|
|
|
version = "3.1.2";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-05-13 21:24:10 +00:00
|
|
|
url =
|
|
|
|
"https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz";
|
2024-05-02 00:46:19 +00:00
|
|
|
hash = "sha256-wLF5LR8KiMbxgocQUJy7mHBZ/GhxLJdmnKkOrhA9KH0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace bindings/swig/src/auditswig.i \
|
|
|
|
--replace "/usr/include/linux/audit.h" \
|
|
|
|
"${linuxHeaders}/include/linux/audit.h"
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ]
|
|
|
|
++ lib.optionals enablePython [ python3 swig ];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
buildInputs = [ bash ];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
# z/OS plugin is not useful on Linux, and pulls in an extra openldap
|
|
|
|
# dependency otherwise
|
|
|
|
"--disable-zos-remote"
|
|
|
|
"--with-arm"
|
|
|
|
"--with-aarch64"
|
|
|
|
(if enablePython then "--with-python" else "--without-python")
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://people.redhat.com/sgrubb/audit/";
|
|
|
|
description = "Audit Library";
|
2024-05-13 21:24:10 +00:00
|
|
|
changelog =
|
|
|
|
"https://github.com/linux-audit/audit-userspace/releases/tag/v${finalAttrs.version}";
|
2024-05-02 00:46:19 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
})
|