Browse Source

gnu: Add net-tools.

* gnu/packages/linux.scm (net-tools): New variable.
Ludovic Courtès 8 years ago
1 changed files with 80 additions and 0 deletions
  1. +80

+ 80
- 0
gnu/packages/linux.scm View File

@ -30,6 +30,8 @@
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages algebra)
#:use-module ((gnu packages gettext)
#:renamer (symbol-prefix-proc 'g:))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu))
@ -566,3 +568,81 @@ controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
tools print detailed usage messages and are accompanied by a set of
(license gpl2+)))
(define-public net-tools
;; XXX: This package is basically unmaintained, but it provides a few
;; commands not yet provided by Inetutils, such as 'route', so we have to
;; live with it.
(name "net-tools")
(version "1.60")
(home-page "")
(source (origin
(method url-fetch)
(uri (string-append home-page "/" name "-"
version ".tar.bz2"))
(build-system gnu-build-system)
'(#:phases (alist-replace
(lambda* (#:key inputs #:allow-other-keys)
(define (apply-patch file)
(zero? (system* "patch" "-p1" "--batch"
"--input" file)))
(let ((patch.gz (assoc-ref inputs "patch")))
(format #t "applying Debian patch set '~a'...~%"
(system (string-append "gunzip < " patch.gz " > the-patch"))
(pk 'here)
(and (apply-patch "the-patch")
(for-each apply-patch
(find-files "debian/patches"
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(mkdir-p (string-append out "/bin"))
(mkdir-p (string-append out "/sbin"))
;; Pretend we have everything...
(system "yes | make config")
;; ... except we don't have libdnet, so remove that
;; definition.
(substitute* '("config.make" "config.h")
(("^.*HAVE_AFDECnet.*$") ""))))
;; Binaries that depend on libnet-tools.a don't declare that
;; dependency, making it parallel-unsafe.
#:parallel-build? #f
#:tests? #f ; no test suite
#:make-flags (list "CC=gcc"
(string-append "BASEDIR="
(assoc-ref %outputs "out")))))
;; Use the big Debian patch set (the thing does not even compile out of
;; the box.)
(inputs `(("patch" ,(origin
(method url-fetch)
(native-inputs `(("gettext" ,g:gettext)))
(synopsis "Tools for controlling the network subsystem in Linux")
"This package includes the important tools for controlling the network
subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
netstat, rarp and route. Additionally, this package contains utilities
relating to particular network hardware types (plipconfig, slattach) and
advanced aspects of IP configuration (iptunnel, ipmaddr).")
(license gpl2+)))