pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/ntopng Add rudimentary SunOS support.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/537ef645bc77
branches:  trunk
changeset: 363773:537ef645bc77
user:      fhajny <fhajny%pkgsrc.org@localhost>
date:      Thu Jun 15 14:54:44 2017 +0000

description:
Add rudimentary SunOS support.

diffstat:

 net/ntopng/Makefile                                 |  10 ++++-
 net/ntopng/distinfo                                 |   8 ++-
 net/ntopng/patches/patch-include_ntop__includes.h   |  16 ++++++-
 net/ntopng/patches/patch-src_PacketDumperTuntap.cpp |   8 ++--
 net/ntopng/patches/patch-src_Utils.cpp              |  42 +++++++++++++++++++++
 net/ntopng/patches/patch-third-party_snmp_net.c     |  15 +++++++
 6 files changed, 88 insertions(+), 11 deletions(-)

diffs (162 lines):

diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/Makefile
--- a/net/ntopng/Makefile       Thu Jun 15 14:23:10 2017 +0000
+++ b/net/ntopng/Makefile       Thu Jun 15 14:54:44 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2017/04/30 01:21:57 ryoon Exp $
+# $NetBSD: Makefile,v 1.12 2017/06/15 14:54:44 fhajny Exp $
 
 DISTNAME=      ntopng-2.4-stable
 PKGNAME=       ntopng-2.4
@@ -27,6 +27,14 @@
 SUBST_SED.fix-vers=    -e 's,@VERSION@,${PKGVERSION},g'
 SUBST_SED.fix-vers+=   -e 's,@SHORT_VERSION@,${PKGVERSION_NOREV},g'
 
+# Portable types
+CFLAGS.SunOS+=         -Du_int8_t=uint8_t
+CFLAGS.SunOS+=         -Du_int16_t=uint16_t
+CFLAGS.SunOS+=         -Du_int32_t=uint32_t
+CFLAGS.SunOS+=         -Du_int64_t=uint64_t
+
+LDFLAGS.SunOS+=                -lresolv
+
 pre-configure:
        cd ${WRKSRC} && cp configure.seed configure.ac && autoreconf -fiv
 
diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/distinfo
--- a/net/ntopng/distinfo       Thu Jun 15 14:23:10 2017 +0000
+++ b/net/ntopng/distinfo       Thu Jun 15 14:54:44 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2016/07/01 04:51:15 adam Exp $
+$NetBSD: distinfo,v 1.4 2017/06/15 14:54:44 fhajny Exp $
 
 SHA1 (ntopng-2.4-stable.tar.gz) = ceb08377f98e8d149e39f5546a62e2f6ca980a31
 RMD160 (ntopng-2.4-stable.tar.gz) = 14940d0ea398cd43d7c31868f34b833b214386e7
@@ -6,7 +6,9 @@
 Size (ntopng-2.4-stable.tar.gz) = 134074662 bytes
 SHA1 (patch-Makefile.in) = 9ef39a98e77d4bbf5afdde4e2a23e72d80fe9fd0
 SHA1 (patch-configure.seed) = b2c6e07c21f234c089e8a6319cb4dd476ba7890b
-SHA1 (patch-include_ntop__includes.h) = dd8f61228d6a8d96a5577e53857cb8a05394a036
+SHA1 (patch-include_ntop__includes.h) = 2bf588dba941f25b71381c7848b237d964d77f31
 SHA1 (patch-src_DivertInterface.cpp) = 0a0ba0510b284fe40c432cf6db02a9906b03f236
-SHA1 (patch-src_PacketDumperTuntap.cpp) = 274b70f065f407ca34a3d88e021924639ffa105b
+SHA1 (patch-src_PacketDumperTuntap.cpp) = 76415461ebbe88d886111aa2d6508c7eec66b11d
 SHA1 (patch-src_Redis.cpp) = 10f04cb1b300cd400905df993bb7d4f20431569b
+SHA1 (patch-src_Utils.cpp) = a3a0f86956dba31e23b0dc4a7739777a9479386f
+SHA1 (patch-third-party_snmp_net.c) = defaacb719c2fb0276932554a7951f02a19ba4ef
diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/patches/patch-include_ntop__includes.h
--- a/net/ntopng/patches/patch-include_ntop__includes.h Thu Jun 15 14:23:10 2017 +0000
+++ b/net/ntopng/patches/patch-include_ntop__includes.h Thu Jun 15 14:54:44 2017 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-include_ntop__includes.h,v 1.1 2016/04/08 16:59:07 adam Exp $
+$NetBSD: patch-include_ntop__includes.h,v 1.2 2017/06/15 14:54:45 fhajny Exp $
 
-Add NetBSD support.
+Add NetBSD and SunOS support.
 
