Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2011 15:55:26 -0500 (EST)
From:      Michael Scheidell <scheidell@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/163682: [PATCH] net/ntop fix depends/fix chown on db
Message-ID:  <20111228205526.A00E21D3C8@scanner.secnap.net>
Resent-Message-ID: <201112282100.pBSL0Tgd005103@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163682
>Category:       ports
>Synopsis:       [PATCH] net/ntop fix depends/fix chown on db
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 28 21:00:29 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Michael Scheidell
>Release:        FreeBSD 7.4-RELEASE-p3 i386
>Organization:
SECNAP Network Security Corp
>Environment:

tested on 7.3/4 amd64 /i386
>Description:
	- Fix RUN_DEPENDS (:=), mostly for portlint
	- Change WITH_PCAP_PORT to LIB_DEPENDS, not BUILD_DEPENDS
	- add stopdaemon to pkg-plist
	- need chown in pkg-plist so that .tbz (package building) works
	- clean up install message (patch-Makefile.am)
	- add test in pkg-deinstall.in to test for DBDIR
>How-To-Repeat:
	if you make a package, and install it on a clean system, it 
would not chown DBDIR/ntop
	It is POSSIBLE that you would have a problem with pcap lib
	(original test was for ./a file, new test is for .so)

>Fix:

Apply this patch. tested several times both 
make/install/deinstall/package/pkg_add/pkg_delete, but I am also running 
it in tinderbox, just to make sure.

--- ntop_patch.txt begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/net/ntop/Makefile,v
retrieving revision 1.99
diff -u -u -r1.99 Makefile
--- Makefile	21 Nov 2011 00:57:36 -0000	1.99
+++ Makefile	28 Dec 2011 20:41:34 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	ntop
 PORTVERSION=	4.1.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net
 #MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/Stable
@@ -21,10 +21,8 @@
 BUILD_DEPENDS=	rrdtool>=1.2:${PORTSDIR}/databases/rrdtool \
 		dot:${PORTSDIR}/graphics/graphviz \
 		geoiplookup:${PORTSDIR}/net/GeoIP
-RUN_DEPENDS=	dot:${PORTSDIR}/graphics/graphviz \
-		${LOCALBASE}/lib/X11/fonts/URW/a010013l.afm:${PORTSDIR}/x11-fonts/urwfonts \
-		rrdtool>=1.2:${PORTSDIR}/databases/rrdtool \
-		geoiplookup:${PORTSDIR}/net/GeoIP
+RUN_DEPENDS:=	${BUILD_DEPENDS} \
+		 ${LOCALBASE}/lib/X11/fonts/URW/a010013l.afm:${PORTSDIR}/x11-fonts/urwfonts
 
 DBDIR?=		/var/db
 
@@ -53,7 +51,6 @@
 
 ##
 ## Available knobs:
-##    WITH_LOCALE:        Enable locale (i18n) support.
 ##    WITH_PCAP_PORT:     Use libpcap from ports.
 ##    WITH_XMLDUMP:       Enable XML Dump support.
 ##
@@ -64,7 +61,7 @@
 .include <bsd.port.pre.mk>
 
 .if defined(WITH_PCAP_PORT)
