nixpkgs/pkgs/tools/networking/ppp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
1.5 KiB
Nix
Raw Normal View History

2021-07-20 19:21:36 +00:00
{ lib
, stdenv
, fetchFromGitHub
, libpcap
2022-09-27 13:43:01 +00:00
, libxcrypt
2023-02-19 11:48:52 +00:00
, pkg-config
, autoreconfHook
2021-07-20 19:21:36 +00:00
, openssl
, bash
, nixosTests
2021-07-20 19:21:36 +00:00
}:
stdenv.mkDerivation rec {
2023-02-19 11:48:52 +00:00
version = "2.5.0";
pname = "ppp";
2020-03-06 22:33:06 +00:00
src = fetchFromGitHub {
2021-07-20 19:21:36 +00:00
owner = "ppp-project";
repo = pname;
2023-02-19 11:48:52 +00:00
rev = "ppp-${version}";
sha256 = "sha256-J7udiLiJiJ1PzNxD+XYAUPXZ+ABGXt2U3hSFUWJXe94=";
};
2023-02-19 11:48:52 +00:00
configureFlags = [
2023-05-08 13:44:42 +00:00
"--localstatedir=/var"
2023-02-19 11:48:52 +00:00
"--sysconfdir=/etc"
2023-05-08 13:44:42 +00:00
"--with-openssl=${openssl.dev}"
2021-07-20 19:21:36 +00:00
];
2023-02-19 11:48:52 +00:00
nativeBuildInputs = [
pkg-config
autoreconfHook
];
2023-05-08 13:44:42 +00:00
2021-07-20 19:21:36 +00:00
buildInputs = [
libpcap
2022-09-27 13:43:01 +00:00
libxcrypt
2021-07-20 19:21:36 +00:00
openssl
bash
2021-07-20 19:21:36 +00:00
];
postPatch = ''
for file in $(find -name Makefile.linux); do
2020-03-06 22:33:06 +00:00
substituteInPlace "$file" --replace '-m 4550' '-m 550'
done
patchShebangs --host \
scripts/{pon,poff,plog}
'';
2023-05-08 13:44:42 +00:00
enableParallelBuilding = true;
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
2022-09-27 13:43:01 +00:00
NIX_LDFLAGS = "-lcrypt";
2023-02-19 11:48:52 +00:00
installFlags = [
"sysconfdir=$(out)/etc"
];
2023-02-19 11:48:52 +00:00
postInstall = ''
2023-05-08 13:44:42 +00:00
install -Dm755 -t $out/bin scripts/{pon,poff,plog}
2016-03-24 19:25:42 +00:00
'';
postFixup = ''
substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
2016-03-24 19:25:42 +00:00
'';
passthru.tests = {
inherit (nixosTests) pppd;
};
meta = with lib; {
2021-07-20 19:21:36 +00:00
homepage = "https://ppp.samba.org";
description = "Point-to-point implementation to provide Internet connections over serial lines";
license = with licenses; [
bsdOriginal
publicDomain
2024-04-26 11:35:31 +00:00
gpl2Only
2021-07-20 19:21:36 +00:00
lgpl2
];
2018-08-17 22:18:17 +00:00
platforms = platforms.linux;
maintainers = [ ];
};
}