summaryrefslogtreecommitdiff
path: root/net-analyzer/nsat
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/nsat
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/nsat')
-rw-r--r--net-analyzer/nsat/Manifest13
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-amd64-compat.patch33
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-configure.patch25
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-libtirpc.patch33
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-lvalue-gcc4.patch11
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-misc.patch108
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-strip.patch10
-rw-r--r--net-analyzer/nsat/files/nsat-1.5-va_list.patch27
-rw-r--r--net-analyzer/nsat/metadata.xml12
-rw-r--r--net-analyzer/nsat/nsat-1.5-r3.ebuild69
-rw-r--r--net-analyzer/nsat/nsat-1.5-r4.ebuild79
11 files changed, 420 insertions, 0 deletions
diff --git a/net-analyzer/nsat/Manifest b/net-analyzer/nsat/Manifest
new file mode 100644
index 000000000000..bd9e58fde5ff
--- /dev/null
+++ b/net-analyzer/nsat/Manifest
@@ -0,0 +1,13 @@
+AUX nsat-1.5-amd64-compat.patch 1057 SHA256 e65189b4ccb514aab4ba818fff21769754c9ec24ce0d16de468682e1ac4b4af5 SHA512 e13248ff8ecbb7d659484d211959152cade74121a875f6141e512bbd8eb54495bfacd2acdc91334ab431e8c0f14c73f87297aa40fe98014f1d6c1f0ca04dd7f3 WHIRLPOOL d815efcf123008d32e78ddd51f7154544fb63d44d35bcc9087455709b97945c4aaddb63f3f0683c9cf2531f6fa01733373dbeaeffd0b214c3861a261e2ea4f6c
+AUX nsat-1.5-configure.patch 741 SHA256 75d65589316260e191bb30f836ec7411131eede06c7a0a2738fb5033137ef201 SHA512 1134f09b9aa3d715d7c6ef93ee31ead345f3e761f8903a2e6de454b3182cb88811b5e1823b80feab8a87e6194672d0f6f0d00895569fbde23447bccec1a0c8f6 WHIRLPOOL 1f71e851af400cea08cc4ecc13cb1ea01e2898fa5d11d150c230644b7eafa00c8c4f132a002184e21f9152cb78d74e46041359787385b4cba17570ba481d5425
+AUX nsat-1.5-libtirpc.patch 977 SHA256 5463a9729811e47e456cd6d45520f5660e61af96082e64c7accced02b59c7b9b SHA512 509b6c0ecd545893ee49f810c54b11c5c8f527ce14acf92a282f9d993392ab1e40a807a5a4646eb7b62c80f7e21593f2996dc83d0636344ca4273209bdc551bc WHIRLPOOL a687e2248866fdb6128072767f74c10f832021630de83589dcff54015fd8da3400416382d74effd592d8d3bc6b8f2168fa9a51e31612d6c191ffc2f27297c326
+AUX nsat-1.5-lvalue-gcc4.patch 375 SHA256 b7a79b1269c40f120f7bf9d84a47c4d85136eb3e31e08d2a1d8e61f11fc097f0 SHA512 4768bbc1e1e9ed2b4efe70ec55214827e2dfe59e9c838d8934fee43c886b386c5942e93d862c37f220bc5e019642b3d914e2fde175a2aeee4691c7933c1aa3b5 WHIRLPOOL 47b92d8c5b73e558f53d8cbfbcfa41abcb543020b2565271cd83352b42a44d5c7a19d61953c7ba137807729b557494b1dba8093517ce18262def610009058269
+AUX nsat-1.5-misc.patch 2422 SHA256 79e7888291623687bdf795a759d5080d9f3813a4ccad61331ea162c72648418b SHA512 e000011099c7cd5507d91af0d89ea94d2e44d257b3133d6788302733b2615dfa0148f758daa336be3221fde6de0e2e2994104bc8d0729850ed5b60e0eff82ab9 WHIRLPOOL 9508f045f79283e6a343efe51d8b9c1802443244179aa5cfbb4d05e01409838531d2d21b3753c2ac0da3a4f708dff3b855e4460eed9883bea4835cba0d33bc72
+AUX nsat-1.5-strip.patch 205 SHA256 2506beca0f13fe9717857d7b9f10970adacf7dc5e3d79f5e625ec323868e5c94 SHA512 3e8b312e704f08fbe86caea37a8491851474cb0b773a73f4b2995532086fefa85a5240f49084bb0e1195089bfbfa937e68c45c0908a2bb7f427775ccb4535e8e WHIRLPOOL 085053f8bc56dd99139d6c1915b6a252c7d4fe237c6c00a3062d7fc78d08ae48b7093512be3f4c62ca6195258b7d545d2089b9d9c6896181134bd6ddb5b58d68
+AUX nsat-1.5-va_list.patch 470 SHA256 63376bdfa6623806f73a122648069132814050e2460c6fd70721a542a9e78ef6 SHA512 1963419110a34b826d27b5b34e22ae71906380bc8a2ce130d374c00ad91827fab3781e97aadf417613f042d195ee9e85e50b898befff82190c7e031276903baa WHIRLPOOL 5f86e4a9609e83021e8d73db0a954bb8c964501b7140de1b66efae8f03aad8115b57465f7ac90cbb0f02d0797c53bdec84d5d07303641b3b69a502e4f63d289b
+DIST nsat-1.5.tgz 410603 SHA256 2ece807b3240a6e91ea88fd84c470a87de711c33554b231e071549388cb65114 SHA512 1a5b8e88f7bcacdbe1144a719a2e446c0ea025ad4e5f8c79ccb939083308cd2c1b2c1f3d7ab3b791924d5855994cbc3fded95aa36df23c12fd76fc20341a87d0 WHIRLPOOL 52cd94b75668bb3b7342090ec1ec9949b1e9324aabff4a0b03b251c0933829cd63eeb53877c463b282806896099ccbacaa01c390ef61c4b24e8c6d8e356fb5ff
+EBUILD nsat-1.5-r3.ebuild 1448 SHA256 378d9e538329914a4f572577988e673763e3d154d8228b8e68f61d3c325373ec SHA512 e9fed8fba8257ccafe401a4f16cbc70b9b8cace66342d6cbaadd70d88084fa84dc8a4a54e0b5047a201e159668ab3badf99f38a011f7130368b789043010d9d4 WHIRLPOOL bde059938ec0ae619e7286761aceaf5ab5951c216fe2e845f538f9bc42ebb51ccc6050f77bb043f6f5ead77a3ffb4374cdf5367335ca3df3384838e526b754e6
+EBUILD nsat-1.5-r4.ebuild 1547 SHA256 588a9536ef518aa5def79d94366ecc67f90f1179a33b494152d3b2d032afb783 SHA512 73263ccca5463bc90831b18d67a98e6274d917c2762778cb8de254e061466635b020947359a80eacb413a52d81faeb43e6d5d0ad82fb99acb4d1cbbbcdc561f2 WHIRLPOOL 721b3ff4058ffddfd26fcae6507a76a3ab68c02c4b1111640cc1b1a0d2fecf74b052eca170ba2a78db9e058c570779a91f57d77a07e19fa49d8f45551c472af0
+MISC ChangeLog 2622 SHA256 0d90dd2dedd9f2c12713b7fa966edff8ad94b17fa45ed1c2417acb6e6f3e8da2 SHA512 a46e1b35772f7b270d4c93025dc10f420b205e3d7d7ded7da8eb054b433c1efd69495bcc26b2953b01e0cba99af9f18d2f82ba7748f2821bae453a7e3ec412f3 WHIRLPOOL 164ed425bf826645102952a0edf7acfc2534f2b91f8c35b4a1a6e2c1ff27f0ad039e3917d4915f61e30801fefe9af0a96b500deea2114648c6489a6990671586
+MISC ChangeLog-2015 3998 SHA256 f75a6955e6279f241e262e0fee9361e9419e6453f22284a41d29b5009cf5a7aa SHA512 7dcb73dba87135237423d2c11e0580cc88d96f00ee4d95130de1b55c1fbe6ea47a0a106b396510e623c2d3866a39f8256520e219acbeb2c50dbae63c06bef9d8 WHIRLPOOL 0c2d6b9016dc517797583cc973de6e897918a442f0bf5f3c8e7a67b4d53c35e81476235b38314070e4552fbd43fa65feedbd3ac11b130a69d7718f39418d51d1
+MISC metadata.xml 468 SHA256 d7e7522d2eb250adbc98a65264c6c5357a9820f1718a84510610249994a6c6ec SHA512 54bdd25a484a9b3f2ec4642494f4f8e9433c33f013eadc149a77b0ffc3455579a3598ba323344107143b41ae81e1cef6195dcab5b38c6f093f804e468a650454 WHIRLPOOL 743139eea81ce4311ec612b9624ce2720d4fde08ca6cb85c472067c3ec29addcd6bc1b336995ae0e2eddd3cbc6ad0723e8c9a0ec1d521e7b06e312619d7ce1fe
diff --git a/net-analyzer/nsat/files/nsat-1.5-amd64-compat.patch b/net-analyzer/nsat/files/nsat-1.5-amd64-compat.patch
new file mode 100644
index 000000000000..883ad26cdfaf
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-amd64-compat.patch
@@ -0,0 +1,33 @@
+--- a/src/mod/xp_icmp_echo.c
++++ b/src/mod/xp_icmp_echo.c
+@@ -90,7 +90,7 @@
+ fprintf(stderr,"[%d bytes] sent, waiting for reponse.\n", res);
+ #endif
+
+- recv_pack = read_icmp(&res, ICMP_ECHOREPLY, -1);
++ recv_pack = read_icmp((ssize_t *)&res, ICMP_ECHOREPLY, -1);
+
+ if (recv_pack == NULL || (unsigned)res < sizeof(ip) + 8) {
+ #ifdef EBUG
+--- a/src/mod/xp_icmp_infr.c
++++ b/src/mod/xp_icmp_infr.c
+@@ -83,7 +83,7 @@
+ fprintf(stderr,"[%d bytes] sent, waiting for reponse.\n", res);
+ #endif
+
+- recv_pack = read_icmp(&res, ICMP_IREQREPLY, -1);
++ recv_pack = read_icmp((ssize_t *)&res, ICMP_IREQREPLY, -1);
+
+ if (recv_pack == NULL || (unsigned)res < sizeof(ip) + 8) {
+ #ifdef EBUG
+--- a/src/mod/xp_udp_probe.c
++++ b/src/mod/xp_udp_probe.c
+@@ -92,7 +92,7 @@
+ #ifdef EBUG
+ fprintf(stderr,"[%d bytes] sent, waiting for reponse.\n", res);
+ #endif
+- recv_pack = read_icmp(&res, ICMP_UNREACH, -1);
++ recv_pack = read_icmp((ssize_t *)&res, ICMP_UNREACH, -1);
+
+ if (recv_pack == NULL || (unsigned)res < sizeof(ip) + 8) {
+ #ifdef EBUG
diff --git a/net-analyzer/nsat/files/nsat-1.5-configure.patch b/net-analyzer/nsat/files/nsat-1.5-configure.patch
new file mode 100644
index 000000000000..d1bc1f95e6bb
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-configure.patch
@@ -0,0 +1,25 @@
+--- a/configure.in
++++ b/configure.in
+@@ -15,7 +15,6 @@
+ else
+ AC_MSG_RESULT(crappy :P)
+ fi
+- LEETCC=$ac_cv_prog_gcc;
+ AC_PROG_CXX
+ AC_PROG_INSTALL
+ AC_PROG_MAKE_SET
+@@ -45,11 +44,11 @@
+ if test $LEETCC = yes; then
+ CCOPTS='-Wall -O6 -funroll-loops -ansi -fPIC -DLINUX'
+ else
+- CCOPTS='-DLINUX'
++ CCOPTS="${CFLAGS} -DLINUX"
+ fi
+- CFLAGS="$CCOPTS"
+- SMBCFLAGS="-Wall -DLINUX -DNETGROUP -DALLOW_CHANGE_PASSWORD -DFAST_SHARE_MODES -DNO_ASMSIGNALH -DGLIBC2"
++ SMBCFLAGS="${CCOPTS} -Wall -DLINUX -DNETGROUP -DALLOW_CHANGE_PASSWORD -DFAST_SHARE_MODES -DNO_ASMSIGNALH -DGLIBC2"
+ SMBLFLAGS="-lnsl -lcrypt"
++ CFLAGS="${CCOPTS} -Wall -ansi -fPIC -DLINUX"
+ ;;
+ *Darwin* | *Mac* | *MAC*)
+ AC_MSG_RESULT(found MAC OS X)
diff --git a/net-analyzer/nsat/files/nsat-1.5-libtirpc.patch b/net-analyzer/nsat/files/nsat-1.5-libtirpc.patch
new file mode 100644
index 000000000000..c91afd3a78fa
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-libtirpc.patch
@@ -0,0 +1,33 @@
+--- a/configure.in
++++ b/configure.in
+@@ -195,6 +195,8 @@
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS(select socket strdup strstr random srandom snprintf setsockopt initstate gettimeofday strerror)
+
++PKG_CHECK_MODULES([TIRPC], [libtirpc], [], [AC_MSG_NOTICE([Using glibc rpc support])])
++
+ AC_OUTPUT(Makefile tools/Makefile src/Makefile src/mod/Makefile src/smb/Makefile src/libmix++/Makefile src/libmix++/mix/net.h)
+
+ AC_MSG_RESULT()
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -36,7 +36,7 @@
+ @cd mod ; $(MAKE) modobj
+
+ ../nsat: modobj
+- ${GPP} ${CFLAGS} ${LDFLAGS} ${OBJ} ${MODOBJ} ${MIXOBJ} -o ../nsat ${CLIB}
++ ${GPP} ${CFLAGS} ${LDFLAGS} ${OBJ} ${MODOBJ} ${MIXOBJ} -o ../nsat ${CLIB} @TIRPC_LIBS@
+
+ pidalloc.o:
+ ${GPP} ${CFLAGS} -c pidalloc.cpp
+--- a/src/mod/Makefile.in
++++ b/src/mod/Makefile.in
+@@ -35,7 +35,7 @@
+ ${GPP} ${CFLAGS} -c osscan.cpp
+
+ rpc.o:
+- ${GPP} ${CFLAGS} -c rpc.cpp
++ ${GPP} ${CFLAGS} @TIRPC_CFLAGS@ -c rpc.cpp
+
+ www.o:
+ ${GPP} ${CFLAGS} -c www.cpp
diff --git a/net-analyzer/nsat/files/nsat-1.5-lvalue-gcc4.patch b/net-analyzer/nsat/files/nsat-1.5-lvalue-gcc4.patch
new file mode 100644
index 000000000000..b4020b3f47ed
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-lvalue-gcc4.patch
@@ -0,0 +1,11 @@
+--- a/src/smb/ADMsmb.c
++++ b/src/smb/ADMsmb.c
+@@ -123,7 +123,7 @@
+ {
+ usleep (100000);
+
+- if (recvfrom (socket_client, buffer2, sizeof (buffer2), 0, (struct sockaddr *) &sin_dst, &(int) longueur) != -1)
++ if (recvfrom (socket_client, buffer2, sizeof (buffer2), 0, (struct sockaddr *) &sin_dst, (int *) &longueur) != -1)
+ {
+
+ if (nmb2->rep_num != 0)
diff --git a/net-analyzer/nsat/files/nsat-1.5-misc.patch b/net-analyzer/nsat/files/nsat-1.5-misc.patch
new file mode 100644
index 000000000000..f94fd24527b5
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-misc.patch
@@ -0,0 +1,108 @@
+* link against dev-libs/libmix
+* parallel $(MAKE)
+* usr/local/ -> usr/
+* LDFLAGS
+* verbose CC
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -7,14 +7,14 @@
+ # # #### # # #
+
+ # Change me if you want...
+-INSTALL_PATH=/usr/local/bin
+-MAN_PATH=/usr/local/man
++INSTALL_PATH=/usr/bin
++MAN_PATH=/usr/man
+
+ # If you change this, change src/lang.h as well
+-DATA_PATH=/usr/local/share/nsat
++DATA_PATH=/usr/share/nsat
+
+ all:
+- @cd src;make all
++ @cd src; $(MAKE) all
+ @echo ""
+ @echo " Compiling is done!"
+ @echo " You can now 'make install' to put the files in place."
+@@ -58,5 +58,5 @@
+ doc/nsat.8:
+ @echo "Hmm, can't find manpage -- skipping :/"
+
+-nsat:
+- @make all
++nsat: src
++ $(MAKE) all
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -21,22 +21,22 @@
+
+ MIXOBJ = libmix++/net/net.o libmix++/misc/misc.o libmix++/misc/exclude.o
+
+-all: ../smb-ns $(OBJ) modobj mixobj ../nsat
++all: ../smb-ns $(OBJ) modobj ../nsat
+
+ ../smb-ns:
+- @cd smb ; make smb
++ @cd smb ; $(MAKE) smb
+
+-mixobj: libmix++/Makefile
+- @cd libmix++ ; make
++#mixobj: libmix++/Makefile
++# @cd libmix++ ; $(MAKE)
+
+-libmix++/Makefile:
+- @cd .. ; ./configure
++#libmix++/Makefile:
++# @cd .. ; ./configure
+
+ modobj:
+- @cd mod ; make modobj
++ @cd mod ; $(MAKE) modobj
+
+-../nsat:
+- ${GPP} ${CFLAGS} ${OBJ} ${MODOBJ} ${MIXOBJ} -o ../nsat ${CLIB}
++../nsat: modobj
++ ${GPP} ${CFLAGS} ${LDFLAGS} ${OBJ} ${MODOBJ} ${MIXOBJ} -o ../nsat ${CLIB}
+
+ pidalloc.o:
+ ${GPP} ${CFLAGS} -c pidalloc.cpp
+@@ -63,11 +63,11 @@
+ ${GPP} ${CFLAGS} -c Logging.cpp
+
+ clean:
+- cd mod && make clean
++ cd mod && $(MAKE) clean
+ rm -f core *.o ../*.log *.log *~ ../nsat ../.nsrc ../.nspid
+
+ distclean: clean
+- @cd mod ; make clean
+- @cd smb ; make clean
+- @cd libmix++ ; make clean
++ @cd mod ; $(MAKE) clean
++ @cd smb ; $(MAKE) clean
++ @cd libmix++ ; $(MAKE) clean
+ rm -f mod/Makefile Makefile
+--- a/src/smb/Makefile.in
++++ b/src/smb/Makefile.in
+@@ -11,7 +11,6 @@
+ LIBDIR = $(BASEDIR)/lib
+ VARDIR = $(BASEDIR)/var
+ INSTALLPERMS = 0755
+-FLAGS1 = -O3
+ LIBS1 =
+ SHELL = /bin/sh
+ srcdir = ./
+@@ -53,10 +52,10 @@
+ .SUFFIXES: .c .o .h
+
+ .c.o: $(INCLUDES)
+- @$(CC) $(CFLAGS) -c $(srcdir)$*.c -o $(srcdir)$*.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -c $(srcdir)$*.c -o $(srcdir)$*.o
+
+ smb: msg $(CLIENT_OBJ) $(ARCFOUR_OBJ)
+- @$(CC) $(CFLAGS) -o $(BINARY) $(CLIENT_OBJ) $(ARCFOUR_OBJ) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(BINARY) $(CLIENT_OBJ) $(ARCFOUR_OBJ) $(LIBS)
+ @echo done
+
+ msg:
diff --git a/net-analyzer/nsat/files/nsat-1.5-strip.patch b/net-analyzer/nsat/files/nsat-1.5-strip.patch
new file mode 100644
index 000000000000..99fe77633ad8
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-strip.patch
@@ -0,0 +1,10 @@
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -37,7 +37,6 @@
+
+ ../nsat:
+ ${GPP} ${CFLAGS} ${OBJ} ${MODOBJ} ${MIXOBJ} -o ../nsat ${CLIB}
+- strip ../nsat
+
+ pidalloc.o:
+ ${GPP} ${CFLAGS} -c pidalloc.cpp
diff --git a/net-analyzer/nsat/files/nsat-1.5-va_list.patch b/net-analyzer/nsat/files/nsat-1.5-va_list.patch
new file mode 100644
index 000000000000..46bdd3bcc121
--- /dev/null
+++ b/net-analyzer/nsat/files/nsat-1.5-va_list.patch
@@ -0,0 +1,27 @@
+--- a/src/Logging.cpp
++++ b/src/Logging.cpp
+@@ -89,16 +89,17 @@
+ if((pi.Foreground) && (out!=NULL))
+ fprintf(stdout, "%s %s ", out, hn);
+
+- va_start(va, fmt);
+-
+- if(fp!=NULL)
++ if(fp!=NULL) {
++ va_start(va, fmt);
+ vfprintf(fp, fmt, va);
++ va_end(va);
++ }
+
+- if((pi.Foreground) && (out!=NULL))
++ if((pi.Foreground) && (out!=NULL)) {
++ va_start(va, fmt);
+ vfprintf(stdout, fmt, va);
+-
+- va_end(va);
+-
++ va_end(va);
++ }
+ if(fp!=NULL)
+ fprintf(fp, "\n");
+
diff --git a/net-analyzer/nsat/metadata.xml b/net-analyzer/nsat/metadata.xml
new file mode 100644
index 000000000000..0b7d0914b40c
--- /dev/null
+++ b/net-analyzer/nsat/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>netmon@gentoo.org</email>
+ <name>Gentoo network monitoring and analysis project</name>
+ </maintainer>
+ <longdescription>Network Security Analysis Tool, an application-level network security scanner</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">nsat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/nsat/nsat-1.5-r3.ebuild b/net-analyzer/nsat/nsat-1.5-r3.ebuild
new file mode 100644
index 000000000000..67ce3ebbb2ba
--- /dev/null
+++ b/net-analyzer/nsat/nsat-1.5-r3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="Network Security Analysis Tool, an application-level network security scanner"
+HOMEPAGE="http://nsat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/nsat/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc x86"
+IUSE="X"
+
+RDEPEND="
+ X? (
+ x11-libs/libX11
+ dev-lang/tk
+ )
+ dev-libs/libmix
+ net-libs/libpcap
+"
+DEPEND="$RDEPEND"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-configure.patch
+ epatch "${FILESDIR}"/${P}-lvalue-gcc4.patch
+ epatch "${FILESDIR}"/${P}-strip.patch
+ epatch "${FILESDIR}"/${P}-misc.patch
+ epatch "${FILESDIR}"/${P}-va_list.patch
+ use amd64 && epatch "${FILESDIR}"/${P}-amd64-compat.patch
+
+ sed -i \
+ -e "s:^#CGIFile /usr/local/share/nsat/nsat.cgi$:#CGIFile /usr/share/nsat/nsat.cgi:g" \
+ nsat.conf || die
+ sed -i -e "s:/usr/local:/usr:g" tools/xnsat || die
+ sed -i \
+ -e "s:/usr/local/share/nsat/nsat.conf:/etc/nsat/nsat.conf:g" \
+ -e "s:/usr/local/share/nsat/nsat.cgi:/usr/share/nsat/nsat.cgi:g" \
+ src/lang.h || die
+
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ econf $(use_with X x)
+}
+
+src_compile() {
+ emake MIXOBJ=-lmix++
+}
+
+src_install () {
+ dobin nsat smb-ns
+ use X && dobin tools/xnsat
+
+ insinto /usr/share/nsat
+ doins nsat.cgi
+
+ insinto /etc/nsat
+ doins nsat.conf
+
+ dodoc README doc/CHANGES
+ doman doc/nsat.8
+}
diff --git a/net-analyzer/nsat/nsat-1.5-r4.ebuild b/net-analyzer/nsat/nsat-1.5-r4.ebuild
new file mode 100644
index 000000000000..52381d75fcfb
--- /dev/null
+++ b/net-analyzer/nsat/nsat-1.5-r4.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Network Security Analysis Tool, an application-level network security scanner"
+HOMEPAGE="http://nsat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/nsat/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="X"
+
+RDEPEND="
+ dev-libs/libmix
+ net-libs/libpcap
+ X? (
+ dev-lang/tk:*
+ x11-libs/libX11
+ )
+ || ( <sys-libs/glibc-2.26
+ (
+ net-libs/libnsl
+ net-libs/libtirpc
+ net-libs/rpcsvc-proto
+ )
+ )
+"
+DEPEND="$RDEPEND"
+S="${WORKDIR}/${PN}"
+PATCHES=(
+ "${FILESDIR}"/${P}-configure.patch
+ "${FILESDIR}"/${P}-lvalue-gcc4.patch
+ "${FILESDIR}"/${P}-strip.patch
+ "${FILESDIR}"/${P}-misc.patch
+ "${FILESDIR}"/${P}-va_list.patch
+ "${FILESDIR}"/${P}-libtirpc.patch
+ "${FILESDIR}"/${P}-amd64-compat.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "s:^#CGIFile /usr/local/share/nsat/nsat.cgi$:#CGIFile /usr/share/nsat/nsat.cgi:g" \
+ nsat.conf || die
+ sed -i -e "s:/usr/local:/usr:g" tools/xnsat || die
+ sed -i \
+ -e "s:/usr/local/share/nsat/nsat.conf:/etc/nsat/nsat.conf:g" \
+ -e "s:/usr/local/share/nsat/nsat.cgi:/usr/share/nsat/nsat.cgi:g" \
+ src/lang.h || die
+
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ econf $(use_with X x)
+}
+
+src_compile() {
+ emake MIXOBJ=-lmix++
+}
+
+src_install () {
+ dobin nsat smb-ns
+ use X && dobin tools/xnsat
+
+ insinto /usr/share/nsat
+ doins nsat.cgi
+
+ insinto /etc/nsat
+ doins nsat.conf
+
+ dodoc README doc/CHANGES
+ doman doc/nsat.8
+}