mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: fail2ban: Move setup and test patches to phases.
* gnu/packages/admin.scm (fail2ban) [source]<snippet>: Move setup and test substitutions... [arguments]<phases>: ...to phases 'patch-setup.py and 'disable-some-tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
f744f060dd
commit
43a5197c6c
1 changed files with 35 additions and 36 deletions
|
@ -6193,42 +6193,7 @@ alias cysdig=sudo csysdig --modern-bpf
|
|||
"paths-fedora.conf"
|
||||
"paths-freebsd.conf"
|
||||
"paths-opensuse.conf"
|
||||
"paths-osx.conf")))
|
||||
;; Get rid of absolute file names.
|
||||
(substitute* "setup.py"
|
||||
(("/etc/fail2ban")
|
||||
"etc/fail2ban")
|
||||
(("/var/lib/fail2ban")
|
||||
"var/lib/fail2ban")
|
||||
(("\"/usr/bin/\"")
|
||||
"\"usr/bin/\"")
|
||||
(("\"/usr/lib/fail2ban/\"")
|
||||
"\"usr/lib/fail2ban/\"")
|
||||
(("'/usr/share/doc/fail2ban'")
|
||||
"'usr/share/doc/fail2ban'"))
|
||||
;; disable tests performing unacceptable side-effects
|
||||
(let ((make-suite (lambda (t)
|
||||
(string-append
|
||||
"tests.addTest.unittest.makeSuite."
|
||||
t ".."))))
|
||||
(substitute* "fail2ban/tests/utils.py"
|
||||
(((make-suite "actiontestcase.CommandActionTest"))
|
||||
"")
|
||||
(((make-suite "misctestcase.SetupTest"))
|
||||
"")
|
||||
(((make-suite
|
||||
"filtertestcase.DNSUtilsNetworkTests"))
|
||||
"")
|
||||
(((make-suite "filtertestcase.IgnoreIPDNS"))
|
||||
"")
|
||||
(((make-suite "filtertestcase.GetFailures"))
|
||||
"")
|
||||
(((make-suite
|
||||
"fail2banclienttestcase.Fail2banServerTest"))
|
||||
"")
|
||||
(((make-suite
|
||||
"servertestcase.ServerConfigReaderTests"))
|
||||
"")))))
|
||||
"paths-osx.conf")))))
|
||||
(patches (search-patches
|
||||
"fail2ban-0.11.2_fix-setuptools-drop-2to3.patch"
|
||||
"fail2ban-python310-server-action.patch"
|
||||
|
@ -6243,6 +6208,40 @@ alias cysdig=sudo csysdig --modern-bpf
|
|||
(add-before 'build 'invoke-2to3
|
||||
(lambda _
|
||||
(invoke "./fail2ban-2to3")))
|
||||
(add-after 'unpack 'patch-setup.py
|
||||
(lambda _
|
||||
;; Get rid of absolute file names.
|
||||
(substitute* "setup.py"
|
||||
(("/etc/fail2ban")
|
||||
"etc/fail2ban")
|
||||
(("/var/lib/fail2ban")
|
||||
"var/lib/fail2ban")
|
||||
(("\"/usr/bin/\"")
|
||||
"\"usr/bin/\"")
|
||||
(("\"/usr/lib/fail2ban/\"")
|
||||
"\"usr/lib/fail2ban/\"")
|
||||
(("'/usr/share/doc/fail2ban'")
|
||||
"'usr/share/doc/fail2ban'"))))
|
||||
(add-after 'unpack 'disable-some-tests
|
||||
(lambda _
|
||||
(define (make-suite str)
|
||||
(string-append "tests.addTest.unittest.makeSuite." str ".."))
|
||||
;; disable tests performing unacceptable side-effects
|
||||
(substitute* "fail2ban/tests/utils.py"
|
||||
(((make-suite "actiontestcase.CommandActionTest"))
|
||||
"")
|
||||
(((make-suite "misctestcase.SetupTest"))
|
||||
"")
|
||||
(((make-suite "filtertestcase.DNSUtilsNetworkTests"))
|
||||
"")
|
||||
(((make-suite "filtertestcase.IgnoreIPDNS"))
|
||||
"")
|
||||
(((make-suite "filtertestcase.GetFailures"))
|
||||
"")
|
||||
(((make-suite "fail2banclienttestcase.Fail2banServerTest"))
|
||||
"")
|
||||
(((make-suite "servertestcase.ServerConfigReaderTests"))
|
||||
""))))
|
||||
(add-before 'install 'fix-default-config
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(substitute* '("config/paths-common.conf"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue