diff mbox series

[bug#39528,v3] Add tunctl

Message ID CAEwRq=pO-drD7VRWHSGDEBp+HVanc9c6C3Euc7v1TzXJ2pEBBQ@mail.gmail.com
State Accepted
Headers show
Series [bug#39528,v3] Add tunctl | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Vincent Legoll Feb. 9, 2020, 10:50 p.m. UTC
with a better commit msg this time

Comments

Nicolas Goaziou Feb. 9, 2020, 11:06 p.m. UTC | #1
Hello,

Vincent Legoll <vincent.legoll@gmail.com> writes:

> with a better commit msg this time

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin")))
> +               (mkdir-p bin)
> +               (copy-file "tunctl"
> +                          (string-append bin "/tunctl")))

You can replace the two last lines with

  (install-file "tunctl" bin)

> +    (description "Utility to set up and maintain TUN/TAP network interfaces")

This is a bit short. What about:

  tunctl is used to set up and maintain persistent TUN/TAP network
  interfaces, enabling user applications to simulate network traffic.
  Such interfaces is useful for VPN software, virtualization, emulation,
  simulation, and a number of other applications.

Thank you!
  
Regards,
diff mbox series

Patch

From 0f0407f746a6447898b34ba0116801f8fe5db216 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sun, 9 Feb 2020 16:34:23 +0100
Subject: [PATCH] gnu: networking: Add tunctl

* gnu/packages/networking.scm (tunctl): New variable.
---
 gnu/packages/networking.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index ed339524c0..fc6ab6349d 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -36,6 +36,7 @@ 
 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
 ;;; Copyright © 2019 Daniel Schaefer <git@danielschaefer.me>
 ;;; Copyright © 2019 Diego N. Barbato <dnbarbato@posteo.de>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2824,6 +2825,42 @@  easy-to-understand binary values.")
     (home-page "http://jodies.de/ipcalc")
     (license license:gpl2+)))
 
+(define-public tunctl
+  (package
+    (name "tunctl")
+    (version "1.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/tunctl/tunctl-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1zsgn7w6l2zh2q0j6qaw8wsx981qcr536qlz1lgb3b5zqr66qama"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'bootstrap)  ; there is no configure.ac file
+         (delete 'configure)  ; there is no configure script
+         (delete 'check)      ; there are no tests
+         (replace 'build
+           (lambda _
+             (setenv "CC" "gcc")
+             (invoke "make" "tunctl")))
+         ;; TODO: Requires docbook2x to generate man page from SGML
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (copy-file "tunctl"
+                          (string-append bin "/tunctl")))
+             #t)))))
+    (home-page "http://tunctl.sourceforge.net")
+    (synopsis  "Utility to set up and maintain TUN/TAP network interfaces")
+    (description "Utility to set up and maintain TUN/TAP network interfaces")
+    (license license:gpl2)))
+
 (define-public vde2
   (package
     (name "vde2")
-- 
2.25.0