2012-01-04 19:10:27 +04:00
|
|
|
{ stdenv, fetchurl, substituteAll, libpcap }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-02-08 04:43:49 +03:00
|
|
|
version = "2.4.7";
|
2012-01-04 23:04:09 +04:00
|
|
|
name = "ppp-${version}";
|
2009-02-01 16:54:20 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-09 00:29:27 +03:00
|
|
|
url = "mirror://samba/ppp/${name}.tar.gz";
|
2015-02-08 04:43:49 +03:00
|
|
|
sha256 = "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02";
|
2009-02-01 16:54:20 +03:00
|
|
|
};
|
|
|
|
|
2012-01-04 19:10:27 +04:00
|
|
|
patches =
|
|
|
|
[ ( substituteAll {
|
|
|
|
src = ./nix-purity.patch;
|
|
|
|
inherit libpcap;
|
2016-03-11 18:12:39 +03:00
|
|
|
glibc = stdenv.cc.libc.dev or stdenv.cc.libc;
|
2012-01-04 19:10:27 +04:00
|
|
|
})
|
2015-02-08 04:43:49 +03:00
|
|
|
# Without nonpriv.patch, pppd --version doesn't work when not run as
|
|
|
|
# root.
|
2012-01-04 19:10:27 +04:00
|
|
|
./nonpriv.patch
|
2017-01-26 02:40:17 +03:00
|
|
|
(fetchurl {
|
|
|
|
name = "CVE-2015-3310.patch";
|
|
|
|
url = "https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/plain/debian/patches/rc_mksid-no-buffer-overflow?h=debian/2.4.7-1%2b4";
|
|
|
|
sha256 = "1dk00j7bg9nfgskw39fagnwv1xgsmyv0xnkd6n1v5gy0psw0lvqh";
|
|
|
|
})
|
2018-03-28 16:51:01 +03:00
|
|
|
(fetchurl {
|
|
|
|
url = "https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/plain/debian/patches/0016-pppoe-include-netinet-in.h-before-linux-in.h.patch";
|
|
|
|
sha256 = "1xnmqn02kc6g5y84xynjwnpv9cvrfn3nyv7h7r8j8xi7qf2aj4q8";
|
|
|
|
})
|
2017-09-22 21:45:03 +03:00
|
|
|
./musl-fix-headers.patch
|
2012-01-04 19:10:27 +04:00
|
|
|
];
|
2009-02-01 16:54:20 +03:00
|
|
|
|
2012-01-04 19:10:27 +04:00
|
|
|
buildInputs = [ libpcap ];
|
2009-02-01 16:54:20 +03:00
|
|
|
|
2018-03-28 16:51:01 +03: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)'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-03-24 22:25:42 +03:00
|
|
|
installPhase = ''
|
2018-03-28 16:51:01 +03:00
|
|
|
runHook preInstall
|
2016-03-24 22:25:42 +03:00
|
|
|
mkdir -p $out/bin
|
|
|
|
make install
|
|
|
|
install -D -m 755 scripts/{pon,poff,plog} $out/bin
|
2018-03-28 16:51:01 +03:00
|
|
|
runHook postInstall
|
2016-03-24 22:25:42 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2017-07-19 16:55:28 +03:00
|
|
|
for tgt in pon poff plog; do
|
|
|
|
substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin"
|
|
|
|
done
|
2016-03-24 22:25:42 +03:00
|
|
|
'';
|
|
|
|
|
2018-08-18 01:18:17 +03:00
|
|
|
meta = with stdenv.lib; {
|
2015-02-08 04:43:49 +03:00
|
|
|
homepage = https://ppp.samba.org/;
|
2009-02-01 16:54:20 +03:00
|
|
|
description = "Point-to-point implementation for Linux and Solaris";
|
2018-08-18 01:18:17 +03:00
|
|
|
license = with licenses; [ bsdOriginal publicDomain gpl2 lgpl2 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.falsifian ];
|
2009-02-01 16:54:20 +03:00
|
|
|
};
|
|
|
|
}
|