-BUILD_DEPENDS+=		${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
+LIB_DEPENDS+=		pcap.1:${PORTSDIR}/net/libpcap
 CONFIGURE_ARGS+=	--with-pcap-root=${LOCALBASE}
 .else
 CONFIGURE_ARGS+=	--with-pcap-root=/usr
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/net/ntop/pkg-plist,v
retrieving revision 1.20
diff -u -u -r1.20 pkg-plist
--- pkg-plist	18 Aug 2011 23:17:11 -0000	1.20
+++ pkg-plist	28 Dec 2011 20:41:34 -0000
@@ -1,3 +1,4 @@
+@stopdaemon ntop
 bin/ntop
 etc/ntop/GeoIPASNum.dat
 etc/ntop/GeoLiteCity.dat
@@ -453,7 +454,6 @@
 %%DATADIR%%/python/templates/rrdAlarmConfigurator.tmpl
 %%DATADIR%%/python/templates/rrdAlarmConfiguratorHelp.tmpl
 %%DATADIR%%/python/templates/rrdAlarmStart.tmpl
-@exec mkdir -p %%DBDIR%%/ntop
 @dirrm %%DATADIR%%/html/MochiKit
 @dirrm %%DATADIR%%/html/PlotKit
 @dirrm %%DATADIR%%/html/img_inquisitor
@@ -475,3 +475,7 @@
 @dirrm etc/ntop
 @dirrm lib/ntop/plugins
 @dirrm lib/ntop
+@exec mkdir -p %%DBDIR%%/ntop
+@exec chown -R nobody:nobody %%DBDIR%%/ntop
+@unexec rmdir %%DBDIR%%/ntop 2>/dev/null || true
+@unexec rmdir %%DBDIR%% 2>/dev/null || true
Index: files/patch-Makefile.am
===================================================================
RCS file: /home/pcvs/ports/net/ntop/files/patch-Makefile.am,v
retrieving revision 1.8
diff -u -u -r1.8 patch-Makefile.am
--- files/patch-Makefile.am	11 Feb 2011 13:34:49 -0000	1.8
+++ files/patch-Makefile.am	28 Dec 2011 20:41:34 -0000
@@ -1,6 +1,6 @@
---- ./Makefile.am.orig	2011-02-02 10:24:56.000000000 +0100
-+++ ./Makefile.am	2011-02-02 10:50:06.000000000 +0100
-@@ -68,8 +68,6 @@
+--- Makefile.am.orig	2011-03-03 08:44:59.000000000 -0500
++++ Makefile.am	2011-12-28 14:25:08.000000000 -0500
+@@ -61,8 +61,6 @@
  
  ETTER_PASSIVE_FILE = etter.finger.os
  ETTER_PASSIVE = $(ETTER_PASSIVE_FILE).gz
@@ -9,7 +9,25 @@
  
  NTOPDATA = ntop-cert.pem \
             $(ETTER_PASSIVE) \
-@@ -337,7 +335,6 @@
+@@ -303,15 +301,14 @@
+ 	  echo "  WARNING: This install created a directory for the ntop"; \
+ 	  echo "           files and databases:"; \
+ 	  echo ""; \
+-	  echo "             $(DESTDIR)/$(datadir)/ntop"; \
++	  echo "             $(CFG_DBFILE_DIR)"; \
+ 	  echo ""; \
+ 	  echo "           This directory MUST be owned by the user"; \
+ 	  echo "           which you are going to use to run ntop."; \
+ 	  echo ""; \
+ 	  echo "           The command you must issue is something like:"; \
+ 	  echo ""; \
+-	  echo "           chown -R ntop.ntop $(DESTDIR)/$(datadir)/ntop"; \
+-	  echo "     or    chown -R ntop:users $(DESTDIR)/$(datadir)/ntop"; \
++	  echo "           chown -R nobody:nobody $(CFG_DBFILE_DIR)"; \
+ 	  echo ""; \
+ 	  echo "           man chown to check the syntax for YOUR system"; \
+ 	  echo ""; \
+@@ -329,7 +326,6 @@
  	chcon -t textrel_shlib_t $(DESTDIR)$(libdir)/*ntop*.so
  
  install-data-local: ntop.txt ntop.html faq.html dnetter
@@ -17,7 +35,7 @@
  	@if ! test -d $(DESTDIR)/$(datadir)/ntop; then \
  	  $(top_srcdir)/mkinstalldirs $(DESTDIR)/$(datadir)/ntop; \
  	  touch $(DESTDIR)/$(datadir)/ntop/warnuser; \
-@@ -373,21 +370,6 @@
+@@ -365,21 +361,6 @@
  	@echo ""
  	@echo ""
  	@echo -n "Preparing "
@@ -39,7 +57,7 @@
  	@echo -n "New file lines are:  "
  	@gunzip -c oui.txt.gz | wc -l
  	@echo ""
-@@ -406,34 +388,6 @@
+@@ -398,34 +379,6 @@
  	@echo "Preparing "
  	@echo ""
  
Index: files/pkg-deinstall.in
===================================================================
RCS file: /home/pcvs/ports/net/ntop/files/pkg-deinstall.in,v
retrieving revision 1.2
diff -u -u -r1.2 pkg-deinstall.in
--- files/pkg-deinstall.in	2 Aug 2009 19:35:02 -0000	1.2
+++ files/pkg-deinstall.in	28 Dec 2011 20:41:34 -0000
@@ -7,6 +7,7 @@
 	DEINSTALL)
 		;;
 	POST-DEINSTALL)
+		if [ -d %%DBDIR%%/ntop ];then
 		echo "===> post-deinstallation information for $1"
 		echo ""
 		echo "     Please note that ntop was not completely removed"
@@ -15,6 +16,7 @@
 		echo "     %%DBDIR%%/ntop can be removed if this port will not be"
 		echo "     reinstalled."
 		echo ""
+		fi
 		;;
 	*)
 		exit 64
--- ntop_patch.txt ends here ---


______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________  
  
>Release-Note:
>Audit-Trail:
>Unformatted:



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