2018-07-25 22:44:21 +01:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook
|
2017-03-20 16:20:22 +00:00
|
|
|
, libpcap, texinfo
|
|
|
|
, iptables
|
|
|
|
, gnupgSupport ? true, gnupg, gpgme # Increases dependencies!
|
|
|
|
, wgetSupport ? true, wget
|
|
|
|
, buildServer ? true
|
|
|
|
, buildClient ? true }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fwknop";
|
2018-08-07 10:14:18 +01:00
|
|
|
version = "2.6.10";
|
2017-03-20 16:20:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mrash";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2018-08-07 10:14:18 +01:00
|
|
|
sha256 = "05kvqhmxj9p2y835w75f3jvhr38bb96cd58mvfd7xil9dhmhn9ra";
|
2017-03-20 16:20:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [ libpcap texinfo ]
|
2019-11-10 01:13:39 +00:00
|
|
|
++ stdenv.lib.optionals gnupgSupport [ gnupg gpgme.dev ]
|
|
|
|
++ stdenv.lib.optionals wgetSupport [ wget ];
|
2017-03-20 16:20:22 +00:00
|
|
|
|
2018-07-25 22:44:21 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/run"
|
|
|
|
"--with-iptables=${iptables}/sbin/iptables"
|
|
|
|
(stdenv.lib.enableFeature buildServer "server")
|
|
|
|
(stdenv.lib.enableFeature buildClient "client")
|
2018-08-12 09:08:46 +01:00
|
|
|
(stdenv.lib.withFeatureAs wgetSupport "wget" "${wget}/bin/wget")
|
2018-07-25 22:44:21 +01:00
|
|
|
] ++ stdenv.lib.optionalString gnupgSupport [
|
|
|
|
"--with-gpgme"
|
|
|
|
"--with-gpgme-prefix=${gpgme.dev}"
|
|
|
|
"--with-gpg=${gnupg}"
|
|
|
|
];
|
2017-03-20 16:20:22 +00:00
|
|
|
|
|
|
|
# Temporary hack to copy the example configuration files into the nix-store,
|
|
|
|
# this'll probably be helpful until there's a NixOS module for that (feel free
|
|
|
|
# to ping me (@primeos) if you want to help).
|
|
|
|
preInstall = ''
|
|
|
|
substituteInPlace Makefile --replace\
|
|
|
|
"sysconfdir = /etc"\
|
|
|
|
"sysconfdir = $out/etc"
|
|
|
|
substituteInPlace server/Makefile --replace\
|
|
|
|
"wknopddir = /etc/fwknop"\
|
|
|
|
"wknopddir = $out/etc/fwknop"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description =
|
|
|
|
"Single Packet Authorization (and Port Knocking) server/client";
|
|
|
|
longDescription = ''
|
|
|
|
fwknop stands for the "FireWall KNock OPerator", and implements an
|
|
|
|
authorization scheme called Single Packet Authorization (SPA).
|
|
|
|
'';
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://www.cipherdyne.org/fwknop/;
|
2017-03-20 16:20:22 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
}
|