Merge pull request #163070 from alyssais/vpnc-upstream

vpnc: switch to maintained fork
This commit is contained in:
Lassulus 2022-04-23 17:49:20 +01:00 committed by GitHub
commit 9d13e15c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 55 deletions

View file

@ -1,29 +1,21 @@
{ lib, stdenv, fetchsvn
, makeWrapper, pkg-config
, gawk, gnutls, libgcrypt, nettools, openresolv, perl
{ lib, stdenv, fetchFromGitHub, fetchpatch
, makeWrapper, pkg-config, perl
, gawk, gnutls, libgcrypt, openresolv, vpnc-scripts
, opensslSupport ? false, openssl # Distributing this is a GPL violation.
}:
stdenv.mkDerivation {
pname = "vpnc";
version = "0.5.3-post-r550";
src = fetchsvn {
url = "https://svn.unix-ag.uni-kl.de/vpnc";
rev = "550";
sha256 = "0x4ckfv9lpykwmh28v1kyzz91y1j2v48fi8q5nsawrba4q0wlrls";
version = "unstable-2021-11-04";
src = fetchFromGitHub {
owner = "streambinder";
repo = "vpnc";
rev = "c8bb5371b881f8853f191c495e762f834c9def5d";
sha256 = "1j1p83nfc2fpwczjcggsby0b44hk97ky0s6vns6md3awlbpgdn57";
fetchSubmodules = true;
};
postUnpack = ''
mv $sourceRoot/trunk/* $sourceRoot/.
rm -r $sourceRoot/{trunk,branches,tags}
'';
patches = [ ./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 ];
nativeBuildInputs = [ makeWrapper ]
++ lib.optional (!opensslSupport) pkg-config;
buildInputs = [ libgcrypt perl ]
@ -32,36 +24,15 @@ stdenv.mkDerivation {
makeFlags = [
"PREFIX=$(out)"
"ETCDIR=$(out)/etc/vpnc"
"SCRIPT_PATH=$(out)/etc/vpnc/vpnc-script"
"SCRIPT_PATH=${vpnc-scripts}/bin/vpnc-script"
] ++ lib.optional opensslSupport "OPENSSL_GPL_VIOLATION=yes";
postPatch = ''
patchShebangs makeman.pl
'';
preConfigure = ''
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"
'';
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/
patchShebangs src/makeman.pl
'';
meta = with lib; {
homepage = "https://www.unix-ag.uni-kl.de/~massar/vpnc/";
homepage = "https://davidepucci.it/doc/vpnc/";
description = "Virtual private network (VPN) client for Cisco's VPN concentrators";
license = if opensslSupport then licenses.unfree else licenses.gpl2Plus;
platforms = platforms.linux;

View file

@ -1,12 +0,0 @@
diff -uNr a/vpnc-script b/vpnc-script
--- a/vpnc-script 2015-09-06 13:19:11.408661526 +0200
+++ b/vpnc-script 2015-09-06 14:47:40.260871556 +0200
@@ -647,7 +647,7 @@
echo "$i" | grep : >/dev/null || \
set_network_route "$i" "255.255.255.255" "32"
done
- elif [ -n "$INTERNAL_IP4_ADDRESS" ]; then
+ elif [ -n "$INTERNAL_IP4_ADDRESS" -a -z "$INTERNAL_IP4_NETMASK" ]; then
set_default_route
fi
if [ -n "$CISCO_IPV6_SPLIT_INC" ]; then