### this file is sourced not run
PKGVER=1.1.4
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=iptraf-ng-$PKGVER.tar.gz
MD5SUM=e0f8df3b7baf2b5106709abc4f8c029a
SRC_URL=http://pkgs.fedoraproject.org/repo/pkgs/iptraf-ng/iptraf-ng-1.1.4.tar.gz/$MD5SUM/$TARBALL
BUNDLE=

SLACKREQ=libncurses
SLACKDESC="iptraf: iptraf $PKGVER (Network traffic monitor)  
iptraf:  
iptraf: IPTraf is a console-based network statistics utility for Linux. It 
iptraf: gathers a variety of figures such as TCP connection packet and byte 
iptraf: counts, interface statistics and activity indicators, TCP/UDP traffic 
iptraf: breakdowns, and LAN station packet and byte counts.  
iptraf: 
iptraf: http://www.penguin.cz/~fojtik/iptraf/
iptraf: http://iptraf.seul.org/
iptraf: 
iptraf:
"

# default pkg_download
# prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/iptraf* &&
	
	# fedora patch
	patch -Np1 -i ../pkg/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch &&
	patch -Np1 -i ../pkg/0002-Makefile-add-Werror-format-security.patch &&
	patch -Np1 -i ../pkg/0003-bugfix-positionptr-properly-allocate-newly-created-i.patch &&
	
	# debian patch
	patch -Np1 -i ../pkg/build-use-wide-version-of-lpanel-when-needed.patch
}

# default pkg_package
# default pkg_build 
pkg_build() {
	cd /tmp/iptraf*
	autoreconf -fi &&
	pkg_build_autoconf &&
	
	# extra doc from original iptraf
	# other docs
	find Documentation -type f | grep -v '\.html$\|\.png$\|/stylesheet' | \
		xargs rm -f &&
	rm -rf Documentation/.xvpics &&
	rm -f Documentation/stylesheet-images/.eps &&
	mkdir -p /usr/share/doc/iptraf-ng &&
	cp -a Documentation /usr/share/doc/iptraf-ng &&
	
	pkg_build_slackdesc
}
