Bug 111540 - net-mgmt/cflowd fix
Summary: net-mgmt/cflowd fix
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 18:40 UTC by Alexandre Snarskii
Modified: 2007-06-15 18:10 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Snarskii 2007-04-13 18:40:08 UTC
	cflowd (ports/net-mgmt/cflowd) marked as BROKEN=Does not compile.

Fix: 

Cflowd does not compile because it required to be built by g++295,
	and it depends on c++ library from arts++ (ports/net-mgmt/arts++),
	which is compiled by default g++ (3.4.6 in my case). And, as C++
	name mangling changed from gcc2 to gcc3 - one compiler is just unable
	to find exported names mangled my other one.

	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.
How-To-Repeat: 	cd /usr/port/net-mgmt/cflowd ; make
Comment 1 Thierry Thomas freebsd_committer 2007-04-13 21:08:05 UTC
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.
Comment 2 Pav Lucistnik freebsd_committer 2007-06-15 18:06:20 UTC
State Changed
From-To: open->closed

I have finished the work thierry started, the port now builds and installs on 
my FreeBSD/amd64 6.2-STABLE.
Comment 3 dfilter service freebsd_committer 2007-06-15 18:06:46 UTC
pav         2007-06-15 17:06:41 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt/cflowd      Makefile 
    net-mgmt/cflowd/files 
                          patch-classes::include::CflowdNetMatrixKey.hh 
  Added files:
    net-mgmt/cflowd/files patch-classes_include_CflowdAsMatrix.hh 
                          patch-classes_include_CflowdInterfaceMatrix.hh 
                          patch-classes_include_CflowdNextHopTable.hh 
                          patch-classes_include_CflowdPortMatrix.hh 
                          patch-classes_include_CflowdProtocolTable.hh 
                          patch-classes_include_CflowdRawFlow.hh 
                          patch-classes_include_CflowdTosTable.hh 
                          patch-classes_include_CflowdUint16Uint16Key.hh 
                          patch-classes_include_CflowdUint64TrafficCounter.hh 
                          patch-classes_include_Signal.hh 
                          patch-classes_src_CflowdAsMatrix.cc 
                          patch-classes_src_CflowdRawFlowLogger.cc 
  Log:
  - Fix build with gcc34
  
  PR:             ports/111540
  Submitted by:   thierry (based on his patch)
  
  Revision  Changes    Path
  1.35      +20 -9     ports/net-mgmt/cflowd/Makefile
  1.2       +15 -4     ports/net-mgmt/cflowd/files/patch-classes::include::CflowdNetMatrixKey.hh
  1.1       +38 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdAsMatrix.hh (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdInterfaceMatrix.hh (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdNextHopTable.hh (new)
  1.1       +11 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdPortMatrix.hh (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdProtocolTable.hh (new)
  1.1       +29 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdRawFlow.hh (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdTosTable.hh (new)
  1.1       +28 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdUint16Uint16Key.hh (new)
  1.1       +29 -0     ports/net-mgmt/cflowd/files/patch-classes_include_CflowdUint64TrafficCounter.hh (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_include_Signal.hh (new)
  1.1       +18 -0     ports/net-mgmt/cflowd/files/patch-classes_src_CflowdAsMatrix.cc (new)
  1.1       +10 -0     ports/net-mgmt/cflowd/files/patch-classes_src_CflowdRawFlowLogger.cc (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"