btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / sp / spiped / package.nix
blob021549e4f10efee1de40cef43a4bc522f610d5a6
2   lib,
3   stdenv,
4   fetchurl,
5   openssl,
6   coreutils,
7   nixosTests,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "spiped";
12   version = "1.6.2";
14   src = fetchurl {
15     url = "https://www.tarsnap.com/spiped/spiped-${version}.tgz";
16     hash = "sha256-BdRofRLRHX+YiNQ/PYDFQbdyHJhwONCF9xyRuwYgRWc=";
17   };
19   buildInputs = [ openssl ];
21   postPatch = ''
22     substituteInPlace libcperciva/cpusupport/Build/cpusupport.sh \
23       --replace "dirname" "${coreutils}/bin/dirname" \
24       --replace "2>/dev/null" "2>stderr.log"
26     substituteInPlace libcperciva/POSIX/posix-l.sh       \
27       --replace "rm" "${coreutils}/bin/rm"   \
28       --replace "2>/dev/null" "2>stderr.log"
29   '';
31   installPhase = ''
32     runHook preInstall
33     mkdir -p $out/bin $out/share/man/man1
34     make install BINDIR=$out/bin MAN1DIR=$out/share/man/man1
35     runHook postInstall
36   '';
38   passthru.tests.spiped = nixosTests.spiped;
40   meta = {
41     description = "Utility for secure encrypted channels between sockets";
42     homepage = "https://www.tarsnap.com/spiped.html";
43     license = lib.licenses.bsd2;
44     platforms = lib.platforms.unix;
45     maintainers = [ lib.maintainers.thoughtpolice ];
46   };