summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 309d2477158e926a4341ec615c3002c267af1e3a (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Maintainer: Dan Ziemba <zman0900@gmail.com>
# Contributor: Benjamin Hedrich <kiwisauce (a) pagenotfound (dot) de>

pkgname=tvheadend-git
_gitname='tvheadend-git'
pkgver=4.3.r1878.ge59b92e9f
pkgrel=1
pkgdesc="TV streaming server for Linux"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://tvheadend.org/"
license=('GPL3')
depends=(
    'avahi'
    'ffmpeg'
    'libdvbcsa'
    'libfdk-aac'
    'libhdhomerun'
    'openssl'
    'pcre2'
    'uriparser'
)
makedepends=(
    'git'
    'python'
)
optdepends=(
    'xmltv: For an alternative source of programme listings'
)
provides=('tvheadend')
conflicts=('tvheadend' 'hts-tvheadend' 'hts-tvheadend-svn' 'tvheadend-git')
install=tvheadend.install
backup=('etc/conf.d/tvheadend')

source=(
    "${_gitname}::git+https://github.com/tvheadend/tvheadend.git#branch=master"
    'dvb-scan-tables::git+https://github.com/tvheadend/dtv-scan-tables.git#branch=tvheadend'
    'ignore-missing-libavresample.patch'
)
md5sums=(
    'SKIP'
    'SKIP'
    'ab3e00343f57b70b5e02a981e0a16055'
)

pkgver() {
    cd "${srcdir}/${_gitname}"
    git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "${srcdir}"
    _dvbscan="${_gitname}/data/dvb-scan"
    rm -rf "${_dvbscan}"
    cp -a "dvb-scan-tables" "${_dvbscan}"
    rm -rf "${_dvbscan}/.git"
    touch "${_dvbscan}/.stamp"

    cd "${_gitname}"
    patch -p1 -i ../ignore-missing-libavresample.patch
}

build() {
    cd "${srcdir}/${_gitname}"

    # Work-around for GCC 10
    export CFLAGS="${CFLAGS} -fcommon"

    ./configure \
        --prefix=/usr \
        --mandir=/usr/share/man/man1 \
        --release \
        --python=python3 \
        --enable-avahi \
        --enable-zlib \
        --disable-ffmpeg_static --enable-libav \
        --disable-libx264_static --enable-libx264 \
        --disable-libx265_static --enable-libx265 \
        --disable-libvpx_static --enable-libvpx \
        --disable-libtheora_static --enable-libtheora \
        --disable-libvorbis_static --enable-libvorbis \
        --disable-libfdkaac_static --enable-libfdkaac \
        --disable-libopus_static --enable-libopus \
        --disable-nvenc \
        --enable-vaapi \
        --enable-inotify \
        --enable-epoll \
        --disable-pcre --enable-pcre2 \
        --enable-uriparser \
        --enable-dvben50221 \
        --enable-dbus_1 \
        --disable-hdhomerun_static --enable-hdhomerun_client \
        --enable-tvhcsa
    make
}

package() {
    cd "${srcdir}/${_gitname}"
    make DESTDIR="$pkgdir/" install

    install -D -m 644 "${srcdir}/${_gitname}/rpm/tvheadend.service" \
        "$pkgdir/usr/lib/systemd/system/tvheadend.service"
    sed -i 's|/etc/sysconfig|/etc/conf.d|g' \
        "$pkgdir/usr/lib/systemd/system/tvheadend.service"

    install -d "$pkgdir/etc/conf.d"
    cat << EOF > "$pkgdir/etc/conf.d/tvheadend"
# Configuration file for the tvheadend service.

MALLOC_ARENA_MAX=4
OPTIONS="-u hts -g video -6 --http_port 9981 --htsp_port 9982"
EOF
}