Unverified Commit 9cf7633d authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

choparp: init at 0-unstable-2021-04-23 (#346415)

parents 8fbedfea 0f3a58d8
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchFromGitHub,
  unstableGitUpdater,
  libpcap,
  installShellFiles,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "choparp";
  version = "0-unstable-2021-04-23";

  src = fetchFromGitHub {
    owner = "quinot";
    repo = "choparp";
    rev = "e9f0b81135d81cb0416504a7e695e158f4a5285e";
    hash = "sha256-0VZj7Hkn/aiRddWdBzDAXdOdxJZvwd+KaN9ddrrBjm8=";
  };

  nativeBuildInputs = [
    installShellFiles
  ];

  buildPhase = ''
    runHook preBuild

    mkdir -p $out/bin
    $CC -o $out/bin/choparp src/choparp.c -lpcap -L${lib.getLib libpcap}/lib -I${lib.getDev libpcap}/include
    installManPage src/choparp.8

    runHook postBuild
  '';

  passthru.updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };

  meta = {
    homepage = "https://github.com/quinot/choparp";
    description = "Proxy ARP daemon";
    maintainers = with lib.maintainers; [ bot-wxt1221 ];
    platforms = lib.platforms.unix;
    license = lib.licenses.bsd3;
    mainProgram = "choparp";
  };
})