@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchzip, python, pythonPackages, unzip, systemd, gamin }:
|
||||
{ stdenv, fetchzip, python, pythonPackages, unzip, gamin }:
|
||||
|
||||
let version = "0.9.3"; in
|
||||
|
||||
@@ -14,18 +14,10 @@ pythonPackages.buildPythonPackage {
|
||||
|
||||
buildInputs = [ unzip ];
|
||||
|
||||
pythonPath = (stdenv.lib.optional stdenv.isLinux systemd)
|
||||
++ [ python.modules.sqlite3 gamin ];
|
||||
propagatedBuildInputs = [ python.modules.sqlite3 gamin ]
|
||||
++ (stdenv.lib.optional stdenv.isLinux pythonPackages.systemd);
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace /usr $out
|
||||
|
||||
substituteInPlace setup.py \
|
||||
--replace /usr $out \
|
||||
--replace /etc $out/etc \
|
||||
--replace /var $TMPDIR/var \
|
||||
|
||||
for i in fail2ban-client fail2ban-regex fail2ban-server; do
|
||||
substituteInPlace $i \
|
||||
--replace /usr/share/fail2ban $out/share/fail2ban
|
||||
@@ -40,6 +32,18 @@ pythonPackages.buildPythonPackage {
|
||||
|
||||
doCheck = false;
|
||||
|
||||
preInstall = ''
|
||||
# see https://github.com/NixOS/nixpkgs/issues/4968
|
||||
${python}/bin/${python.executable} setup.py install_data --install-dir=$out --root=$out
|
||||
'';
|
||||
|
||||
postInstall = let
|
||||
sitePackages = "$out/lib/${python.libPrefix}/site-packages";
|
||||
in ''
|
||||
# see https://github.com/NixOS/nixpkgs/issues/4968
|
||||
rm -rf ${sitePackages}/etc ${sitePackages}/usr ${sitePackages}/var;
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://www.fail2ban.org/;
|
||||
description = "A program that scans log files for repeated failing login attempts and bans IP addresses";
|
||||
|
||||
Reference in New Issue
Block a user