# Description: A tool to download rtmp streams.
# URL: http://rtmpdump.mplayerhq.hu/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: zlib gnutls

name=rtmpdump
version=2.4
_commit=f1b83c10d8beb43fcc70a6e88cf4325499f25857
release=4
source=(http://git.ffmpeg.org/gitweb/$name.git/snapshot/$_commit.tar.gz)
renames=($name-$version-${_commit:0:8}-$release.tar.gz)

build() {
	cd $name-*

	sed \
		-e '/^CRYPTO=/s/OPENSSL/GNUTLS/' \
		-i Makefile -i librtmp/Makefile

	sed \
		-e 's|OPT=|&-fPIC |' \
		-e 's|OPT|OPTS|' \
		-e 's|CFLAGS=.*|& $(OPT)|' \
		-i librtmp/Makefile


	install -d $PKG/usr/lib

	[ "$CC" ] || CC=gcc

	make \
		CC="$CC" \
		$MAKEFLAGS \
		OPT="$CFLAGS" \
		XLDFLAGS="$LDFLAGS" \
		SYS=posix

	make \
		prefix=/usr \
		sbindir=/usr/bin \
		mandir=/usr/share/man \
		DESTDIR=$PKG \
		install
}
