~alpine/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[alpine-devel] [PATCH] testing/nfdump: netflow tools Added init.d/nfcapd conf.d/nfcapd

Nathan Angelacos <nangel@alpinelinux.org>
Details
Message ID
<1328098897-24066-1-git-send-email-nangel@alpinelinux.org>
Sender timestamp
1328098897
DKIM signature
missing
Download raw message
Patch: +139 -3
Used fprobe as a model for the nfcapd (netflow collector) init script
Pulls all command line options from the conf.d/nfcapd file
---
 testing/nfdump/APKBUILD     |   17 +++++++++--
 testing/nfdump/nfcapd.confd |   62 ++++++++++++++++++++++++++++++++++++++++++
 testing/nfdump/nfcapd.initd |   63 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 139 insertions(+), 3 deletions(-)
 create mode 100644 testing/nfdump/nfcapd.confd
 create mode 100644 testing/nfdump/nfcapd.initd

diff --git a/testing/nfdump/APKBUILD b/testing/nfdump/APKBUILD
index 9299be6..2f031d7 100644
--- a/testing/nfdump/APKBUILD
+++ b/testing/nfdump/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nfdump
pkgver=1.6.4
pkgrel=0
pkgrel=1
pkgdesc="The nfdump tools collect and process netflow data on the command line."
url="http://nfdump.sourceforge.net/"
arch="all"
@@ -12,7 +12,9 @@ depends_dev=""
makedepends="bison flex $depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz\
	nfcapd.confd\
	nfcapd.initd"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
@@ -33,8 +35,17 @@ build() {
}

package() {
	depends=fts

	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -D -m755 "$srcdir"/nfcapd.initd \
		"$pkgdir"/etc/init.d/nfcapd

	install -D -m644 "$srcdir"/nfcapd.confd \
		"$pkgdir"/etc/conf.d/nfcapd
}

md5sums="a5ab5657da78f0f57ac7d29f31883949  nfdump-1.6.4.tar.gz"
md5sums="a5ab5657da78f0f57ac7d29f31883949  nfdump-1.6.4.tar.gz
d525c691a62a5746c581f5e9776ed866  nfcapd.confd
d2b60619e18120af68771f3b866177e8  nfcapd.initd"
diff --git a/testing/nfdump/nfcapd.confd b/testing/nfdump/nfcapd.confd
new file mode 100644
index 0000000..fb9afb6
--- /dev/null
+++ b/testing/nfdump/nfcapd.confd
@@ -0,0 +1,62 @@
# Config file for /etc/init.d/nfcapd

# Port we listen on
PORT=2205

# Hostname/address we bind on - default is any available
BINDHOST=127.0.0.1

# IPv4 only 
#IPV4=no

# IPv6 only
#IPV6=no

# Join a specific Multicast group
#MULTICASTGROUP=

# Become a packet repeater
#REPEAT=desthost/port


# Ident string, specify the name of the router
#IDENT=

# Base Directory for output files
BASEDIR="/var/log/nfcapd"

# Source is one or more sources: Ident,IP,base_directory 
# If you specificy SOURCE, do not specifiy IDENT or BASEDIR
#SOURCE="Foo,192.168.1.1,/var/log/nfcapd/foo Bar,192.168.1.2,/var/log/nfcapd/bar"

# Sample Rate - defaults to source
#SAMPLERATE=

# additional directory sub hierarchy (default none)
#SUBDIR="%Y/%m/%d"


# Extensions to be stored in the netflow data
#EXTENSIONS="all"

# How often to rotate the files (in seconds)
#INTERVAL=300

# Do we align rotation with next even interval
#ALIGN=no

# Run a command at the end of every interval
#ROTATECMD=""

# Auto expire old files (yes/no)
#AUTOEXPIRE=no

# User / Group
UID=nobody
GID=nobody

# Buffer length in bytes (to reduce lost packets)
BUFFLEN=1024000

# Compress the flows with LZO (yes/no)
COMPRESS=yes
diff --git a/testing/nfdump/nfcapd.initd b/testing/nfdump/nfcapd.initd
new file mode 100644
index 0000000..5f85068
--- /dev/null
+++ b/testing/nfdump/nfcapd.initd
@@ -0,0 +1,63 @@
#!/sbin/runscript
# Copyright 2012 N Angelacos - Based on Gentoo Foundation fprobe script
# Distributed under the terms of the GNU General Public License v2

depend() {
	need net
	after firewall
}


