all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Darrington <jmd@gnu.org>
To: guix-devel@gnu.org
Cc: John Darrington <jmd@gnu.org>
Subject: [PATCH] gnu: Add tcp-wrappers.
Date: Sun,  4 Sep 2016 15:20:02 +0200	[thread overview]
Message-ID: <1472995202-20512-1-git-send-email-jmd@gnu.org> (raw)

* gnu/packages/networking.scm (tcp-wrappers): New variable.
* gnu/packages/messaging.scm (ngircd) [inputs]: Add tcp-wrappers.
---
 gnu/packages/messaging.scm  |  6 ++--
 gnu/packages/networking.scm | 79 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index fa4515c..b557b2f 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -44,6 +44,7 @@
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages libcanberra)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages xml)
@@ -208,8 +209,9 @@ dictionaries.  HexChat can be extended with multiple addons.")
     (native-inputs `(("procps" ,procps)
                      ("expect" ,expect)
                      ("inetutils" ,inetutils)))
-    ;; XXX Add libident, libwrap.
+    ;; XXX Add libident.
     (inputs `(("zlib" ,zlib)
+              ("libwrap" ,tcp-wrappers)
               ("gnutls" ,gnutls)
               ,@(if (string-suffix? "-linux"
                                     (or (%current-target-system)
@@ -218,7 +220,7 @@ dictionaries.  HexChat can be extended with multiple addons.")
                     '())))
     (arguments
      `(#:configure-flags
-       '("--with-gnutls" "--with-iconv" "--enable-ipv6"
+       '("--with-gnutls" "--with-iconv" "--enable-ipv6" "--with-tcp-wrappers"
          ,@(if (string-suffix? "-linux"
                                (or (%current-target-system)
                                    (%current-system)))
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 07f0b9d..9a562ba 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -135,6 +135,85 @@ establish a relatively secure environment (su and chroot) for running client
 or server shell scripts with network connections.")
     (license license:gpl2)))
 
+
+(define-public tcp-wrappers
+  (package
+    (name "tcp-wrappers")
+    (version "7.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0p9ilj4v96q32klavx0phw9va21fjp8vpk11nbh6v2ppxnnxfhwm"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)  ; there is no configure script
+         (delete 'check)      ; there are no tests
+         (replace 'build
+           (lambda _
+             (chmod "." #o755)
+             ;; Upstream doesn't generate a shared library.  So we have to do it.
+             (setenv "CC" "gcc -fno-builtin -fPIC")
+             (substitute* "Makefile"
+               (("^(all[^\n]*)" line) (string-append line " libwrap.so\n
+libwrap.so: $(LIB_OBJ)\n
+\tgcc -shared $^ -o $@\n")))
+             ;; Deal with some gcc breakage.
+             (substitute* "percent_m.c"
+               (("extern char .sys_errlist.*;") ""))
+             (substitute* "scaffold.c"
+               (("extern char .malloc.*;") ""))
+             ;; This, believe it or not, is the recommended way to build!
+             (zero? (system* "make" "REAL_DAEMON_DIR=/etc" "linux"))))
+         ;; There is no make install stage, so we have to do it ourselves.
+         (replace 'install
+           (lambda _
+             (let ((out (assoc-ref %outputs "out"))
+                   (man-pages `("hosts_access.3"
+                               "hosts_access.5"
+                               "hosts_options.5"
+                               "tcpd.8"
+                               "tcpdchk.8"
+                               "tcpdmatch.8"))
+                   (libs  `("libwrap.a"
+                            "libwrap.so"))
+                   (headers `("tcpd.h"))
+                   (bins `("safe_finger"
+                          "tcpd"
+                          "tcpdchk"
+                          "tcpdmatch"
+                          "try-from")))
+               (map (lambda (x)
+                      (install-file x (string-append
+                                    (assoc-ref %outputs "out")
+                                   "/include"))) headers)
+               (map (lambda (x)
+                      (install-file x (string-append
+                                    (assoc-ref %outputs "out")
+                                   "/share/man/man"
+                                   (string-take-right x 1)))) man-pages)
+               (map (lambda (x)
+                      (install-file x (string-append
+                                    (assoc-ref %outputs "out")
+                                   "/lib/"))) libs)
+               (map (lambda (x)
+                      (install-file x (string-append
+                                    (assoc-ref %outputs "out")
+                                    "/bin/"))) bins)))))))
+    (home-page "http://www.porcupine.org")
+    (synopsis  "Monitor and filter incoming requests for network services")
+    (description "With this package you can monitor and filter incoming requests for
+network services.  It includes a library which may be used by daemons to
+transparently check connection attempts against an access control list.")
+   (license (license:non-copyleft "file://DISCLAIMER"
+                                  "See the file DISCLAIMER in the distribution."))))
+
+
 (define-public zeromq
   (package
     (name "zeromq")
-- 
2.1.4

             reply	other threads:[~2016-09-04 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 13:20 John Darrington [this message]
2016-09-07  9:15 ` [PATCH] gnu: Add tcp-wrappers Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472995202-20512-1-git-send-email-jmd@gnu.org \
    --to=jmd@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.