summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2004-02-05 15:16:37 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2004-02-05 15:16:37 +0000
commit889aa7118a073ffe3d29505b6b69d19cf9a9d96d (patch)
tree4c3d3d435341c8b25c9fc89fb0eb7e166cbfba62 /net-analyzer/ntop
parentpre6 was a buggy version. version bumped to pre7 and fixed savedconfig. (diff)
downloadgentoo-2-889aa7118a073ffe3d29505b6b69d19cf9a9d96d.tar.gz
gentoo-2-889aa7118a073ffe3d29505b6b69d19cf9a9d96d.tar.bz2
gentoo-2-889aa7118a073ffe3d29505b6b69d19cf9a9d96d.zip
AMD64 Keyword and other fixes
Diffstat (limited to 'net-analyzer/ntop')
-rw-r--r--net-analyzer/ntop/ChangeLog5
-rw-r--r--net-analyzer/ntop/files/gd-1.8.3-fpic.patch55
-rw-r--r--net-analyzer/ntop/files/gdchart0.94c-fpic.patch29
-rw-r--r--net-analyzer/ntop/files/libpng-1.2.4-fpic.patch13
-rw-r--r--net-analyzer/ntop/files/zlib-1.1.4-build-fPIC.patch61
-rw-r--r--net-analyzer/ntop/files/zlib-1.1.4-build-static-with-fpic.patch13
-rw-r--r--net-analyzer/ntop/files/zlib-1.1.4-glibc.patch11
-rw-r--r--net-analyzer/ntop/files/zlib-1.1.4-gzprintf.patch294
-rw-r--r--net-analyzer/ntop/files/zlib-1.1.4-mapfile.patch79
-rw-r--r--net-analyzer/ntop/ntop-2.2c.ebuild37
10 files changed, 590 insertions, 7 deletions
diff --git a/net-analyzer/ntop/ChangeLog b/net-analyzer/ntop/ChangeLog
index d83a28bb9d40..f41a0aee7970 100644
--- a/net-analyzer/ntop/ChangeLog
+++ b/net-analyzer/ntop/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for net-analyzer/ntop
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ChangeLog,v 1.17 2004/01/12 06:04:07 seemant Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ChangeLog,v 1.18 2004/02/05 15:16:37 aliz Exp $
+
+ 05 Feb 2004; Daniel Ahlberg <aliz@gentoo.org> ntop-2.2c.ebuild:
+ Added fpic patches to make it compile on amd64. Also compile everything with our preferred cflags.
11 Jan 2004; Seemant Kulleen <seemant@gentoo.org> ntop-2.0.99_rc2-r2.ebuild:
sed -i
diff --git a/net-analyzer/ntop/files/gd-1.8.3-fpic.patch b/net-analyzer/ntop/files/gd-1.8.3-fpic.patch
new file mode 100644
index 000000000000..0f50dc8fd2ed
--- /dev/null
+++ b/net-analyzer/ntop/files/gd-1.8.3-fpic.patch
@@ -0,0 +1,55 @@
+--- Makefile 2004-02-05 14:24:07.339051848 +0000
++++ Makefile 2004-02-05 14:39:37.227687288 +0000
+@@ -96,38 +96,41 @@
+ sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
+ sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
+
++%.o: %.c
++ $(CC) $(CFLAGS) -fPIC -c $< -o $@
++
+ gddemo: gddemo.o libgd.a
+- $(CC) gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gddemo.o -o gddemo $(LIBDIRS) $(LIBS)
+
+ pngtogd: pngtogd.o libgd.a
+- $(CC) pngtogd.o -o pngtogd $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC pngtogd.o -o pngtogd $(LIBDIRS) $(LIBS)
+
+ webpng: webpng.o libgd.a
+- $(CC) webpng.o -o webpng $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC webpng.o -o webpng $(LIBDIRS) $(LIBS)
+
+ pngtogd2: pngtogd2.o libgd.a
+- $(CC) pngtogd2.o -o pngtogd2 $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC pngtogd2.o -o pngtogd2 $(LIBDIRS) $(LIBS)
+
+ gdtopng: gdtopng.o libgd.a
+- $(CC) gdtopng.o -o gdtopng $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gdtopng.o -o gdtopng $(LIBDIRS) $(LIBS)
+
+ gd2topng: gd2topng.o libgd.a
+- $(CC) gd2topng.o -o gd2topng $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gd2topng.o -o gd2topng $(LIBDIRS) $(LIBS)
+
+ gd2copypal: gd2copypal.o libgd.a
+- $(CC) gd2copypal.o -o gd2copypal $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gd2copypal.o -o gd2copypal $(LIBDIRS) $(LIBS)
+
+ gdparttopng: gdparttopng.o libgd.a
+- $(CC) gdparttopng.o -o gdparttopng $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gdparttopng.o -o gdparttopng $(LIBDIRS) $(LIBS)
+
+ gdtest: gdtest.o libgd.a
+- $(CC) gdtest.o -o gdtest $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gdtest.o -o gdtest $(LIBDIRS) $(LIBS)
+
+ gd2time: gd2time.o libgd.a
+- $(CC) gd2time.o -o gd2time $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gd2time.o -o gd2time $(LIBDIRS) $(LIBS)
+
+ gdtestttf: gdtestttf.o libgd.a
+- $(CC) gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
++ $(CC) $(CFLAGS) -fPIC gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
+
+ libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
+ gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
diff --git a/net-analyzer/ntop/files/gdchart0.94c-fpic.patch b/net-analyzer/ntop/files/gdchart0.94c-fpic.patch
new file mode 100644
index 000000000000..b566edfb3bba
--- /dev/null
+++ b/net-analyzer/ntop/files/gdchart0.94c-fpic.patch
@@ -0,0 +1,29 @@
+--- Makefile.in 2004-02-05 15:11:29.652954456 +0000
++++ Makefile.in 2004-02-05 15:12:11.349615600 +0000
+@@ -1,4 +1,4 @@
+-CC = @CC@ -fPIC
++CC = @CC@
+ GDC_INCL = .
+ GD_INCL = gd-1.8.3
+ GD_LIB = gd-1.8.3
+@@ -12,16 +12,16 @@
+
+ # --- compile the lib ---
+ price_conv.o: price_conv.c
+- $(CC) -g -c price_conv.c
++ $(CC) $(CFLAGS) -fPIC -g -c price_conv.c
+
+ gdc.o: gdc.c gdc.h
+- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -g -c gdc.c
++ $(CC) $(CFLAGS) -fPIC -I$(GD_INCL) -I$(GDC_INCL) -g -c gdc.c
+
+ gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie.c
+- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -g -c gdc_pie.c
++ $(CC) $(CFLAGS) -fPIC -I$(GD_INCL) -I$(GDC_INCL) -g -c gdc_pie.c
+
+ gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdchart.c
+- $(CC) -I$(GD_INCL) -I$(GDC_INCL) -g -c gdchart.c
++ $(CC) $(CFLAGS) -fPIC -I$(GD_INCL) -I$(GDC_INCL) -g -c gdchart.c
+
+ $(GD_LIB)/libgd.a:
+ cd $(GD_LIB) ; $(MAKE) -f Makefile libgd.a
diff --git a/net-analyzer/ntop/files/libpng-1.2.4-fpic.patch b/net-analyzer/ntop/files/libpng-1.2.4-fpic.patch
new file mode 100644
index 000000000000..2e0294e78397
--- /dev/null
+++ b/net-analyzer/ntop/files/libpng-1.2.4-fpic.patch
@@ -0,0 +1,13 @@
+--- scripts/makefile.linux 2004-02-05 13:47:03.155179192 +0000
++++ scripts/makefile.linux 2004-02-05 13:48:45.163671544 +0000
+@@ -73,8 +73,8 @@
+
+ all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config
+
+-libpng.a: $(OBJS)
+- ar rc $@ $(OBJS)
++libpng.a: $(OBJSDLL)
++ ar rc $@ $(OBJSDLL)
+ $(RANLIB) $@
+
+ libpng.pc:
diff --git a/net-analyzer/ntop/files/zlib-1.1.4-build-fPIC.patch b/net-analyzer/ntop/files/zlib-1.1.4-build-fPIC.patch
new file mode 100644
index 000000000000..a29bee225acc
--- /dev/null
+++ b/net-analyzer/ntop/files/zlib-1.1.4-build-fPIC.patch
@@ -0,0 +1,61 @@
+--- zlib-1.1.4/Makefile.in.build-fPIC 2003-01-30 01:35:18.000000000 -0500
++++ zlib-1.1.4/Makefile.in 2003-01-30 01:40:49.000000000 -0500
+@@ -41,6 +41,8 @@ includedir = ${prefix}/include
+ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
++PIC_OBJS = $(OBJS:%.o=%.lo)
++
+ OBJA =
+ # to use the asm code: make OBJA=match.o
+
+@@ -80,8 +82,11 @@ match.o: match.S
+ mv _match.o match.o
+ rm -f _match.s
+
+-$(SHAREDLIB).$(VER): $(OBJS)
+- $(LDSHARED) -o $@ $(OBJS) -lc
++%.lo: %.c
++ $(CC) $(CFLAGS) -DPIC -fPIC -c $< -o $@
++
++$(SHAREDLIB).$(VER): $(PIC_OBJS)
++ $(LDSHARED) -o $@ $(PIC_OBJS) -lc
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
+@@ -92,11 +97,8 @@ example: example.o $(LIBS)
+ minigzip: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+-install: $(LIBS)
+- -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
++install-libs: $(LIBS)
+ -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+- cp zlib.h zconf.h $(includedir)
+- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ cp $(LIBS) $(libdir)
+ cd $(libdir); chmod 755 $(LIBS)
+ -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+@@ -109,6 +111,11 @@ install: $(LIBS)
+ # The ranlib in install is needed on NeXTSTEP which checks file times
+ # ldconfig is for Linux
+
++install: install-libs
++ -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
++ cp zlib.h zconf.h $(includedir)
++ chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
++
+ uninstall:
+ cd $(includedir); \
+ v=$(VER); \
+--- zlib-1.1.4/configure.build-fPIC 2003-01-30 01:35:18.000000000 -0500
++++ zlib-1.1.4/configure 2003-01-30 01:39:59.000000000 -0500
+@@ -130,7 +130,7 @@ if test $shared -eq 1; then
+ if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
+ test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
+ CFLAGS="$SFLAGS"
+- LIBS="$SHAREDLIB.$VER"
++ LIBS="$LIBS $SHAREDLIB.$VER"
+ echo Building shared library $SHAREDLIB.$VER with $CC.
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
+ echo No shared library suppport.
diff --git a/net-analyzer/ntop/files/zlib-1.1.4-build-static-with-fpic.patch b/net-analyzer/ntop/files/zlib-1.1.4-build-static-with-fpic.patch
new file mode 100644
index 000000000000..de9aa583a1e6
--- /dev/null
+++ b/net-analyzer/ntop/files/zlib-1.1.4-build-static-with-fpic.patch
@@ -0,0 +1,13 @@
+--- Makefile.in 2004-02-05 13:35:09.214714640 +0000
++++ Makefile.in 2004-02-05 13:40:16.145054136 +0000
+@@ -72,8 +72,8 @@
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+-libz.a: $(OBJS) $(OBJA)
+- $(AR) $@ $(OBJS) $(OBJA)
++libz.a: $(PIC_OBJS) $(OBJA)
++ $(AR) $@ $(PIC_OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+ match.o: match.S
diff --git a/net-analyzer/ntop/files/zlib-1.1.4-glibc.patch b/net-analyzer/ntop/files/zlib-1.1.4-glibc.patch
new file mode 100644
index 000000000000..49ded8639f8e
--- /dev/null
+++ b/net-analyzer/ntop/files/zlib-1.1.4-glibc.patch
@@ -0,0 +1,11 @@
+--- zlib-1.1.3/Makefile.in.glibc Wed Sep 9 11:48:46 1998
++++ zlib-1.1.3/Makefile.in Wed Sep 9 11:49:04 1998
+@@ -80,7 +80,7 @@
+ rm -f _match.s
+
+ $(SHAREDLIB).$(VER): $(OBJS)
+- $(LDSHARED) -o $@ $(OBJS)
++ $(LDSHARED) -o $@ $(OBJS) -lc
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
diff --git a/net-analyzer/ntop/files/zlib-1.1.4-gzprintf.patch b/net-analyzer/ntop/files/zlib-1.1.4-gzprintf.patch
new file mode 100644
index 000000000000..28b610f57a79
--- /dev/null
+++ b/net-analyzer/ntop/files/zlib-1.1.4-gzprintf.patch
@@ -0,0 +1,294 @@
+This patch fixes security holes caused by potential buffer overflows
+in the implementation of the gzprintf() function in zlib 1.1.4. The
+security holes are fixed for platforms providing vsnprintf(3) and
+snprintf(3) only. This patch is derived from a prepared security patch,
+originally created by Kelledin <kelledin@users.sourceforge.net>. The
+OpenPKG project reduced the patch in size and fixed the configuration
+checks.
+
+diff -ru3 zlib-1.1.4.orig/configure zlib-1.1.4/configure
+--- zlib-1.1.4.orig/configure Wed Jul 8 20:19:35 1998
++++ zlib-1.1.4/configure Thu Feb 27 15:14:54 2003
+@@ -155,7 +155,212 @@
+ echo "Checking for unistd.h... No."
+ fi
+
+-cat > $test.c <<EOF
++cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdlib.h>
++
++#if (defined(__MSDOS__) || defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)) && !defined(STDC)
++# define STDC
++#endif
++
++int main()
++{
++#ifndef STDC
++ choke me
++#endif
++
++ return 0;
++}
++EOF
++
++if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ echo "Checking whether to use vsnprintf() or snprintf()... using vsnprintf()"
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest(char *fmt, ...)
++{
++ char buf[20];
++ va_list ap;
++
++ va_start(ap, fmt);
++ vsnprintf(buf, sizeof(buf), fmt, ap);
++ va_end(ap);
++ return 0;
++}
++
++int main()
++{
++ return (mytest("Hello%d\n", 1));
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_vsnprintf"
++ echo "Checking for vsnprintf() in stdio.h... Yes."
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest(char *fmt, ...)
++{
++ int i;
++ char buf[20];
++ va_list ap;
++
++ va_start(ap, fmt);
++ i = vsnprintf(buf, sizeof(buf), fmt, ap);
++ va_end(ap);
++ return 0;
++}
++
++int main()
++{
++ return (mytest("Hello%d\n", 1));
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_vsnprintf_return"
++ echo "Checking for return value of vsnprintf()... Yes."
++ else
++ echo "Checking for return value of vsnprintf()... No."
++ echo " WARNING: apparently vsnprintf() does not return a value. zlib"
++ echo " can build but will be open to possible string-format security"
++ echo " vulnerabilities."
++ fi
++ else
++ echo "Checking for vsnprintf() in stdio.h... No."
++ echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib"
++ echo " can build but will be open to possible buffer-overflow security"
++ echo " vulnerabilities."
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest(char *fmt, ...)
++{
++ int i;
++ char buf[20];
++ va_list ap;
++
++ va_start(ap, fmt);
++ i = vsprintf(buf, fmt, ap);
++ va_end(ap);
++ return 0;
++}
++
++int main()
++{
++ return (mytest("Hello%d\n", 1));
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_vsprintf_return"
++ echo "Checking for return value of vsprintf()... Yes."
++ else
++ echo "Checking for return value of vsprintf()... No."
++ echo " WARNING: apparently vsprintf() does not return a value. zlib"
++ echo " can build but will be open to possible string-format security"
++ echo " vulnerabilities."
++ fi
++ fi
++else
++ echo "Checking whether to use vsnprintf() or snprintf()... using snprintf()"
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest()
++{
++ char buf[20];
++
++ snprintf(buf, sizeof(buf), "%s", "foo");
++ return 0;
++}
++
++int main()
++{
++ return (mytest());
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_snprintf"
++ echo "Checking for snprintf() in stdio.h... Yes."
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest(char *fmt, ...)
++{
++ int i;
++ char buf[20];
++
++ i = snprintf(buf, sizeof(buf), "%s", "foo");
++ return 0;
++}
++
++int main()
++{
++ return (mytest());
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_snprintf_return"
++ echo "Checking for return value of snprintf()... Yes."
++ else
++ echo "Checking for return value of snprintf()... No."
++ echo " WARNING: apparently snprintf() does not return a value. zlib"
++ echo " can build but will be open to possible string-format security"
++ echo " vulnerabilities."
++ fi
++ else
++ echo "Checking for snprintf() in stdio.h... No."
++ echo " WARNING: snprintf() not found, falling back to sprintf(). zlib"
++ echo " can build but will be open to possible buffer-overflow security"
++ echo " vulnerabilities."
++
++ cat >$test.c <<EOF
++#include <stdio.h>
++#include <stdarg.h>
++
++int mytest(char *fmt, ...)
++{
++ int i;
++ char buf[20];
++
++ i = sprintf(buf, "%s", "foo");
++ return 0;
++}
++
++int main()
++{
++ return (mytest());
++}
++EOF
++
++ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
++ CFLAGS="$CFLAGS -DHAS_sprintf_return"
++ echo "Checking for return value of sprintf()... Yes."
++ else
++ echo "Checking for return value of sprintf()... No."
++ echo " WARNING: apparently sprintf() does not return a value. zlib"
++ echo " can build but will be open to possible string-format security"
++ echo " vulnerabilities."
++ fi
++ fi
++fi
++
++cat >$test.c <<EOF
+ #include <errno.h>
+ int main() { return 0; }
+ EOF
+diff -ru3 zlib-1.1.4.orig/gzio.c zlib-1.1.4/gzio.c
+--- zlib-1.1.4.orig/gzio.c Mon Mar 11 14:16:01 2002
++++ zlib-1.1.4/gzio.c Thu Feb 27 14:29:26 2003
+@@ -530,13 +530,31 @@
+
+ va_start(va, format);
+ #ifdef HAS_vsnprintf
++# ifdef HAS_vsnprintf_return
++ len = vsnprintf(buf, sizeof(buf), format, va);
++ va_end(va);
++ if (len <= 0 || len >= sizeof(buf))
++ return 0;
++# else
+ (void)vsnprintf(buf, sizeof(buf), format, va);
++ va_end(va);
++ len = strlen(buf);
++ if (len <= 0)
++ return 0;
++# endif
+ #else
++# ifdef HAS_vsprintf_return
++ len = vsprintf(buf, format, va);
++ va_end(va);
++ if (len <= 0 || len >= sizeof(buf))
++ return 0;
++# else
+ (void)vsprintf(buf, format, va);
+-#endif
+ va_end(va);
+ len = strlen(buf); /* some *sprintf don't return the nb of bytes written */
+ if (len <= 0) return 0;
++# endif
++#endif
+
+ return gzwrite(file, buf, (unsigned)len);
+ }
+@@ -553,14 +571,31 @@
+ int len;
+
+ #ifdef HAS_snprintf
++# ifdef HAS_snprintf_return
++ len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
++ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
++ if (len <= 0 || len >= sizeof(buf))
++ return 0;
++# else
+ snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
++ len = strlen(buf);
++ if (len <= 0)
++ return 0;
++# endif
+ #else
++# ifdef HAS_sprintf_return
++ len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
++ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
++ if (len <= 0 || len >= sizeof(buf))
++ return 0;
++# else
+ sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+-#endif
+ len = strlen(buf); /* old sprintf doesn't return the nb of bytes written */
+ if (len <= 0) return 0;
++# endif
++#endif
+
+ return gzwrite(file, buf, len);
+ }
diff --git a/net-analyzer/ntop/files/zlib-1.1.4-mapfile.patch b/net-analyzer/ntop/files/zlib-1.1.4-mapfile.patch
new file mode 100644
index 000000000000..8b6d13a91269
--- /dev/null
+++ b/net-analyzer/ntop/files/zlib-1.1.4-mapfile.patch
@@ -0,0 +1,79 @@
+--- configure.orig 2003-11-04 20:00:19.192057400 -0800
++++ configure 2003-11-04 20:00:22.524327784 -0800
+@@ -72,7 +72,8 @@
+ SFLAGS=${CFLAGS-"-fPIC -O3"}
+ CFLAGS="$cflags"
+ case `(uname -s || echo unknown) 2>/dev/null` in
+- Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
++ Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"}
++ MAPFILE=${MAPFILE-"-Wl,--version-script,mapfile"};;
+ *) LDSHARED=${LDSHARED-"gcc -shared"};;
+ esac
+ else
+@@ -104,7 +105,8 @@
+ LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
+ SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
+ CFLAGS=${CFLAGS-"-fast -xcg89"}
+- LDSHARED=${LDSHARED-"cc -G"};;
++ MAPFILE=${MAPFILE-"-M mapfile"}
++ LDSHARED=${LDSHARED-"cc -G"};;
+ SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
+ CFLAGS=${CFLAGS-"-O2"}
+ LDSHARED=${LDSHARED-"ld"};;
+@@ -138,6 +140,7 @@
+ echo 'No shared library suppport; try without defining CC and CFLAGS'
+ shared=0;
+ fi
++ LDSHARED="${LDSHARED} ${MAPFILE}"
+ fi
+ if test $shared -eq 0; then
+ LDSHARED="$CC"
+--- /dev/null 2003-10-15 22:31:52.000000000 -0700
++++ mapfile 2003-11-04 19:44:59.742269984 -0800
+@@ -0,0 +1,46 @@
++{
++ global:
++ zlibVersion ;
++ deflateInit_ ;
++ deflateInit2_ ;
++ deflate ;
++ deflateSetDictionary ;
++ deflateCopy ;
++ deflateReset ;
++ deflateParams ;
++ deflateEnd ;
++ inflateInit_ ;
++ inflateInit2_ ;
++ inflate ;
++ inflateSetDictionary ;
++ inflateSync ;
++ inflateReset ;
++ inflateEnd ;
++ compress ;
++ compress2 ;
++ uncompress ;
++ gzopen ;
++ gzdopen ;
++ gzsetparams ;
++ gzread ;
++ gzwrite ;
++ gzprintf ;
++ gzputs ;
++ gzgets ;
++ gzputc ;
++ gzgetc ;
++ gzflush ;
++ gzseek ;
++ gzrewind ;
++ gztell ;
++ gzeof ;
++ gzclose ;
++ gzerror ;
++ adler32 ;
++ crc32 ;
++ zError ;
++ inflateSyncPoint ;
++ get_crc_table ;
++ local:
++ *;
++};
diff --git a/net-analyzer/ntop/ntop-2.2c.ebuild b/net-analyzer/ntop/ntop-2.2c.ebuild
index 3555665717ae..350812fd1c6d 100644
--- a/net-analyzer/ntop/ntop-2.2c.ebuild
+++ b/net-analyzer/ntop/ntop-2.2c.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ntop-2.2c.ebuild,v 1.4 2004/01/12 02:37:31 seemant Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ntop-2.2c.ebuild,v 1.5 2004/02/05 15:16:37 aliz Exp $
IUSE="ssl readline tcpd ncurses"
@@ -11,7 +11,7 @@ HOMEPAGE="http://www.ntop.org/ntop.html"
SLOT="0"
LICENSE="GPL-2"
-KEYWORDS="x86 ~ppc ~sparc hppa"
+KEYWORDS="x86 ~ppc ~sparc hppa ~amd64"
DEPEND=">=sys-libs/gdbm-1.8.0
>=net-libs/libpcap-0.5.2
@@ -20,6 +20,28 @@ DEPEND=">=sys-libs/gdbm-1.8.0
readline? ( >=sys-libs/readline-4.1 )
ncurses? ( sys-libs/ncurses )"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}/../gdchart0.94c/zlib-1.1.4/
+ epatch ${FILESDIR}/zlib-1.1.4-gzprintf.patch
+ epatch ${FILESDIR}/zlib-1.1.4-glibc.patch
+ epatch ${FILESDIR}/zlib-1.1.4-build-fPIC.patch
+ epatch ${FILESDIR}/zlib-1.1.4-mapfile.patch
+ epatch ${FILESDIR}/zlib-1.1.4-build-static-with-fpic.patch
+
+ cd ${S}/../gdchart0.94c/
+ epatch ${FILESDIR}/gdchart0.94c-fpic.patch
+
+ cd ${S}/../gdchart0.94c/gd-1.8.3/
+ epatch ${FILESDIR}/gd-1.8.3-fpic.patch
+
+ cd ${S}/../gdchart0.94c/gd-1.8.3/libpng-1.2.4/
+ epatch ${FILESDIR}/libpng-1.2.4-fpic.patch
+
+}
+
src_compile() {
cd ${S}
@@ -35,25 +57,28 @@ src_compile() {
# shipped with just in case future versions are incompatible -- blocke
# compile gdchart
+ einfo "Configure gdchart"
cd ../gdchart0.94c
./configure || die "gdchart configure problem"
# subtree #1
+ einfo "Compiling libpng"
cd gd-1.8.3/libpng-1.2.4
- [ "${ARCH}" = "hppa" ] && sed -i scripts/makefile.linux -e "/^CFLAGS/s/-O3/-O3 -fPIC/"
- make -f scripts/makefile.linux || die "libpng compile problem"
+ make -f scripts/makefile.linux CFLAGS="${CFLAGS}" || die "libpng compile problem"
# subtree #2
+ einfo "Compiling zlib"
cd ../../zlib-1.1.4/
./configure || die "zlib configure problem"
- [ "${ARCH}" = "hppa" ] && sed -i Makefile -e "/^CFLAGS/s/$/ -fPIC/"
make || die "zlib compile problem"
# gdchart make
+ einfo "Compiling gdchart"
cd ../
- make || die "gdchart compile problem"
+ make CFLAGS="${CFLAGS}" || die "gdchart compile problem"
# now ntop itself...
+ einfo "Compiling ntop"
cd ../ntop
econf ${myconf} || die "configure problem"
make || die "compile problem"