summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f5e5d06d3576d1c40514f55d0d7b5fb0fcdaf47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Maintainer: Voxan <voxan@hessfr.fr>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: xduugu <xduugu@gmx.com>
# Contributor: Elis Hughes <elishughes@googlemail.com>
# Contributor: Dan Ziemba <zman0900@gmail.com>

pkgname=lib32-librtmp0
pkgver=2.6
pkgrel=2
pkgdesc='Toolkit for RTMP streams'
arch=(x86_64)
url=https://rtmpdump.mplayerhq.hu/
license=(
  GPL2
  LGPL2.1
)
depends=(
  lib32-glibc
  lib32-gnutls
  lib32-zlib
)
makedepends=(git)
provides=(librtmp.so)
options=(!makeflags)
_commit=6f6bb1353fc84f4cc37138baa99f586750028a01
source=(git+https://git.ffmpeg.org/rtmpdump#commit=${_commit})
b2sums=(SKIP)

prepare() {
  cd rtmpdump

  # Switch to GnuTLS
  sed -e 's/^CRYPTO=OPENSSL/#CRYPTO=OPENSSL/' -e 's/#CRYPTO=GNUTLS/CRYPTO=GNUTLS/' -i Makefile -i librtmp/Makefile

  # Fix Nettle 3.x API mismatch (removes the extra length argument in hmac_sha256_digest)
  sed -i 's/hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)/hmac_sha256_digest(\&ctx, dig)/' librtmp/handshake.h
  sed -i 's/hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)/hmac_sha256_digest(\&ctx, dig)/' librtmp/handshake.h
  sed -i 's/hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)/hmac_sha256_digest(\&ctx, dig)/' librtmp/hashswf.c
  sed -i 's/md5_digest(ctx,MD5_DIGEST_LENGTH,dig)/md5_digest(ctx,dig)/' librtmp/rtmp.c
}

build() {
  cd rtmpdump
  make \
    OPT="$CFLAGS -m32" \
    XLDFLAGS="$LDFLAGS -m32"
}

package() {
  cd rtmpdump
  make \
    prefix=/usr \
    sbindir=/usr/bin \
    libdir=/usr/lib32 \
    mandir=/usr/share/man \
    DESTDIR="${pkgdir}" \
    install
  rm -rf "${pkgdir}"/usr/{bin,include,lib32/{librtmp.{a,so},pkgconfig},share}
}

# vim: ts=2 sw=2 et: