2012-12-12 05:27:01 +00:00
|
|
|
{ stdenv, fetchurl, libpcap, tcl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "hping";
|
2012-12-12 05:27:01 +00:00
|
|
|
version = "20051105";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.hping.org/hping3-${version}.tar.gz";
|
|
|
|
sha256 = "1s5f9xd1msx05ibhwaw37jmc7l9fahcxxslqz8a83p0i5ak739pm";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libpcap tcl ];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
MANPATH="$out/share/man" ./configure
|
|
|
|
sed -i -r -e 's|/usr(/s?bin)|'"$out"'\1|g' Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
TCLSH = "${tcl}/bin/tclsh";
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
sed -i -e '/#if.*defined(__i386__)/a \
|
|
|
|
|| defined(__x86_64__) \\
|
|
|
|
' bytesex.h
|
|
|
|
|
|
|
|
sed -i -e 's|#include.*net/bpf.h|#include <pcap/bpf.h>|' \
|
|
|
|
libpcap_stuff.c script.c
|
|
|
|
|
|
|
|
sed -i -r -e 's|"(/usr/(local/)?)?bin/"|"${tcl}/bin"|g' \
|
|
|
|
-e 's!/usr/(local/)?(lib|include)!${tcl}/\2!g' \
|
|
|
|
configure
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -vp "$out/sbin" "$out/share/man/man8"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -vs hping3.8.gz "$out/share/man/man8/hping.8.gz"
|
|
|
|
ln -vs hping3.8.gz "$out/share/man/man8/hping2.8.gz"
|
|
|
|
'';
|
|
|
|
|
2016-09-16 10:11:22 +01:00
|
|
|
meta = with stdenv.lib; {
|
2012-12-12 05:27:01 +00:00
|
|
|
description = "A command-line oriented TCP/IP packet assembler/analyzer";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.hping.org/;
|
2016-09-16 10:11:22 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
broken = stdenv.isDarwin;
|
2012-12-12 05:27:01 +00:00
|
|
|
};
|
|
|
|
}
|