3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/networking/vpnc/default.nix

58 lines
1.6 KiB
Nix
Raw Normal View History

2021-01-15 09:19:50 +00:00
{ lib, stdenv, fetchsvn, nettools, libgcrypt, openssl, openresolv, perl, gawk, makeWrapper }:
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
name = "vpnc-0.5.3-post-r550";
src = fetchsvn {
2018-03-07 21:36:00 +00:00
url = "https://svn.unix-ag.uni-kl.de/vpnc";
rev = "550";
sha256 = "0x4ckfv9lpykwmh28v1kyzz91y1j2v48fi8q5nsawrba4q0wlrls";
};
postUnpack = ''
mv $sourceRoot/trunk/* $sourceRoot/.
rm -r $sourceRoot/{trunk,branches,tags}
'';
patches = [ ./makefile.patch ./no_default_route_when_netmask.patch ];
# The `etc/vpnc/vpnc-script' script relies on `which' and on
# `ifconfig' as found in net-tools (not GNU Inetutils).
propagatedBuildInputs = [ nettools ];
buildInputs = [libgcrypt perl makeWrapper openssl ];
preConfigure = ''
sed -i 's|^#OPENSSL|OPENSSL|g' Makefile
substituteInPlace "vpnc-script" \
--replace "which" "type -P" \
--replace "awk" "${gawk}/bin/awk" \
--replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf"
substituteInPlace "config.c" \
--replace "/etc/vpnc/vpnc-script" "$out/etc/vpnc/vpnc-script"
substituteInPlace "pcf2vpnc" \
--replace "/usr/bin/perl" "${perl}/bin/perl"
'';
postInstall = ''
for i in "$out/{bin,sbin}/"*
do
wrapProgram $i --prefix PATH : \
"${nettools}/bin:${nettools}/sbin"
done
mkdir -p $out/share/doc/vpnc
cp README nortel.txt ChangeLog $out/share/doc/vpnc/
'';
meta = {
homepage = "https://www.unix-ag.uni-kl.de/~massar/vpnc/";
description = "Virtual private network (VPN) client for Cisco's VPN concentrators";
2021-01-15 09:19:50 +00:00
license = lib.licenses.gpl2Plus;
2021-01-15 09:19:50 +00:00
platforms = lib.platforms.linux;
};
}