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

# source: james + debian patches
TARBALL=redir-2.2.1.tar.gz
MD5SUM=4342fadac30504c86c8db7beefe01995
SRC_URL=http://sammy.net/~sammy/hacks/$TARBALL
BUNDLE=

SLACKREQ='' # 
SLACKDESC="redir: redir 2.2.1 (Userspace port forwarder/redirector)
redir: 
redir: Redir is a port redirector. It's functionally basically consists of 
redir: the ability to listen for TCP connections on a given port, and, when 
redir: it recieves a connection, to then connect to a given destination 
redir: address/port, and pass data between them.
redir: 
redir: http://sammy.net/~sammy/hacks/
redir: 
redir: 
redir: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/redir* &&
	tar -xf $CHROOT_DIR/tmp/pkg/redir_2.2.1-13.debian.tar.xz &&
	for p in $(cat debian/patches/series); do
		[ "$p" = 08_add_wrappers.dpatch ] && continue # we don't have libwrap
		patch -Np1 -i debian/patches/$p || return 1
	done
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/redir*
	make &&
	install -m755 redir /usr/bin &&
	install -m644 redir.man /usr/share/man/man1/redir.1 &&
	pkg_build_slackdesc
}
