unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67017] [PATCH] gnu: Add iptables-nft.
@ 2023-11-09 14:36 Hilton Chain via Guix-patches via
  2023-11-12 15:28 ` [bug#67017] [PATCH v2] " Hilton Chain via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2023-11-09 14:36 UTC (permalink / raw)
  To: 67017; +Cc: Hilton Chain, Leo Famulari, Tobias Geerinckx-Rice

* gnu/packages/linux.scm (iptables-nft): New variable.

Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78
---
 gnu/packages/linux.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 95a66e3d6a..596019ae5b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3101,6 +3101,33 @@ (define-public iptables
      '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
     (license license:gpl2+)))
 
+(define-public iptables-nft
+  (package/inherit iptables
+    (name "iptables-nft")
+    (arguments
+     (substitute-keyword-arguments (package-arguments iptables)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'install 'symlink-xtables-nft-multi
+              (lambda _
+                (for-each
+                 (lambda (command-path)
+                   (let ((link-path (string-append #$output command-path)))
+                     (when (file-exists? link-path)
+                       (delete-file link-path))
+                     (symlink (string-append #$output "/sbin/xtables-nft-multi")
+                              link-path)))
+                 (apply append
+                        '("/bin/iptables-xml")
+                        (map (lambda (xtables)
+                               (list (string-append "/sbin/" xtables)
+                                     (string-append "/sbin/" xtables "-restore")
+                                     (string-append "/sbin/" xtables "-save")))
+                             '("arptables"
+                               "ebtables"
+                               "iptables"
+                               "ip6tables"))))))))))))
+
 (define-public bolt
   (package
     (name "bolt")

base-commit: 960d7ac5a56155895543e03622f6555cc162d13a
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#67017] [PATCH v2] gnu: Add iptables-nft.
  2023-11-09 14:36 [bug#67017] [PATCH] gnu: Add iptables-nft Hilton Chain via Guix-patches via
@ 2023-11-12 15:28 ` Hilton Chain via Guix-patches via
  2023-11-26 22:34   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2023-11-12 15:28 UTC (permalink / raw)
  To: 67017; +Cc: Hilton Chain, Hilton Chain, Leo Famulari, Tobias Geerinckx-Rice

* gnu/packages/linux.scm (iptables-nft): New variable.

Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78
---

V1 -> V2:
Add iptables to inputs and switch to copy-build-system, since there's no need to
build it again.

 gnu/packages/linux.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 95a66e3d6a..397fc911ea 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3101,6 +3101,38 @@ (define-public iptables
      '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
     (license license:gpl2+)))
 
+(define-public iptables-nft
+  (package
+    (inherit iptables)
+    (name "iptables-nft")
+    (source #f)
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'unpack)
+          (replace 'install
+            (lambda* (#:key inputs #:allow-other-keys)
+              (for-each
+               (lambda (command-path)
+                 (let ((link-path (string-append #$output command-path)))
+                   (mkdir-p (dirname link-path))
+                   (symlink (search-input-file inputs "sbin/xtables-nft-multi")
+                            link-path)))
+               (apply append
+                      '("/bin/iptables-xml")
+                      (map (lambda (xtables)
+                             (list (string-append "/sbin/" xtables)
+                                   (string-append "/sbin/" xtables "-restore")
+                                   (string-append "/sbin/" xtables "-save")))
+                           '("arptables"
+                             "ebtables"
+                             "iptables"
+                             "ip6tables")))))))))
+    (inputs (list iptables))
+    (native-inputs '())))
+
 (define-public bolt
   (package
     (name "bolt")

base-commit: e35b7c5386c1bfacf47ed31bac9b503373dd26fc
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#67017] [PATCH v2] gnu: Add iptables-nft.
  2023-11-12 15:28 ` [bug#67017] [PATCH v2] " Hilton Chain via Guix-patches via
@ 2023-11-26 22:34   ` Ludovic Courtès
  2023-12-09 12:32     ` Hilton Chain via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2023-11-26 22:34 UTC (permalink / raw)
  To: Hilton Chain; +Cc: Tobias Geerinckx-Rice, 67017, Leo Famulari

Hi,

Hilton Chain <hako@ultrarare.space> skribis:

> * gnu/packages/linux.scm (iptables-nft): New variable.
>
> Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78

[...]

> +(define-public iptables-nft
> +  (package
> +    (inherit iptables)
> +    (name "iptables-nft")
> +    (source #f)
> +    (build-system copy-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'unpack)
> +          (replace 'install
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              (for-each
> +               (lambda (command-path)
> +                 (let ((link-path (string-append #$output command-path)))
> +                   (mkdir-p (dirname link-path))
> +                   (symlink (search-input-file inputs "sbin/xtables-nft-multi")
> +                            link-path)))
> +               (apply append
> +                      '("/bin/iptables-xml")
> +                      (map (lambda (xtables)
> +                             (list (string-append "/sbin/" xtables)
> +                                   (string-append "/sbin/" xtables "-restore")
> +                                   (string-append "/sbin/" xtables "-save")))
> +                           '("arptables"
> +                             "ebtables"
> +                             "iptables"
> +                             "ip6tables")))))))))
> +    (inputs (list iptables))
> +    (native-inputs '())))

I think we at least need ‘synopsis’ to clarify what this is about
compared to ‘iptables’.

Apart from that it LGTM, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#67017] [PATCH v2] gnu: Add iptables-nft.
  2023-11-26 22:34   ` Ludovic Courtès
@ 2023-12-09 12:32     ` Hilton Chain via Guix-patches via
  2023-12-19 13:52       ` bug#67017: Close: " Hilton Chain via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2023-12-09 12:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Tobias Geerinckx-Rice, 67017, Leo Famulari

Hi,
On Mon, 27 Nov 2023 06:34:22 +0800,
Ludovic Courtès wrote:
>
[...]
> I think we at least need ‘synopsis’ to clarify what this is about
> compared to ‘iptables’.

Does it look good to append a "(nftables API)" to the synopsis of
iptables?  So that it says "Programs to configure Linux IP packet
filtering rules (nftables API)".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#67017: Close: [bug#67017] [PATCH v2] gnu: Add iptables-nft.
  2023-12-09 12:32     ` Hilton Chain via Guix-patches via
@ 2023-12-19 13:52       ` Hilton Chain via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2023-12-19 13:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Tobias Geerinckx-Rice, 67017-done, Leo Famulari

On Sat, 09 Dec 2023 20:32:18 +0800,
Hilton Chain wrote:
>
> Hi,
> On Mon, 27 Nov 2023 06:34:22 +0800,
> Ludovic Courtès wrote:
> >
> [...]
> > I think we at least need ‘synopsis’ to clarify what this is about
> > compared to ‘iptables’.
>
> Does it look good to append a "(nftables API)" to the synopsis of
> iptables?  So that it says "Programs to configure Linux IP packet
> filtering rules (nftables API)".

I used this for synopsis and applied the patch as
6884770464bd9ba95c1a5ccf10bf50d186a220d5.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-19 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 14:36 [bug#67017] [PATCH] gnu: Add iptables-nft Hilton Chain via Guix-patches via
2023-11-12 15:28 ` [bug#67017] [PATCH v2] " Hilton Chain via Guix-patches via
2023-11-26 22:34   ` Ludovic Courtès
2023-12-09 12:32     ` Hilton Chain via Guix-patches via
2023-12-19 13:52       ` bug#67017: Close: " Hilton Chain via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).