Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Apr 2007 20:10:09 GMT
From:      Thierry Thomas <thierry@FreeBSD.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/111540: net-mgmt/cflowd fix
Message-ID:  <200704132010.l3DKA9RW014433@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/111540; it has been noted by GNATS.

From: Thierry Thomas <thierry@FreeBSD.org>
To: Alexandre Snarskii <snar@eltel.net>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/111540: net-mgmt/cflowd fix
Date: Fri, 13 Apr 2007 22:08:05 +0200

 On Fri 13 apr 07 at 19:13:16 +0200, Alexandre Snarskii <snar@eltel.net>
  wrote:
 
 > 	So, the fix for cflowd problem is really simple - just add 
 > 	USE_GCC=2.95 to arts++ Makefile. 
 > 
 > 	Of course, this fix broke all other arts++ dependencies, which does not 
 > 	have USE_GCC=2.95 in their Makefiles, but i'm not able to find any
 > 	other port depending on arts++, so, probably, this fix is safe enough.
 
 I had a work in progress to fix this port with gcc-3.4. It's not yet
 ready (and I never finished it...), but if you are interested, it could
 be a starting point to fix it properly:
 
 --- cflowd.diff begins here ---
 diff -urN net-mgmt/cflowd.orig/Makefile net-mgmt/cflowd/Makefile
 --- net-mgmt/cflowd.orig/Makefile	Wed Feb 14 07:48:07 2007
 +++ net-mgmt/cflowd/Makefile	Sun Apr  8 23:44:52 2007
 @@ -18,15 +18,11 @@
  
  LIB_DEPENDS=	Arts.0:${PORTSDIR}/net-mgmt/arts++
  
 -BROKEN=		Does not compile
 -DEPRECATED=	${BROKEN}
 -EXPIRATION_DATE=2007-04-10
 -
  GNU_CONFIGURE=	yes
 +USE_AUTOTOOLS=	libtool:15
  USE_GMAKE=	yes
  USE_BISON=	yes
  USE_LDCONFIG=	yes
 -USE_GCC=	2.95
  
  CONFIGURE_ARGS=	--enable-shared --with-artspp=${LOCALBASE}
  
 @@ -42,8 +38,18 @@
  PATCHFILES+=	cflowd-${PORTVERSION:S|.|-|g}-djp.patch
  .endif
  
 -post-configure:
 -	${REINPLACE_CMD} -e 's/ gcc\* / gcc\* | g\+\+\* /g' ${WRKSRC}/libtool
 +post-extract:
 +	${CHMOD} -R u+w ${WRKSRC}
 +
 +pre-configure:
 +	${FIND} ${WRKSRC} -type f | ${XARGS}	\
 +	${REINPLACE_CMD} -e 's|iostream.h>|iostream>|;s|strstream.h|sstream|'
 +	${FIND} ${WRKSRC} -name Makefile.in | ${XARGS}	\
 +	${REINPLACE_CMD} -e '/^LIBTOOL =/s^\$$(top_builddir)/libtool^${LIBTOOL}^'	\
 +		-e 's|$${LIBTOOL} $$(CXX)|$${LIBTOOL} --mode=compile $$(CXX)|'		\
 +		-e '/ -o /s|$${LIBTOOL} $${CXX}|$${LIBTOOL} --mode=link $${CXX}|'	\
 +		-e 's|$${LIBTOOL} $${CXX}|$${LIBTOOL} --mode=compile $${CXX}|'		\
 +		-e 's|$${LIBTOOL} \.\.|$${LIBTOOL} --mode=install ..|'
  
  post-install:
  	${INSTALL_SCRIPT} ${FILESDIR}/cflowd.sh \
 diff -urN net-mgmt/cflowd.orig/files/patch-classes_include_CflowdAsMatrix.hh net-mgmt/cflowd/files/patch-classes_include_CflowdAsMatrix.hh
 --- net-mgmt/cflowd.orig/files/patch-classes_include_CflowdAsMatrix.hh	Thu Jan  1 01:00:00 1970
 +++ net-mgmt/cflowd/files/patch-classes_include_CflowdAsMatrix.hh	Mon Apr  9 14:02:45 2007
 @@ -0,0 +1,38 @@
 +--- ./classes/include/CflowdAsMatrix.hh.orig	Mon Sep 21 18:31:43 1998
 ++++ ./classes/include/CflowdAsMatrix.hh	Mon Apr  9 14:02:43 2007
 +@@ -55,7 +55,7 @@
 + #include "CflowdAsMatrixTrafficCounter.hh"
 + #include "CflowdRawFlow.hh"
 + 
 +-typedef  map<CflowdAsMatrixKey, CflowdAsMatrixTrafficCounter, less<CflowdAsMatrixKey> >   CflowdAsMatrixMap_t;
 ++typedef  std::map<CflowdAsMatrixKey, CflowdAsMatrixTrafficCounter, std::less<CflowdAsMatrixKey> >   CflowdAsMatrixMap_t;
 + 
 + //---------------------------------------------------------------------------
 + //  class CflowdAsMatrix : public CflowdAsMatrixMap_t
 +@@ -70,7 +70,7 @@
 + class CflowdAsMatrix : public CflowdAsMatrixMap_t
 + {
 + public:
 +-  typedef CflowdAsMatrixMap_t::iterator        iterator;
 ++  typedef CflowdAsMatrixMap_t::iterator        std::iterator;
 +   typedef CflowdAsMatrixMap_t::const_iterator  const_iterator;
 + 
 +   //-------------------------------------------------------------------------
 +@@ -87,7 +87,7 @@
 +   //  Reads the contents of a CflowdAsMatrix from an istream.  Returns
 +   //  the istream.
 +   //-------------------------------------------------------------------------
 +-  istream & read(istream & is);
 ++  std::istream & read(std::istream & is);
 +   
 +   //-------------------------------------------------------------------------
 +   //                            int read(int fd)
 +@@ -103,7 +103,7 @@
 +   //  Writes the contents of a CflowdAsMatrix to an ostream.  Returns
 +   //  the ostream.
 +   //-------------------------------------------------------------------------
 +-  ostream & write(ostream & os) const;
 ++  std::ostream & write(std::ostream & os) const;
 +   
 +   //-------------------------------------------------------------------------
 +   //                         int write(int fd) const
 diff -urN net-mgmt/cflowd.orig/files/patch-classes_include_CflowdRawFlow.hh net-mgmt/cflowd/files/patch-classes_include_CflowdRawFlow.hh
 --- net-mgmt/cflowd.orig/files/patch-classes_include_CflowdRawFlow.hh	Thu Jan  1 01:00:00 1970
 +++ net-mgmt/cflowd/files/patch-classes_include_CflowdRawFlow.hh	Mon Apr  9 00:33:39 2007
 @@ -0,0 +1,29 @@
 +--- ./classes/include/CflowdRawFlow.hh.orig	Tue Feb 29 20:32:20 2000
 ++++ ./classes/include/CflowdRawFlow.hh	Mon Apr  9 00:33:03 2007
 +@@ -1016,7 +1016,7 @@
 +   //.........................................................................
 +   //  Reads a flow from an istream.  Returns the istream.
 +   //-------------------------------------------------------------------------
 +-  istream & Read(istream & is);
 ++  std::istream & Read(std::istream & is);
 + 
 +   //-------------------------------------------------------------------------
 +   //                            int Read(int fd)
 +@@ -1033,7 +1033,7 @@
 +   //.........................................................................
 +   //  Writes a flow to an ostream.  Returns the ostream.
 +   //-------------------------------------------------------------------------
 +-  ostream & Write(ostream & os) const;
 ++  std::ostream & Write(std::ostream & os) const;
 + 
 +   //-------------------------------------------------------------------------
 +   //                            int Write(int fd) const
 +@@ -1062,7 +1062,7 @@
 +   //  CflowdRawFlow object to an ostream in a human-readable form.
 +   //  Returns the ostream.
 +   //-------------------------------------------------------------------------
 +-  friend ostream& operator << (ostream& os,
 ++  friend std::ostream& operator << (std::ostream& os,
 +                                const CflowdRawFlow & flow);
 + 
 +   //-------------------------------------------------------------------------
 diff -urN net-mgmt/cflowd.orig/files/patch-classes_include_CflowdUint16Uint16Key.hh net-mgmt/cflowd/files/patch-classes_include_CflowdUint16Uint16Key.hh
 --- net-mgmt/cflowd.orig/files/patch-classes_include_CflowdUint16Uint16Key.hh	Thu Jan  1 01:00:00 1970
 +++ net-mgmt/cflowd/files/patch-classes_include_CflowdUint16Uint16Key.hh	Mon Apr  9 00:03:49 2007
 @@ -0,0 +1,28 @@
 +--- ./classes/include/CflowdUint16Uint16Key.hh.orig	Wed Aug 11 18:11:35 1999
 ++++ ./classes/include/CflowdUint16Uint16Key.hh	Mon Apr  9 00:03:09 2007
 +@@ -52,6 +52,7 @@
 + }
 + 
 + #include <map>
 ++#include <iostream>
 + 
 + #include "ArtsPrimitive.hh"
 + 
 +@@ -136,7 +137,7 @@
 +   //.........................................................................
 +   //  Reads the key from an istream.  Returns the istream.
 +   //-------------------------------------------------------------------------
 +-  inline istream & read(istream & is)
 ++  inline std::istream & read(std::istream & is)
 +   {
 +     g_CfdArtsPrimitive.ReadUint16(is,this->_src,sizeof(this->_src));
 +     g_CfdArtsPrimitive.ReadUint16(is,this->_dst,sizeof(this->_dst));
 +@@ -177,7 +178,7 @@
 +   //.........................................................................
 +   //  Writes the key to an ostream.  Returns the ostream.
 +   //-------------------------------------------------------------------------
 +-  inline ostream & write(ostream & os) const
 ++  inline std::ostream & write(std::ostream & os) const
 +   {
 +     g_CfdArtsPrimitive.WriteUint16(os,this->_src,sizeof(this->_src));
 +     g_CfdArtsPrimitive.WriteUint16(os,this->_dst,sizeof(this->_dst));
 diff -urN net-mgmt/cflowd.orig/files/patch-classes_include_CflowdUint64TrafficCounter.hh net-mgmt/cflowd/files/patch-classes_include_CflowdUint64TrafficCounter.hh
 --- net-mgmt/cflowd.orig/files/patch-classes_include_CflowdUint64TrafficCounter.hh	Thu Jan  1 01:00:00 1970
 +++ net-mgmt/cflowd/files/patch-classes_include_CflowdUint64TrafficCounter.hh	Mon Apr  9 00:18:34 2007
 @@ -0,0 +1,29 @@
 +--- ./classes/include/CflowdUint64TrafficCounter.hh.orig	Sun Feb  7 19:43:03 1999
 ++++ ./classes/include/CflowdUint64TrafficCounter.hh	Mon Apr  9 00:17:53 2007
 +@@ -49,6 +49,8 @@
 + #include "caida_t.h"
 + }
 + 
 ++#include <iostream>
 ++
 + #include "ArtsPrimitive.hh"
 + 
 + extern ArtsPrimitive g_CfdArtsPrimitive;
 +@@ -147,7 +149,7 @@
 +   //.........................................................................
 +   //  Reads the counter from an istream.  Returns the istream.
 +   //-------------------------------------------------------------------------
 +-  inline istream & read(istream & is)
 ++  inline std::istream & read(std::istream & is)
 +   {
 +     g_CfdArtsPrimitive.ReadUint64(is,this->_pkts,sizeof(this->_pkts));
 +     g_CfdArtsPrimitive.ReadUint64(is,this->_bytes,sizeof(this->_bytes));
 +@@ -190,7 +192,7 @@
 +   //.........................................................................
 +   //  Writes the counter to an ostream.  Returns the ostream.
 +   //-------------------------------------------------------------------------
 +-  inline ostream & write(ostream & os) const
 ++  inline std::ostream & write(std::ostream & os) const
 +   {
 +     g_CfdArtsPrimitive.WriteUint64(os,this->_pkts,sizeof(this->_pkts));
 +     g_CfdArtsPrimitive.WriteUint64(os,this->_bytes,sizeof(this->_bytes));
 diff -urN net-mgmt/cflowd.orig/files/patch-classes_src_CflowdAsMatrix.cc net-mgmt/cflowd/files/patch-classes_src_CflowdAsMatrix.cc
 --- net-mgmt/cflowd.orig/files/patch-classes_src_CflowdAsMatrix.cc	Thu Jan  1 01:00:00 1970
 +++ net-mgmt/cflowd/files/patch-classes_src_CflowdAsMatrix.cc	Mon Apr  9 14:04:48 2007
 @@ -0,0 +1,20 @@
 +--- ./classes/src/CflowdAsMatrix.cc.orig	Fri Feb 19 03:20:04 1999
 ++++ ./classes/src/CflowdAsMatrix.cc	Mon Apr  9 14:04:10 2007
 +@@ -50,7 +50,7 @@
 +                                    CflowdRawFlow::k_pktsMask|\
 +                                    CflowdRawFlow::k_bytesMask)
 + 
 +-static const string rcsid = "@(#) $Name: cflowd-2-1-b1 $ $Id: CflowdAsMatrix.cc,v 1.16 1999/02/19 02:20:04 dwm Exp $";
 ++static const std::string rcsid = "@(#) $Name: cflowd-2-1-b1 $ $Id: CflowdAsMatrix.cc,v 1.16 1999/02/19 02:20:04 dwm Exp $";
 + 
 + ArtsPrimitive g_CfdArtsPrimitive;
 + 
 +@@ -87,7 +87,7 @@
 + //.........................................................................
 + //  
 + //-------------------------------------------------------------------------
 +-istream & CflowdAsMatrix::read(istream & is)
 ++std::istream & CflowdAsMatrix::read(std::istream & is)
 + {
 +   uint64_t                      numEntries, entryNum;
 +   CflowdAsMatrixKey             asKey;
 --- cflowd.diff ends here ---
 
 Regards,
 -- 
 Th. Thomas.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704132010.l3DKA9RW014433>