summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 53f8aac2be62498d924440a12300f4821d3137f8 (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
# Maintainer: Celogeek <arch-aur-f5d67e@celogeek.com>

_basename=jitsi
_pkgname=meet
_tag=4917
_version=1.0.4917

pkgname=${_basename}-${_pkgname}-nightly
pkgver=${_version}
pkgrel=1
pkgdesc="Jitsi Meet Web nightly build"
arch=('any')
url="https://jitsi.org/jitsi-meet/"
license=('Apache')
depends=()
optdepends=("nginx")
makedepends=(
        "python" "python2"
        "nodejs" "npm"
)
options=('!strip')
backup=(
  "etc/webapps/${pkgname}/logging_config.js"
  "etc/webapps/${pkgname}/config.js"
  "etc/webapps/${pkgname}/interface_config.js"
)
source=(
        "$pkgname::git+https://github.com/jitsi/jitsi-meet#tag=${_tag}"
)

build() {
        cd "$pkgname"
        npm install
        make
        make source-package
}

package() {
        cd "$srcdir/$pkgname"

        DESTDIR="${pkgdir}/usr/share/webapps/${pkgname}"
        CONFDIR="${pkgdir}/etc/webapps/${pkgname}"

        install -d "$DESTDIR"
        install -d "$CONFDIR"

        tar xjvf "jitsi-meet.tar.bz2" -C "$DESTDIR" --strip 1
	install -Dm644 -t "$DESTDIR" manifest.json

        install -d "$DESTDIR/load-test"
        cp -r resources/load-test/{index.html,libs} "$DESTDIR/load-test"

        for l in $(node -p "Object.keys(require('./lang/languages.json')).join(' ')")
        do
            c=${l:0:2}
            if [ -f "node_modules/i18n-iso-countries/langs/${c}.json" ]
            then
                    install -m644 "node_modules/i18n-iso-countries/langs/${c}.json" "${DESTDIR}/lang/countries-${l}.json"
            fi
        done

        find "$DESTDIR" -type f -execdir sed -i "s#${srcdir}##g" "{}" \;
        find "$DESTDIR" -type d -exec chmod 755 {} \;

        for i in interface_config.js logging_config.js config.js
        do
                install -Dm644 "$DESTDIR/${i}" "$CONFDIR/${i}"
                ln -sf "/etc/webapps/${pkgname}/${i}" "$DESTDIR/${i}"
        done

        install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" doc/debian/jitsi-meet/jitsi-meet.example doc/debian/jitsi-meet/jitsi-meet.example-apache config.js
        sed -i 's@/usr/share/jitsi-meet@/usr/share/webapps/'$pkgname'@' "${pkgdir}/usr/share/doc/${pkgname}/"*
        sed -i 's@/etc/jitsi/meet@/etc/webapps/'$pkgname'@' "${pkgdir}/usr/share/doc/${pkgname}/"*
        
        chown -R root:root "${pkgdir}"
}
sha256sums=('SKIP')