summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 89f8d85ea121177fbecf6d05610304fcb612db1b (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
# Maintainer: Piotr Serafin <piotr.serafin.71@gmail.com>
# Contributor: Mihai Bi┼čog <mihai.bisog@gmail.com>

pkgname=tsduck
_pkgver=3.21-1819
pkgver=${_pkgver/-/_}
pkgrel=2
pkgdesc="An extensible toolkit for MPEG/DVB transport streams"
arch=('x86_64')
url="https://tsduck.io/"
license=('BSD')
depends=(pcsclite curl srt jq) 
source=("$pkgname-${_pkgver}.tar.gz::https://github.com/tsduck/tsduck/archive/v${_pkgver}.tar.gz")
md5sums=('887e678fd86b8916335e8a48ac037560')
install=$pkgname.install

build() {
    cd "$pkgname-${_pkgver}"
    make NOTEST=true
}

package() {
    cd "$pkgname-${_pkgver}"

    make SYSROOT="$pkgdir" install
    install -D -m644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    mkdir -p "$pkgdir/usr/lib"
    find "$pkgdir/usr/bin" -type f -name 'tsduck.so' -exec mv -t "$pkgdir/usr/lib" {} +

    # If pacman sees a /lib directory in a package, it will detect a conflict 
    # with the symlink on the filesystem. This uses /usr/lib directly.
    mkdir -p "$pkgdir/usr/lib/udev/rules.d"
    cp "$pkgdir/lib/udev/rules.d/80-tsduck.rules" "$pkgdir/usr/lib/udev/rules.d"
    rm -rf "$pkgdir/lib"

    mkdir -p "$pkgdir/usr/lib/$pkgname"
    find "$pkgdir/usr/bin" -type f -name 'tsplugin_*.so' -exec mv -t "$pkgdir/usr/lib/$pkgname" {} +
    find "$pkgdir/usr/bin" -type f -name 'tsduck.*.xml' -exec mv -t "$pkgdir/usr/lib/$pkgname" {} +
    find "$pkgdir/usr/bin" -type f -name 'tsduck.names' -exec mv -t "$pkgdir/usr/lib/$pkgname" {} +
    find "$pkgdir/usr/bin" -type f -name 'tsduck.oui.names' -exec mv -t "$pkgdir/usr/lib/$pkgname" {} +

    # When 3.22 will be released all above static resources will be installed in /usr/share/tsduck
    # mkdir -p "$pkgdir/usr/share/$pkgname"
    # find "$pkgdir/usr/bin" -type f -name 'tsduck.*.xml' -exec mv -t "$pkgdir/usr/share/$pkgname" {} +
    # find "$pkgdir/usr/bin" -type f -name 'tsduck.names' -exec mv -t "$pkgdir/usr/share/$pkgname" {} +
    # find "$pkgdir/usr/bin" -type f -name 'tsduck.oui.names' -exec mv -t "$pkgdir/usr/share/$pkgname" {} +

    mkdir -p "$pkgdir/etc/profile.d/"
    echo "export TSPLUGINS_PATH=/usr/lib/tsduck" > "$pkgdir/etc/profile.d/tsduck.sh"
}