---- include/ntop_includes.h.orig       2016-04-04 12:57:38.000000000 +0000
+--- include/ntop_includes.h.orig       2016-06-27 19:31:18.000000000 +0000
 +++ include/ntop_includes.h
 @@ -43,7 +43,7 @@
  #include <arpa/inet.h>
@@ -13,3 +13,13 @@
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
+@@ -51,6 +51,9 @@
+ #include <net/if_arp.h>
+ #include <netinet/if_ether.h>
+ #include <netinet/in_systm.h>
++#elif defined(__sun)
++#include <netinet/in_systm.h>
++#include <sys/sockio.h>
+ #else
+ #include <net/ethernet.h>
+ #endif
diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/patches/patch-src_PacketDumperTuntap.cpp
--- a/net/ntopng/patches/patch-src_PacketDumperTuntap.cpp       Thu Jun 15 14:23:10 2017 +0000
+++ b/net/ntopng/patches/patch-src_PacketDumperTuntap.cpp       Thu Jun 15 14:54:44 2017 +0000
@@ -1,15 +1,15 @@
-$NetBSD: patch-src_PacketDumperTuntap.cpp,v 1.1 2016/04/08 16:59:07 adam Exp $
+$NetBSD: patch-src_PacketDumperTuntap.cpp,v 1.2 2017/06/15 14:54:45 fhajny Exp $
 
-Add NetBSD support.
+Add NetBSD and SunOS support.
 
---- src/PacketDumperTuntap.cpp.orig    2016-04-04 12:59:52.000000000 +0000
+--- src/PacketDumperTuntap.cpp.orig    2016-06-27 19:31:18.000000000 +0000
 +++ src/PacketDumperTuntap.cpp
 @@ -127,7 +127,7 @@ int PacketDumperTuntap::openTap(char *de
  
  /* ********************************************* */
  
 -#ifdef __OpenBSD__
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
  #define OPENBSD_TAPDEVICE_SIZE 32
  int PacketDumperTuntap::openTap(char *dev, /* user-definable interface name, eg. edge0 */ int mtu) {
    int i;
diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/patches/patch-src_Utils.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ntopng/patches/patch-src_Utils.cpp    Thu Jun 15 14:54:44 2017 +0000
@@ -0,0 +1,42 @@
+$NetBSD: patch-src_Utils.cpp,v 1.1 2017/06/15 14:54:45 fhajny Exp $
+
+d_type is not POSIX, provide workaround for SunOS.
+
+--- src/Utils.cpp.orig 2016-06-27 19:31:18.000000000 +0000
++++ src/Utils.cpp
+@@ -23,6 +23,9 @@
+ 
+ #include <curl/curl.h>
+ #include <string.h>
++#ifdef __sun
++struct stat s;
++#endif
+ 
+ // A simple struct for strings.
+ typedef struct {
+@@ -1232,7 +1235,12 @@ bool scan_dir(const char * dir_name, lis
+     entry = readdir (d);
+     if(!entry) break;
+     d_name = entry->d_name;
++#ifdef __sun
++    stat(entry->d_name, &s);
++    if (!(s.st_mode & S_IFDIR)) {
++#else
+     if(!(entry->d_type & DT_DIR)) {
++#endif
+       if(!stat(entry->d_name, &file_stats)) {
+         struct dirent *temp = (struct dirent *)malloc(sizeof(struct dirent));
+         memcpy(temp, entry, sizeof(struct dirent));
+@@ -1241,7 +1249,12 @@ bool scan_dir(const char * dir_name, lis
+       }
+     }
+ 
++#ifdef __sun
++    stat(entry->d_name, &s);
++    if (s.st_mode & S_IFDIR) {
++#else
+     if(entry->d_type & DT_DIR) {
++#endif
+       if(strncmp (d_name, "..", 2) != 0 &&
+           strncmp (d_name, ".", 1) != 0) {
+         int path_length;
diff -r 96a6f1b236a8 -r 537ef645bc77 net/ntopng/patches/patch-third-party_snmp_net.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ntopng/patches/patch-third-party_snmp_net.c   Thu Jun 15 14:54:44 2017 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-third-party_snmp_net.c,v 1.1 2017/06/15 14:54:45 fhajny Exp $
+
+SunOS doesn't have gethostbyname2.
+
+--- third-party/snmp/net.c.orig        2016-06-27 19:31:19.000000000 +0000
++++ third-party/snmp/net.c
+@@ -15,7 +15,7 @@
+ #define __USE_GNU
+ #endif
+ 
+-#ifdef WIN32
++#if defined(WIN32) || defined(__sun)
+ #define gethostbyname2(a, b) gethostbyname(a)
+ #else
+ #include <unistd.h>



Home | Main Index | Thread Index | Old Index