nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 gettext,
6 libsepol,
7 libselinux,
8 libsemanage,
9 libxcrypt,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "policycoreutils";
14 version = "3.8.1";
15 inherit (libsepol) se_url;
16
17 src = fetchurl {
18 url = "${se_url}/${version}/policycoreutils-${version}.tar.gz";
19 hash = "sha256-7vIxlrUB0UHLlfX8Uu8acon0WbZeRBXqD+mu7cXYDvI=";
20 };
21
22 postPatch = ''
23 # Fix install references
24 substituteInPlace po/Makefile \
25 --replace /usr/bin/install install --replace /usr/share /share
26 substituteInPlace newrole/Makefile --replace /usr/share /share
27 '';
28
29 nativeBuildInputs = [ gettext ];
30 buildInputs = [
31 libsepol
32 libselinux
33 libsemanage
34 libxcrypt
35 ];
36
37 makeFlags = [
38 "PREFIX=$(out)"
39 "SBINDIR=$(out)/bin"
40 "ETCDIR=$(out)/etc"
41 "BASHCOMPLETIONDIR=$out/share/bash-completion/completions"
42 "LOCALEDIR=$(out)/share/locale"
43 "MAN5DIR=$(out)/share/man/man5"
44 ];
45
46 meta = {
47 description = "SELinux policy core utilities";
48 license = lib.licenses.gpl2Only;
49 inherit (libsepol.meta) homepage platforms maintainers;
50 };
51}