2022-06-03 01:53:41 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, coreutils
|
|
|
|
, gawk
|
|
|
|
, gnugrep
|
|
|
|
, iproute2
|
2020-12-02 19:24:12 +00:00
|
|
|
, makeWrapper
|
2022-06-03 01:53:41 +01:00
|
|
|
, nettools
|
|
|
|
, openresolv
|
|
|
|
, systemd
|
2020-12-02 19:24:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "vpnc-scripts";
|
2021-10-31 14:35:08 +00:00
|
|
|
version = "unstable-2021-09-24";
|
2022-06-03 01:53:41 +01:00
|
|
|
|
2020-12-02 19:24:12 +00:00
|
|
|
src = fetchgit {
|
2021-10-31 14:35:08 +00:00
|
|
|
url = "https://gitlab.com/openconnect/vpnc-scripts.git";
|
|
|
|
rev = "b749c2cadc2f32e2efffa69302861f9a7d4a4e5f";
|
2022-06-03 01:53:41 +01:00
|
|
|
sha256 = "sha256-DDGpxzQBaOOG+MYDXnVEB6/Q4qmdNM+86XNRNl01UqU=";
|
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; {
|
|
|
|
homepage = "https://www.infradead.org/openconnect/";
|
2022-06-03 01:53:41 +01:00
|
|
|
description = "Script for vpnc to configure the network routing and name service";
|
2020-12-02 19:24:12 +00:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ jerith666 ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|