2018-07-25 23:44:21 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook
|
2017-03-20 17:20:22 +01: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 11:14:18 +02:00
|
|
|
version = "2.6.10";
|
2017-03-20 17:20:22 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mrash";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2018-08-07 11:14:18 +02:00
|
|
|
sha256 = "05kvqhmxj9p2y835w75f3jvhr38bb96cd58mvfd7xil9dhmhn9ra";
|
2017-03-20 17:20:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [ libpcap texinfo ]
|
2017-03-21 23:50:53 +01:00
|
|
|
++ stdenv.lib.optional gnupgSupport [ gnupg gpgme.dev ]
|
2017-03-20 17:20:22 +01:00
|
|
|
++ stdenv.lib.optional wgetSupport [ wget ];
|
|
|
|
|
2018-07-25 23:44:21 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/run"
|
|
|
|
"--with-iptables=${iptables}/sbin/iptables"
|
|
|
|
(stdenv.lib.enableFeature buildServer "server")
|
|
|
|
(stdenv.lib.enableFeature buildClient "client")
|
2018-08-12 10:08:46 +02:00
|
|
|
(stdenv.lib.withFeatureAs wgetSupport "wget" "${wget}/bin/wget")
|
2018-07-25 23:44:21 +02:00
|
|
|
] ++ stdenv.lib.optionalString gnupgSupport [
|
|
|
|
"--with-gpgme"
|
|
|
|
"--with-gpgme-prefix=${gpgme.dev}"
|
|
|
|
"--with-gpg=${gnupg}"
|
|
|
|
];
|
2017-03-20 17:20:22 +01: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 22:03:30 +02:00
|
|
|
homepage = https://www.cipherdyne.org/fwknop/;
|
2017-03-20 17:20:22 +01:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
}
|