### this file is sourced not run
PKGVER=2018.05
PKGBUILD=1
PKGARCH=i686

# source: james
TARBALL=rtmpdump-$PKGVER.tar.bz2
MD5SUM=0c70f1ade05eed2e8806addfbd825ae5
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$TARBALL
BUNDLE=

SLACKREQ=libgnutls32
SLACKDESC="librtmp32: librtmp32 $PKGVER (RTMP access library)  
librtmp32:  
librtmp32: This is a library to access RTMP streams. It also comes with tools to 
librtmp32: dump these streams to disk (rtmp-dump).  
librtmp32: 
librtmp32: This is 32-bit version of the library.
librtmp32: 
librtmp32: http://rtmpdump.mplayerhq.hu/
librtmp32: 
librtmp32: 
librtmp32: 
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share etc
}

### build
pkg_build() {
	LIBDIR=lib
	cd /tmp/rtmpdump* &&
	
	# openssl changes API, so use gnutls instead
	sed -i -e 's/^CRYPTO=OPENSSL.*/#&/; s/#CRYPTO=GNUTLS.*/CRYPTO=GNUTLS/' \
		Makefile librtmp/Makefile &&
		
	make prefix=/usr libdir=/usr/$LIBDIR CC="gcc ${BUILD32}" &&
	make prefix=/usr libdir=/usr/$LIBDIR install CC="gcc ${BUILD32}" &&
	rm -f /usr/lib/librtmp.a && # don't want the static lib
	pkg_build_slackdesc
}
