2020-03-06 23:33:06 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch, fetchFromGitHub, substituteAll, libpcap, openssl }:
|
2012-01-04 16:10:27 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-03-06 23:33:06 +01:00
|
|
|
version = "2.4.8";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ppp";
|
2009-02-01 14:54:20 +01:00
|
|
|
|
2020-03-06 23:33:06 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paulusmack";
|
|
|
|
repo = "ppp";
|
|
|
|
rev = "ppp-${version}";
|
|
|
|
sha256 = "1i88m79h6g3fzsb4yw3k8bq1grsx3hsyawm7id2vcaab0gfqzjjv";
|
2009-02-01 14:54:20 +01:00
|
|
|
};
|
|
|
|
|
2012-01-04 16:10:27 +01:00
|
|
|
patches =
|
2020-01-08 09:03:22 +01:00
|
|
|
[
|
|
|
|
( substituteAll {
|
2012-01-04 16:10:27 +01:00
|
|
|
src = ./nix-purity.patch;
|
|
|
|
inherit libpcap;
|
2016-03-11 16:12:39 +01:00
|
|
|
glibc = stdenv.cc.libc.dev or stdenv.cc.libc;
|
2020-01-08 09:03:22 +01:00
|
|
|
openssl = openssl.dev;
|
2012-01-04 16:10:27 +01:00
|
|
|
})
|
2015-02-08 02:43:49 +01:00
|
|
|
# Without nonpriv.patch, pppd --version doesn't work when not run as
|
|
|
|
# root.
|
2012-01-04 16:10:27 +01:00
|
|
|
./nonpriv.patch
|
2020-03-06 23:33:06 +01:00
|
|
|
(fetchpatch {
|
2017-01-26 00:40:17 +01:00
|
|
|
name = "CVE-2015-3310.patch";
|
2020-03-06 23:33:06 +01:00
|
|
|
url = "https://github.com/paulusmack/ppp/commit/858976b1fc3107f1261aae337831959b511b83c2.patch";
|
|
|
|
sha256 = "0wirmcis67xjwllqhz9lsz1b7dcvl8shvz78lxgybc70j2sv7ih4";
|
2018-03-28 15:51:01 +02:00
|
|
|
})
|
2019-04-06 14:35:23 +02:00
|
|
|
(fetchurl {
|
|
|
|
url = https://www.nikhef.nl/~janjust/ppp/ppp-2.4.7-eaptls-mppe-1.102.patch;
|
|
|
|
sha256 = "04war8l5szql53l36043hvzgfwqp3v76kj8brbz7wlf7vs2mlkia";
|
|
|
|
})
|
2020-03-06 23:35:18 +01:00
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2020-8597.patch";
|
|
|
|
url = "https://github.com/paulusmack/ppp/commit/8d7970b8f3db727fe798b65f3377fe6787575426.patch";
|
|
|
|
sha256 = "129wnhwxmzvr3y9gzxv82jnb5y8m4yg8vkpa0xl2rwkl8anbzgkh";
|
|
|
|
})
|
2017-09-22 20:45:03 +02:00
|
|
|
./musl-fix-headers.patch
|
2012-01-04 16:10:27 +01:00
|
|
|
];
|
2009-02-01 14:54:20 +01:00
|
|
|
|
2019-04-06 14:35:23 +02:00
|
|
|
buildInputs = [ libpcap openssl ];
|
2009-02-01 14:54:20 +01:00
|
|
|
|
2018-03-28 15:51:01 +02:00
|
|
|
postPatch = ''
|
|
|
|
# strip is not found when cross compiling with seemingly no way to point
|
|
|
|
# make to the right place, fixup phase will correctly strip
|
|
|
|
# everything anyway so we remove it from the Makefiles
|
|
|
|
for file in $(find -name Makefile.linux); do
|
|
|
|
substituteInPlace "$file" --replace '$(INSTALL) -s' '$(INSTALL)'
|
2020-03-06 23:33:06 +01:00
|
|
|
substituteInPlace "$file" --replace '-m 4550' '-m 550'
|
2018-03-28 15:51:01 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-03-24 20:25:42 +01:00
|
|
|
installPhase = ''
|
2018-03-28 15:51:01 +02:00
|
|
|
runHook preInstall
|
2016-03-24 20:25:42 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
make install
|
|
|
|
install -D -m 755 scripts/{pon,poff,plog} $out/bin
|
2018-03-28 15:51:01 +02:00
|
|
|
runHook postInstall
|
2016-03-24 20:25:42 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2017-07-19 15:55:28 +02:00
|
|
|
for tgt in pon poff plog; do
|
|
|
|
substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin"
|
|
|
|
done
|
2016-03-24 20:25:42 +01:00
|
|
|
'';
|
|
|
|
|
2018-08-18 00:18:17 +02:00
|
|
|
meta = with stdenv.lib; {
|
2015-02-08 02:43:49 +01:00
|
|
|
homepage = https://ppp.samba.org/;
|
2009-02-01 14:54:20 +01:00
|
|
|
description = "Point-to-point implementation for Linux and Solaris";
|
2018-08-18 00:18:17 +02:00
|
|
|
license = with licenses; [ bsdOriginal publicDomain gpl2 lgpl2 ];
|
|
|
|
platforms = platforms.linux;
|
2020-01-09 22:52:11 +01:00
|
|
|
maintainers = [ ];
|
2009-02-01 14:54:20 +01:00
|
|
|
};
|
|
|
|
}
|