Skip to content

Commit

Permalink
cato: init at 5.2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
YarekTyshchenko committed Sep 4, 2024
1 parent 8d18fff commit 5894752
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions pkgs/applications/networking/cato/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
stdenv,
fetchurl,
dpkg,
lib,
libz,
autoPatchelfHook,
}:

stdenv.mkDerivation rec {
pname = "cato";
version = "5.2.1.1";

src = fetchurl {
url = "https://clients.catonetworks.com/linux/${version}/cato-client-install.deb";
sha256 = "sha256-0hUchaxaiKJth2ByQMFfjsCLi/4kl+SrNSQ33Y6r3WA=";
};

dontConfigure = true;

nativeBuildInputs = [ autoPatchelfHook dpkg ];

buildInputs = [ libz stdenv.cc.cc ];

unpackPhase = ''
runHook preUnpack
dpkg -x $src source
cd source
runHook postUnpack
'';

installPhase = ''
runHook preInstall
mkdir $out
mv etc $out/etc
mv usr/lib $out/lib
mv lib/systemd $out/lib/systemd
substituteInPlace "$out/lib/systemd/system/cato-client.service" --replace /usr/sbin/ "$out/bin/"
cat "$out/lib/systemd/system/cato-client.service"
mkdir -p $out/bin
mv usr/sbin/* $out/bin
mv usr/bin/* $out/bin
mv ./usr/local/share $out/share
runHook postInstall
'';

meta = with lib; {
description = "Cato";
homepage = https://www.catonetworks.com/;
license = licenses.unfree;
maintainers = with lib.maintainers; [ yarektyshchenko ];
platforms = [ "x86_64-linux" ];
};
}

0 comments on commit 5894752

Please sign in to comment.