Bug 182445 - security/sancp port update, fix problem in 10.0
Summary: security/sancp port update, fix problem in 10.0
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: Danilo Egea Gondolfo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-27 15:50 UTC by pauls
Modified: 2013-10-07 15:20 UTC (History)
0 users

See Also:


Attachments
sancp.diff (469 bytes, patch)
2013-09-27 15:50 UTC, pauls
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pauls 2013-09-27 15:50:00 UTC
	security/sancp, fix problem with compiling in 10.0
	because gcc is missing
Comment 1 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2013-09-27 23:28:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danilo

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-10-07 15:11:52 UTC
Author: danilo
Date: Mon Oct  7 14:11:44 2013
New Revision: 329707
URL: http://svnweb.freebsd.org/changeset/ports/329707

Log:
  - Increment PORTREVISION [1]
  - Add LICENSE [1]
  - Minor changes in files/{pkg-message.in, sancp.in} [1]
  - Add stage support [1]
  - Remove indefinite article from COMMENT
  - Fix build with clang
  
  PR:		ports/182445
  Submitted by:	Paul Schmehl <pauls@utdallas.edu> (maintainer) [1]
  Approved by:	wg/culot (mentors, implicit)

Added:
  head/security/sancp/files/patch-sancp.cc   (contents, props changed)
Modified:
  head/security/sancp/Makefile
  head/security/sancp/files/pkg-message.in
  head/security/sancp/files/sancp.in
  head/security/sancp/pkg-plist

Modified: head/security/sancp/Makefile
==============================================================================
--- head/security/sancp/Makefile	Mon Oct  7 14:04:05 2013	(r329706)
+++ head/security/sancp/Makefile	Mon Oct  7 14:11:44 2013	(r329707)
@@ -4,36 +4,45 @@
 PORTNAME=	sancp
 PORTVERSION=	1.6.1
 DISTVERSIONSUFFIX=	-stable
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	security
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}-stable
 
 MAINTAINER=	pauls@utdallas.edu
-COMMENT=	A network connection profiler
+COMMENT=	Network connection profiler
+
+LICENSE=	QPLv1
+LICENSE_NAME=	Q PUBLIC LICENSE v1.0
+LICENSE_FILE=	${WRKSRC}/LICENSE
+LICENSE_PERMS=	auto-accept
 
 ALL_TARGET=	bsd
 USE_RC_SUBR=	sancp
-SUB_FILES=	pkg-message
+LOG_DIR=	/var/log/sancp
+PLIST_SUB+=	LOG_DIR=${LOG_DIR}
 
 USERS=		sancp
 GROUPS=		sancp
 
-PORTDOCS=	CHANGES INSTALL ISSUES README \
-		SETUP fields.LIST LICENSE
+OPTIONS_DEFINE=	DOCS
+
+PORTDOCS=	CHANGES INSTALL ISSUES \
+		README SETUP fields.LIST
+
+MAKE_ARGS=	CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+		LFLAGS="${LDFLAGS}"
 
-NO_STAGE=	yes
-post-extract:
-	@cd ${WRKSRC} && ${MV} LICENSE docs/
+post-patch:
+	@${REINPLACE_CMD} -e 's|gcc|$${CC}|g ; s|g++|$${CXX}|g' \
+		${WRKSRC}/Makefile
 
 do-install:
-	@${INSTALL_PROGRAM} ${WRKSRC}/sancp ${PREFIX}/bin
-	@${INSTALL_DATA} ${WRKSRC}/etc/sancp/sancp.conf ${PREFIX}/etc/sancp.conf-dist
-	@${CP} -n ${PREFIX}/etc/sancp.conf-dist ${PREFIX}/etc/sancp.conf || ${TRUE}
-
-.if !defined(NOPORTDOCS)
-	@${INSTALL} -d ${DOCSDIR}/
-	cd ${WRKSRC}/docs/ && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
-.endif
-	@${CAT} ${PKGMESSAGE}
+	@${INSTALL_PROGRAM} ${WRKSRC}/sancp \
+		${STAGEDIR}${PREFIX}/bin
+	@${INSTALL_DATA} ${WRKSRC}/etc/sancp/sancp.conf \
+		${STAGEDIR}${PREFIX}/etc/sancp.conf.dist
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/docs/|} ${STAGEDIR}${DOCSDIR}
+	${INSTALL} -m 750 -d ${STAGEDIR}${LOG_DIR}
 
 .include <bsd.port.mk>

