# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: xduugu
# Contributor: Elis Hughes <elishughes@googlemail.com>

pkgname=rtmpdump
pkgver=2.6
pkgrel=1
epoch=1
pkgdesc='A toolkit for RTMP streams'
arch=(x86_64 aarch64)
url=https://rtmpdump.mplayerhq.hu/
license=(
  GPL-2.0-only
  LGPL-2.1-only
)
depends=(
  glibc
  gnutls
  zlib
)
makedepends=(git)
provides=(librtmp.so)
_tag=138fdb258d9fc26f1843fd1b891180416c9dc575
source=(git+https://git.ffmpeg.org/rtmpdump#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd rtmpdump
  git describe --tags | sed 's/^v//'
}

build() {
  cd rtmpdump
  sed -e 's/^CRYPTO=OPENSSL/#CRYPTO=OPENSSL/' -e 's/#CRYPTO=GNUTLS/CRYPTO=GNUTLS/' -i Makefile -i librtmp/Makefile
  make \
    OPT="$CFLAGS" \
    XLDFLAGS="$LDFLAGS"
}

package() {
  cd rtmpdump
  make \
    prefix=/usr \
    sbindir=/usr/bin \
    mandir=/usr/share/man \
    DESTDIR="${pkgdir}" \
    install
}

# vim: ts=2 sw=2 et:
