2020-12-02 20:24:12 +01:00
|
|
|
{ lib, stdenv, fetchgit
|
|
|
|
, makeWrapper
|
2021-07-21 15:38:50 +02:00
|
|
|
, nettools, gawk, systemd, openresolv, coreutils, gnugrep, iproute2
|
2020-12-02 20:24:12 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "vpnc-scripts";
|
2021-05-11 02:50:59 +02:00
|
|
|
version = "unstable-2021-03-21";
|
2020-12-02 20:24:12 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git";
|
2021-05-11 02:50:59 +02:00
|
|
|
rev = "8fff06090ed193c4a7285e9a10b42e6679e8ecf3";
|
|
|
|
sha256 = "14bzzpwz7kdmlbx825h6s4jjdml9q6ziyrq8311lp8caql68qdq1";
|
2020-12-02 20:24:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp vpnc-script $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
substituteInPlace $out/bin/vpnc-script \
|
|
|
|
--replace "which" "type -P"
|
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
substituteInPlace $out/bin/vpnc-script \
|
2021-05-11 02:50:59 +02:00
|
|
|
--replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" \
|
|
|
|
--replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl"
|
2020-12-02 20:24:12 +01:00
|
|
|
'' + ''
|
|
|
|
wrapProgram $out/bin/vpnc-script \
|
2021-07-21 15:38:50 +02:00
|
|
|
--prefix PATH : "${lib.makeBinPath ([ nettools gawk coreutils gnugrep ] ++ lib.optionals stdenv.isLinux [ openresolv iproute2 ])}"
|
2020-12-02 20:24:12 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "script for vpnc to configure the network routing and name service";
|
|
|
|
homepage = "https://www.infradead.org/openconnect/";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ jerith666 ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|