Added: head/security/sancp/files/patch-sancp.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/sancp/files/patch-sancp.cc	Mon Oct  7 14:11:44 2013	(r329707)
@@ -0,0 +1,15 @@
+--- sancp.cc.orig	2013-10-04 17:55:19.000000000 +0000
++++ sancp.cc	2013-10-04 17:56:55.000000000 +0000
+@@ -271,10 +271,10 @@
+ /******************************************************************* 
+  * Function for C code to call C++ code (used by pcap_functions.c) * 
+  *******************************************************************/
+-
++         
+ extern "C" void ProcessMyPacket(char *user, struct pcap_pkthdr * pkthdr, u_char * pkt)
+ {
+-	extern struct gvars gVars;
++	struct gvars gVars;
+ 	CBuffer *buffer;
+ 	struct cnx *new_cnx=0;
+         gVars.timeptr.tv_sec=pkthdr->ts.tv_sec;

Modified: head/security/sancp/files/pkg-message.in
==============================================================================
--- head/security/sancp/files/pkg-message.in	Mon Oct  7 14:04:05 2013	(r329706)
+++ head/security/sancp/files/pkg-message.in	Mon Oct  7 14:11:44 2013	(r329707)
@@ -20,9 +20,5 @@ sancp.conf has been altered (you used sa
 new conf file, named sguil-sancp.conf-sample will be installed in the
 %%PREFIX%%/etc directory.  You should use that one for sguil.
 
-All of the configuration options for sancp are documented in the 
-startup script in %%PREFIX%%/etc/rc.d (don't forget to specify interface
-in /etc/rc.conf)
-
 If you're running sguil, you probably want to use at least the following flags:
 sancp_flags="-D -P -R -u sancp -g sancp -d /var/log/sancp"

Modified: head/security/sancp/files/sancp.in
==============================================================================
--- head/security/sancp/files/sancp.in	Mon Oct  7 14:04:05 2013	(r329706)
+++ head/security/sancp/files/sancp.in	Mon Oct  7 14:11:44 2013	(r329707)
@@ -16,41 +16,6 @@
 #				Default: %%PREFIX%%/etc/sancp.conf
 # sancp_interface (str):	Default: none - MUST BE SET
 #
-# Command Line Options: (cmdline)
-#   ---------------------
-#
-#	-? or -h  this help screen
-#	-c <filename>  specify the configuration/rules filename
-#	-d <directory>  specify the directory for output files
-#	-i <device>  set the network device to listen on (default: 'any')
-#	-g <gid>   set a group identity
-#	-u <uid>   set a user identity
-#	-r <pcapfile>  pcap file to read (overrides -i)
-#	-B "<bpf expression>"  set a bpf expression (alternative to -F <filename>)
-#	-D (daemon) forks, prints msgs to syslog only and overrides -C option
-#	-K (console) enable additional printing of 'realtimes' to stdout (suppressed by option -D)
-#	-F <bpf filename>  file containing a bpf filter expression, overrides (alternative to -B)
-#	-H --human-readable  write IP addresses in dotted notation and TCPflag fields in hex 
-#	-R  Set default for realtime to 'pass' (default is 'log') disables realtime, but rules can override
-#	-S  Set default for stats to 'pass' (default is 'log') disables stats, but rules can override
-#	-P  Set default for pcap to 'pass' (default is 'log') disables pcap, but rules can override
-#	-I or --enable_icmp_mixed  record 'code' and 'type' fields for ICMP
-#		to the fields 's_port' and 'd_port'.
-#		note: affects how related icmp packets are correlated 
-#	-V  display version
-#    --shift  (debug) force interpretation of packet starting at byte[2] 
-#                    normally performed when reading from the 'any' interface
-#	--strip-80211  strip 802.1Q headers from 802.1Q packets; used to 
-# 	  decode 802.1Q encapsulated packets - affects -A option, 
-#	--log-facility <facility>  where facility can be 'LOCAL1' - 'LOCAL7'
-#		The default log facility used by SANCP is LOG_DAEMON 
-#
-#      Debug mode for pcap data logging
-#	-A  records ALL traffic frames to a pcap file named 'debug_pcap_raw'
-#	  (despite rules). Packets are logged here prior to decoding or handling. 
-#	  Use -F or -B option to restrict what is collectedi.
-#	  Pcap data logged using this option is affected by the --strip-80211 cmdline option
-#	  The configuration file equivalent to this is 'default debug_pcap_raw enable'
 
 . /etc/rc.subr
 

Modified: head/security/sancp/pkg-plist
==============================================================================
--- head/security/sancp/pkg-plist	Mon Oct  7 14:04:05 2013	(r329706)
+++ head/security/sancp/pkg-plist	Mon Oct  7 14:11:44 2013	(r329707)
@@ -1,4 +1,5 @@
 bin/sancp
-@unexec if cmp -s %D/etc/sancp.conf %D/etc/sancp.conf-dist; then rm -f %D/etc/sancp.conf; fi
-etc/sancp.conf-dist
-@exec cp -n %D/%F %B/sancp.conf
+@unexec if cmp -s %D/etc/sancp.conf %D/etc/sancp.conf.dist ; then rm -f %D/etc/sancp.conf ; fi
+etc/sancp.conf.dist
+@exec if [ ! -f %D/etc/sancp.conf ] ; then cp -p %D/%F %B/sancp.conf; fi
+@dirrmtry /var/log/sancp
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2013-10-07 15:12:24 UTC
State Changed
From-To: open->closed

Committed, with some changes.  Thanks!