From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6sNk-0001hl-9k for guix-patches@gnu.org; Tue, 24 Oct 2017 02:08:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6sNe-0003pS-3U for guix-patches@gnu.org; Tue, 24 Oct 2017 02:08:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49647) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6sNd-0003pK-VR for guix-patches@gnu.org; Tue, 24 Oct 2017 02:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6sNd-0006lQ-QQ for guix-patches@gnu.org; Tue, 24 Oct 2017 02:08:01 -0400 Subject: [bug#28964] [PATCH] gnu: Add hping. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6sMS-0001cR-2O for guix-patches@gnu.org; Tue, 24 Oct 2017 02:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6sMO-0003O8-S0 for guix-patches@gnu.org; Tue, 24 Oct 2017 02:06:48 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34591) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6sMO-0003O2-Ng for guix-patches@gnu.org; Tue, 24 Oct 2017 02:06:44 -0400 From: Marius Bakke Date: Tue, 24 Oct 2017 08:06:36 +0200 Message-Id: <20171024060636.30232-1-mbakke@fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28964@debbugs.gnu.org * gnu/packages/networking.scm (hping): New public variable. --- gnu/packages/networking.scm | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index a6c104297..4c1771459 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2017 Gábor Boskovits ;;; Copyright © 2017 Thomas Danckaert +;;; Copyright © 2017 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +39,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) @@ -75,6 +77,7 @@ #:use-module (gnu packages qt) #:use-module (gnu packages readline) #:use-module (gnu packages ssh) + #:use-module (gnu packages tcl) #:use-module (gnu packages textutils) #:use-module (gnu packages tls) #:use-module (gnu packages valgrind) @@ -563,6 +566,70 @@ send out a ping packet and move on to the next target in a round-robin fashion.") (license license:expat))) +(define-public hping + (let ((commit "3547c7691742c6eaa31f8402e0ccbb81387c1b99") + (revision "0")) + (package + (name "hping") + (version (string-append "3.0.0-" revision "-" (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/antirez/hping") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "0y0n1ybij3yg9lfgzcwfmjz1sjg913zcqrv391xx83dm0j80sdpb")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'prepare-build + (lambda* (#:key inputs #:allow-other-keys) + (let ((tcl (assoc-ref inputs "tcl"))) + ;; Search for bpf.h in the right place. + (substitute* '("libpcap_stuff.c" "script.c") + (("") "")) + ;; Likewise for TCL. + (substitute* "configure" + (("/usr/include/tcl.h") + (string-append tcl "/include/tcl.h")) + (("ls -1 /usr/local/lib") + (string-append "ls -1 " tcl "/lib"))) + ;; Required environment variables. + (setenv "CC" "gcc") + (setenv "TCLSH" (which "tclsh")) + #t))) + (add-before 'install 'pre-install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (sbin (string-append out "/sbin")) + (man (string-append out "/share/man"))) + (mkdir-p sbin) + (mkdir-p (string-append man "/man8")) + (substitute* "Makefile" + (("/usr/sbin") sbin) + (("\\$\\{INSTALL_MANPATH\\}") man)) + ;; Fix references to wrong executable name. + (substitute* "docs/hping3.8" + (("hping2") "hping3") + (("HPING2") "HPING3")) + #t)))) + #:tests? #f)) ;no tests + (inputs + `(("libpcap" ,libpcap) + ("tcl" ,tcl))) + (home-page "http://www.hping.org/") + (synopsis "Network testing tool") + (description + "hping is a command-line oriented TCP/IP packet assembler/analyzer. +The interface is inspired by the @command{ping(8)} command, but hping isn't +only able to send ICMP echo requests. It supports TCP, UDP, ICMP and RAW-IP +protocols, has a traceroute mode, the ability to send files between a covered +channel, and many other features.") + (license license:gpl2)))) ;strlcpy.c is BSD-3 + (define-public httping (package (name "httping") -- 2.14.3