2023-05-21 00:44:20 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, bash
|
|
|
|
, buildPackages
|
|
|
|
, libtool
|
|
|
|
, linuxHeaders
|
|
|
|
, python3
|
|
|
|
, swig
|
|
|
|
|
|
|
|
# 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
|
|
|
|
, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform,
|
2013-11-28 09:09:28 +00:00
|
|
|
}:
|
|
|
|
|
2023-05-21 00:44:20 +01:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-27 15:47:49 +01:00
|
|
|
pname = "audit";
|
2023-08-27 16:41:50 +01:00
|
|
|
version = "3.1.2";
|
2013-11-28 09:09:28 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-05-21 00:44:20 +01:00
|
|
|
url = "https://people.redhat.com/sgrubb/audit/audit-${finalAttrs.version}.tar.gz";
|
2023-08-27 16:41:50 +01:00
|
|
|
hash = "sha256-wLF5LR8KiMbxgocQUJy7mHBZ/GhxLJdmnKkOrhA9KH0=";
|
2013-11-28 09:09:28 +00:00
|
|
|
};
|
|
|
|
|
2023-05-21 00:44:20 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace bindings/swig/src/auditswig.i \
|
|
|
|
--replace "/usr/include/linux/audit.h" \
|
|
|
|
"${linuxHeaders}/include/linux/audit.h"
|
|
|
|
'';
|
|
|
|
|
2017-08-21 01:40:43 +01:00
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2016-08-20 23:55:21 +01:00
|
|
|
|
2022-04-27 14:21:09 +01:00
|
|
|
strictDeps = true;
|
2023-05-21 00:44:20 +01:00
|
|
|
|
|
|
|
depsBuildBuild = [
|
|
|
|
buildPackages.stdenv.cc
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
]
|
|
|
|
++ lib.optionals enablePython [
|
|
|
|
python3
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
|
|
|
];
|
2013-11-28 09:09:28 +00:00
|
|
|
|
2017-08-21 01:40:43 +01:00
|
|
|
configureFlags = [
|
2023-05-21 00:44:20 +01:00
|
|
|
# z/OS plugin is not useful on Linux, and pulls in an extra openldap
|
|
|
|
# dependency otherwise
|
2017-08-21 01:40:43 +01:00
|
|
|
"--disable-zos-remote"
|
2019-03-25 08:14:16 +00:00
|
|
|
"--with-arm"
|
|
|
|
"--with-aarch64"
|
2023-05-21 00:44:20 +01:00
|
|
|
(if enablePython then "--with-python" else "--without-python")
|
2017-08-21 01:40:43 +01:00
|
|
|
];
|
2013-11-28 09:09:28 +00:00
|
|
|
|
2016-09-05 13:37:43 +01:00
|
|
|
enableParallelBuilding = true;
|
2017-04-17 03:10:39 +01:00
|
|
|
|
2013-11-28 09:09:28 +00:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://people.redhat.com/sgrubb/audit/";
|
2023-05-21 00:44:20 +01:00
|
|
|
description = "Audit Library";
|
|
|
|
changelog = "https://github.com/linux-audit/audit-userspace/releases/tag/v${finalAttrs.version}";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
2021-01-15 14:45:37 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2013-11-28 09:09:28 +00:00
|
|
|
};
|
2023-05-21 00:44:20 +01:00
|
|
|
})
|