2020-11-07 12:39:22 +01:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub, fetchurl, qmake, makeDesktopItem
|
|
|
|
, qtbase, qtscript, protobuf, libpcap, wireshark, gzip, diffutils, gawk
|
|
|
|
, libnl
|
2016-01-03 09:06:47 +01:00
|
|
|
}:
|
|
|
|
|
2020-11-07 12:39:22 +01:00
|
|
|
mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ostinato";
|
2020-11-07 12:39:22 +01:00
|
|
|
version = "1.1";
|
2017-03-09 14:46:33 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pstavirs";
|
|
|
|
repo = "ostinato";
|
|
|
|
rev = "v${version}";
|
2020-11-07 12:39:22 +01:00
|
|
|
sha256 = "0B3jOj5rA3/rD2gXS2praZImeP34zN06fOPy/IswXOg=";
|
2016-01-03 09:06:47 +01:00
|
|
|
};
|
|
|
|
|
2017-03-09 14:46:33 +01:00
|
|
|
ostinatoIcon = fetchurl {
|
2018-03-25 07:04:25 +02:00
|
|
|
url = "https://ostinato.org/images/site-logo.png";
|
2016-01-04 07:26:54 +01:00
|
|
|
sha256 = "f5c067823f2934e4d358d76f65a343efd69ad783a7aeabd7ab4ce3cd03490d70";
|
|
|
|
};
|
|
|
|
|
2020-11-07 12:39:22 +01:00
|
|
|
buildInputs = [ qtbase protobuf libpcap qtscript libnl ];
|
2016-01-03 09:06:47 +01:00
|
|
|
|
2020-11-07 12:39:22 +01:00
|
|
|
nativeBuildInputs = [ qmake ];
|
2016-01-03 09:06:47 +01:00
|
|
|
|
2016-04-17 01:38:45 +02:00
|
|
|
patches = [ ./drone_ini.patch ];
|
2020-11-07 12:39:22 +01:00
|
|
|
prePatch = ''
|
|
|
|
sed -i 's|/usr/include/libnl3|${libnl.dev}/include/libnl3|' server/drone.pro
|
|
|
|
'';
|
2016-01-03 09:06:47 +01:00
|
|
|
|
2017-03-09 14:46:33 +01:00
|
|
|
desktopItem = makeDesktopItem {
|
2020-11-07 12:39:22 +01:00
|
|
|
type = "Application";
|
2017-03-09 14:46:33 +01:00
|
|
|
name = "ostinato";
|
|
|
|
desktopName = "Ostinato";
|
|
|
|
genericName = "Packet/Traffic Generator and Analyzer";
|
|
|
|
comment = "Network packet and traffic generator and analyzer with a friendly GUI";
|
|
|
|
categories = "Network";
|
|
|
|
terminal = "false";
|
|
|
|
startupNotify = "true";
|
|
|
|
exec = "$out/bin/ostinato";
|
|
|
|
icon = ostinatoIcon;
|
|
|
|
extraEntries = ''
|
|
|
|
GenericName[it]=Generatore ed Analizzatore di pacchetti di rete
|
|
|
|
Comment[it]=Generatore ed Analizzatore di pacchetti di rete con interfaccia amichevole
|
|
|
|
'';
|
2020-10-15 01:24:45 +02:00
|
|
|
fileValidation = false;
|
2017-03-09 14:46:33 +01:00
|
|
|
};
|
|
|
|
|
2016-01-03 09:06:47 +01:00
|
|
|
postInstall = ''
|
2017-03-09 14:46:33 +01:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
|
|
|
|
2016-01-03 09:06:47 +01:00
|
|
|
cat > $out/bin/ostinato.ini <<EOF
|
|
|
|
WiresharkPath=${wireshark}/bin/wireshark
|
|
|
|
TsharkPath=${wireshark}/bin/tshark
|
|
|
|
GzipPath=${gzip}/bin/gzip
|
|
|
|
DiffPath=${diffutils}/bin/diff
|
|
|
|
AwkPath=${gawk}/bin/awk
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
2017-12-05 16:29:29 +01:00
|
|
|
# `cd common; qmake ostproto.pro; make pdmlreader.o`:
|
|
|
|
# pdmlprotocol.h:23:25: fatal error: protocol.pb.h: No such file or directory
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2020-11-07 12:39:22 +01:00
|
|
|
meta = with lib; {
|
2016-01-03 09:06:47 +01:00
|
|
|
description = "A packet traffic generator and analyzer";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://ostinato.org";
|
2017-03-09 14:46:33 +01:00
|
|
|
license = licenses.gpl3;
|
2016-01-03 09:06:47 +01:00
|
|
|
maintainers = with maintainers; [ rick68 ];
|
2017-03-09 14:46:33 +01:00
|
|
|
platforms = with platforms; linux ++ darwin ++ cygwin;
|
2016-01-03 09:06:47 +01:00
|
|
|
};
|
|
|
|
}
|