summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45c9d97439e2ed70c644a71920c333b2c0336a10 (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
# Maintainer: a821

pkgname=shiny-server
pkgver=1.5.23.1030
pkgrel=1
pkgdesc="Host Shiny applications over the web"
arch=('x86_64')
url="https://rstudio.com/shiny/server"
license=('AGPL-3.0-only')
depends=('r' 'python')
makedepends=('git' 'cmake' 'wget' 'python-setuptools')
optdepends=(
    'r-shiny: build interactive web apps with R' # AUR
    'r-rmarkdown: convert R markdown docs to various formats' # AUR
)
source=("git+https://github.com/rstudio/shiny-server#commit=v$pkgver"
        "${pkgname}.service"
        "${pkgname}.sysusers"
        "${pkgname}.tmpfiles")
sha256sums=('8965a06f843bedb3585ed7debf9c43d15553a8cc4f6d14429307ede37d72ee64'
            '1dc3401a3d87ef27ae026dc45bc374c2763b2819384ef8f326b4b7a12201ef42'
            'e56bfe2b7bf85fdc72d1080ab2d08a54c52928a0dc25cdbeff1302981aa18e30'
            '27538c6961fdb70f168be6d7c5754c474dd221dff0dcf639181d5803d6646a54')
backup=("etc/shiny-server/shiny-server.conf")

prepare() {
    cd "${pkgname}"
    mkdir -p build tmp
}

build() {
    cd "${pkgname}"/tmp

    # install and download bundled Node.js
    ../external/node/install-node.sh

    # add bin PATH to reference node
    PATH="${srcdir}/${pkgname}/bin":$PATH

    cmake -DCMAKE_INSTALL_PREFIX=/usr/share ..
    make
    cd ..
    ./bin/npm install
}

package() {
    cd "${pkgname}"/tmp
    make DESTDIR="${pkgdir}" install
    install -Dm644 ../config/default.config "${pkgdir}/etc/shiny-server/shiny-server.conf"

    cd ../..
    install -Dm644 ${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system"
    install -Dm644 ${pkgname}.sysusers "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
    install -Dm644 ${pkgname}.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"

    install -dm755 "${pkgdir}/usr/bin"
    ln -s /usr/share/shiny-server/bin/shiny-server "${pkgdir}/usr/bin/shiny-server"
}

# vim: set ts=4 sw=4 et: