aboutsummaryrefslogtreecommitdiff
path: root/security/sancp
diff options
context:
space:
mode:
authorDanilo Egea Gondolfo <danilo@FreeBSD.org>2013-10-07 14:11:44 +0000
committerDanilo Egea Gondolfo <danilo@FreeBSD.org>2013-10-07 14:11:44 +0000
commit6cf7c9532feec24ebaccdc06925d31bce1a6eeeb (patch)
tree5dc5e6903c1cda9d0cf5dac9633890e967177ce6 /security/sancp
parent408e0e2ec3b6708c24b660da0bcc8b0ab8bda8f7 (diff)
downloadports-6cf7c9532feec24ebaccdc06925d31bce1a6eeeb.tar.gz
ports-6cf7c9532feec24ebaccdc06925d31bce1a6eeeb.zip
Notes
Diffstat (limited to 'security/sancp')
-rw-r--r--security/sancp/Makefile43
-rw-r--r--security/sancp/files/patch-sancp.cc15
-rw-r--r--security/sancp/files/pkg-message.in4
-rw-r--r--security/sancp/files/sancp.in35
-rw-r--r--security/sancp/pkg-plist7
5 files changed, 45 insertions, 59 deletions
diff --git a/security/sancp/Makefile b/security/sancp/Makefile
index e524939334d1..669e11a5c988 100644
--- a/security/sancp/Makefile
+++ b/security/sancp/Makefile
@@ -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>
diff --git a/security/sancp/files/patch-sancp.cc b/security/sancp/files/patch-sancp.cc
new file mode 100644
index 000000000000..66a5ae043a9b
--- /dev/null
+++ b/security/sancp/files/patch-sancp.cc
@@ -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;
diff --git a/security/sancp/files/pkg-message.in b/security/sancp/files/pkg-message.in
index d92838d7d094..82ecb5562a3e 100644
--- a/security/sancp/files/pkg-message.in
+++ b/security/sancp/files/pkg-message.in
@@ -20,9 +20,5 @@ sancp.conf has been altered (you used sancp for something else) a
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"
diff --git a/security/sancp/files/sancp.in b/security/sancp/files/sancp.in
index a5396fb77658..5a50961b1194 100644
--- a/security/sancp/files/sancp.in
+++ b/security/sancp/files/sancp.in
@@ -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
diff --git a/security/sancp/pkg-plist b/security/sancp/pkg-plist
index 7a1cb524d2f0..1302e414b234 100644
--- a/security/sancp/pkg-plist
+++ b/security/sancp/pkg-plist
@@ -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