BIN=/usr/bin/nfcapd
PIDFILE_EXTRA=${SVCNAME#*.}
if [ -n "${PIDFILE_EXTRA}" ] && [ ${SVCNAME} != "nfcapd" ]; then
	PIDFILE="/var/run/nfcapd.${PIDFILE_EXTRA}.pid"
else
	PIDFILE="/var/run/nfcapd.pid"
fi

start() {
	ebegin "Starting nfcapd"
	local OPTS=""
	
	[ -n "${SOURCE}" ] && SOURCE=`echo -n "${SOURCE}" | sed 's/ / -n /g'`
	[ "${IPV4}"       == "yes" ] && OPTS="${OPTS} -4"
	[ "${IPV6}"       == "yes" ] && OPTS="${OPTS} -6"
	[ "${ALIGN}"      == "yes" ] && OPTS="${OPTS} -w"
	[ "${AUTOEXPIRE}" == "yes" ] && OPTS="${OPTS} -e"
	[ "${COMPRESS}"   == "yes" ] && OPTS="${OPTS} -z"
	for optname in p:PORT b:BINDHOST j:MULTICASTGROUP i:IFACE R:REPEAT \
		I:IDENT l:BASEDIR n:SOURCE s:SAMPLERATE S:SUBDIR \
		T:EXTENSIONS t:INTERVAL x:ROTATECMD u:UID g:GID \
		B:BUFFLEN ; do
	    opt="${optname/:*}"	optvar="${optname/*:}"
	    eval optvalue="\$$optvar"
	    [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}"
	done
	OPTS="${OPTS}"

	# Attempt to make the basedir if specified
	if [ -n "${BASEDIR}" ]; then
		mkdir -p "${BASEDIR}"
		chown "${UID}":"${GID}" "${BASEDIR}"
	fi


	start-stop-daemon --start -b --exec $BIN \
		--pidfile ${PIDFILE} --make-pidfile \
		-- ${OPTS}
	eend $?
}

stop() {
	ebegin "Stopping nfcapd"
	start-stop-daemon --stop --quiet --exec $BIN \
		--pidfile ${PIDFILE}
	eend $?
}






-- 
1.7.7.1



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Nathan Angelacos <nangel@nothome.org>
Details
Message ID
<4F298D51.8060106@nothome.org>
In-Reply-To
<20120201195740.6b6bf55f@ytre.org> (view parent)
Sender timestamp
1328123217
DKIM signature
missing
Download raw message
On 02/01/2012 10:57 AM, Natanael Copa wrote:
> On Wed,  1 Feb 2012 12:21:37 +0000

>>   package() {
>> +	depends=fts
>> +
>
> Why is this needed?
>

Starting ncfcapd with 2.3 libraries results in:

  #nfcapd
  /usr/bin/nfcapd: symbol 'fts_set': can't resolve symbol in lib 
'/usr/bin/nfcapd'



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@ytre.org>
Details
Message ID
<20120201195740.6b6bf55f@ytre.org>
In-Reply-To
<1328098897-24066-1-git-send-email-nangel@alpinelinux.org> (view parent)
Sender timestamp
1328122660
DKIM signature
missing
Download raw message
On Wed,  1 Feb 2012 12:21:37 +0000
Nathan Angelacos <nangel@alpinelinux.org> wrote:

> Used fprobe as a model for the nfcapd (netflow collector) init script
> Pulls all command line options from the conf.d/nfcapd file
> ---
>  testing/nfdump/APKBUILD     |   17 +++++++++--
>  testing/nfdump/nfcapd.confd |   62
> ++++++++++++++++++++++++++++++++++++++++++
> testing/nfdump/nfcapd.initd |   63
> +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 139
> insertions(+), 3 deletions(-) create mode 100644
> testing/nfdump/nfcapd.confd create mode 100644
> testing/nfdump/nfcapd.initd

Applied. Thanks!

> diff --git a/testing/nfdump/APKBUILD b/testing/nfdump/APKBUILD
> index 9299be6..2f031d7 100644
> --- a/testing/nfdump/APKBUILD
> +++ b/testing/nfdump/APKBUILD
...
> @@ -33,8 +35,17 @@ build() {
>  }
>  
>  package() {
> +	depends=fts
> +

Why is this needed?

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120201214656.10bed09e@alpinelinux.org>
In-Reply-To
<4F298D51.8060106@nothome.org> (view parent)
Sender timestamp
1328129216
DKIM signature
missing
Download raw message
On Wed, 01 Feb 2012 11:06:57 -0800
Nathan Angelacos <nangel@nothome.org> wrote:

> On 02/01/2012 10:57 AM, Natanael Copa wrote:
> > On Wed,  1 Feb 2012 12:21:37 +0000
> 
> >>   package() {
> >> +	depends=fts
> >> +
> >
> > Why is this needed?
> >
> 
> Starting ncfcapd with 2.3 libraries results in:
> 
>   #nfcapd
>   /usr/bin/nfcapd: symbol 'fts_set': can't resolve symbol in lib 
> '/usr/bin/nfcapd'

I think fts got enabled in uclibc and the fts package removed.

Yup... I now get:

ERROR: 1 unsatisfiable dependencies:
  nfdump-1.6.4-r1: fts

This should have created a build error, but that did not happen due to
the non-existsing dependency was added in package() instead of global
scope.

Normally you should only depend on the -dev package (fts-dev) and
abuild will autodetect the shared object depends. (.so files)

I doubt it will run (unless it does dlopen).


The proper way to handle this is to remove fts dependency from edge.
(I'll do this)

In case you need it backported to v2.3 you'll need to build it on a
v2.3 build box where you add fts-dev to makedepends.


-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)