2020-12-02 19:24:12 +00:00
|
|
|
{ lib, stdenv, fetchgit
|
|
|
|
, makeWrapper
|
2021-07-21 14:38:50 +01:00
|
|
|
, nettools, gawk, systemd, openresolv, coreutils, gnugrep, iproute2
|
2020-12-02 19:24:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "vpnc-scripts";
|
2021-05-11 01:50:59 +01:00
|
|
|
version = "unstable-2021-03-21";
|
2020-12-02 19:24:12 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git";
|
2021-05-11 01:50:59 +01:00
|
|
|
rev = "8fff06090ed193c4a7285e9a10b42e6679e8ecf3";
|
|
|
|
sha256 = "14bzzpwz7kdmlbx825h6s4jjdml9q6ziyrq8311lp8caql68qdq1";
|
2020-12-02 19:24:12 +00: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 01:50:59 +01:00
|
|
|
--replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" \
|
|
|
|
--replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl"
|
2020-12-02 19:24:12 +00:00
|
|
|
'' + ''
|
|
|
|
wrapProgram $out/bin/vpnc-script \
|
2021-07-21 14:38:50 +01:00
|
|
|
--prefix PATH : "${lib.makeBinPath ([ nettools gawk coreutils gnugrep ] ++ lib.optionals stdenv.isLinux [ openresolv iproute2 ])}"
|
2020-12-02 19:24:12 +00: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;
|
|
|
|
};
|
|
|
|
}
|