opnsense/flowd: FreeBSD fetch is broken, prepare our own port

Removed PYTHON and PERL, because we don't need either anymore.
This commit is contained in:
Franco Fichtner 2019-09-02 20:09:18 +02:00
parent a8b252e5ba
commit 01ffd51d38
8 changed files with 156 additions and 0 deletions

43
opnsense/flowd/Makefile Normal file
View File

@ -0,0 +1,43 @@
# $FreeBSD$
PORTNAME= flowd
PORTVERSION= 0.9.1
PORTREVISION= 3
CATEGORIES= net-mgmt ipv6
MASTER_SITES= https://pkg.opnsense.org/distfiles
MAINTAINER= franco@opnsense.org
COMMENT= Small, fast, and secure NetFlow collector
LICENSE= MIT BSD2CLAUSE BSD3CLAUSE
LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= gmake shebangfix
SHEBANG_FILES= tools/*.pl
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --localstatedir=/var
USE_RC_SUBR= flowd
PORTDOCS= README INSTALL
FLOWD_USER= _flowd
USERS= ${FLOWD_USER}
GROUPS= ${FLOWD_USER}
OPTIONS_DEFINE= DOCS EXAMPLES
OPTIONS_SUB= yes
post-patch:
@${REINPLACE_CMD} -e "s;%%FLOWD_USER%%;${FLOWD_USER};g" \
${WRKSRC}/flowd.h
pre-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
pre-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
( cd ${WRKSRC}/tools && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} )
.include <bsd.port.mk>

3
opnsense/flowd/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1567447850
SHA256 (flowd-0.9.1.tar.gz) = 3ce5e0bbf93b69b5de16b9ea644b38b8591948aadabfbbd6165a7ae505ccc10c
SIZE (flowd-0.9.1.tar.gz) = 187483

View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: flowd
# REQUIRE: DAEMON
#
# Add the following lines to /etc/rc.conf to run flowd:
#
# flowd_enable (bool): Set it to "YES" to enable flowd.
# Default is "NO".
# flowd_conf (file): Local config file.
# Default is "%%PREFIX%%/etc/flowd.conf".
# flowd_flags (string): Flags to pass to flowd.
# Default is empty.
#
. /etc/rc.subr
name="flowd"
rcvar=flowd_enable
load_rc_config ${name}
: ${flowd_enable="NO"}
: ${flowd_conf="%%PREFIX%%/etc/flowd.conf"}
required_files="${flowd_conf}"
command="%%PREFIX%%/sbin/flowd"
command_args="-f ${flowd_conf}"
run_rc_command "$1"

View File

@ -0,0 +1,11 @@
--- Makefile.in.orig
+++ Makefile.in
@@ -95,7 +95,7 @@
install-conf: flowd.conf
$(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
test -f $(DESTDIR)$(sysconfdir)/flowd.conf || \
- $(INSTALL) -m 0600 flowd.conf $(DESTDIR)$(sysconfdir)
+ $(INSTALL) -m 0600 flowd.conf $(DESTDIR)$(sysconfdir)/flowd.conf.sample
install-lib: libflowd.a
$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)

View File

@ -0,0 +1,11 @@
--- flowd.h.orig
+++ flowd.h
@@ -34,7 +34,7 @@
#define DEFAULT_CONFIG SYSCONFDIR "/flowd.conf"
#define DEFAULT_PIDFILE PIDFILEDIR "/flowd.pid"
-#define PRIVSEP_USER "_flowd"
+#define PRIVSEP_USER "%%FLOWD_USER%%"
/* Initial stateholding limits */
/* XXX these are not actually tunable yet */

View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# $FreeBSD$
#
FLOWD_USER=${FLOWD_USER:=_flowd}
delete_user() {
if pw usershow ${FLOWD_USER} 2>/dev/null 1>&2; then
echo "To delete flowd privilege separation user permanently, use 'pw userdel ${FLOWD_USER}'"
fi
}
case $2 in
POST-DEINSTALL)
delete_user
;;
esac

12
opnsense/flowd/pkg-descr Normal file
View File

@ -0,0 +1,12 @@
flowd is a small, fast and secure NetFlow collector. It offers the following
features:
* Understands NetFlow protocol v.1, v.5, v.7 and v.9 (including IPv6 flows)
* Supports both IPv4 and IPv6 transport of flows
* Secure: flowd is privilege separated to limit the impact of any compromise
* Supports filtering and tagging of flows, using a packet filter-like syntax
* Stores recorded flow data in a compact binary format which supports
run-time choice over which flow fields are stored
* Is licensed under a liberal BSD-like license
WWW: http://www.mindrot.org/projects/flowd/

25
opnsense/flowd/pkg-plist Normal file
View File

@ -0,0 +1,25 @@
bin/flowd-reader
etc/flowd.conf.sample
include/flowd/addr.h
include/flowd/crc32.h
include/flowd/flowd-common.h
include/flowd/flowd-config.h
include/flowd/flowd-pytypes.h
include/flowd/store-v2.h
include/flowd/store.h
lib/libflowd.a
man/man5/flowd.conf.5.gz
man/man8/flowd-reader.8.gz
man/man8/flowd.8.gz
sbin/flowd
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README.tools
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowinsert.pl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/bytes.html
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/flow_rrd.py
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/flows.html
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/packets.html
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/plot.sh
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flows.sql
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sockclient.py
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/stats.py
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/wormsuspects.pl