+ (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
+ (revision "0"))
+ (package
+ (name "net-tools")
+ (version (string-append "1.60-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.code.sf.net/p/net-tools/code")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "189mdjfbd7j7j0jysy34nqn5byy9g5f6ylip1sikk7kz08vjml4s"))))
+ (home-page "http://net-tools.sourceforge.net/")
+ (build-system gnu-build-system)
+ (arguments
+ '(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (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 for the things we don't have.
+ ;; HAVE_AFDECnet requires libdnet, which we don't have.
+ ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
+ ;; that have been removed.
+ ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
+ ;; think about adding them later.
+ (substitute* '("config.make" "config.h")
+ (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
+ "")))))
+ (add-after 'install 'remove-redundant-commands
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Remove commands and man pages redundant with Inetutils.
+ (let* ((out (assoc-ref outputs "out"))
+ (dup (append-map (cut find-files out <>)
+ '("^hostname"
+ "^(yp|nis|dns)?domainname"))))
+ (for-each delete-file dup)
+ #t))))
+ ;; 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 (let ((out (assoc-ref %outputs "out")))
+ (list "CC=gcc"
+ (string-append "BASEDIR=" out)
+ (string-append "INSTALLNLSDIR=" out "/share/locale")
+ (string-append "mandir=/share/man")))))
+ (native-inputs `(("gettext" ,gettext-minimal)))
+ (synopsis "Tools for controlling the network subsystem in Linux")
+ (description
+ "This package includes the important tools for controlling the network
+subsystem of the Linux kernel. This includes arp, 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 license:gpl2+))))
+
+(define-public net-tools-for-tests
+ (hidden-package (package (inherit net-tools)