about summary refs log tree commit diff
path: root/pkgs/by-name/th/thc-secure-delete/package.nix
blob: 03539ffcb488ef932047680078fa3f457dc6e4f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, pkg-config
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "thc-secure-delete";
  version = "3.1.1";

  src = fetchFromGitHub {
    owner = "gordrs";
    repo = "thc-secure-delete";
    rev = "v${finalAttrs.version}";
    hash = "sha256-hvWuxFkzhOSCplPtyjRtn36bIk6KdPBcpr3lAmiAyfE=";
  };

  nativeBuildInputs = [ pkg-config installShellFiles ];

  makeFlags = [
    "CC=${stdenv.cc.targetPrefix}cc"
  ];

  installPhase = ''
    runHook preInstall

    install -Dt $out/bin/ -m755 srm sdmem sswap sfill
    installManPage *.1

    runHook postInstall
  '';

  meta = with lib; {
    description = "THC's Secure Delete tools";
    homepage = "https://github.com/gordrs/thc-secure-delete";
    changelog = "https://github.com/gordrs/thc-secure-delete/blob/v${finalAttrs.version}/CHANGES";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ tochiaha ];
    mainProgram = "srm";
    platforms = platforms.all;
  };
})