summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Martin2015-06-08 10:58:51 -0500
committerStephen Martin2015-06-08 10:58:51 -0500
commite931aa5334f0c5ae444af76aa9eebbc452038c18 (patch)
tree446eee5f31d0190bee3a04b7c1c6e1bd8914d784
downloadaur-e931aa5334f0c5ae444af76aa9eebbc452038c18.tar.gz
Updated to aur4
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD60
-rw-r--r--accounts.install48
-rw-r--r--shiny-server.service10
4 files changed, 140 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..bf4de863342
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = shiny-server-git
+ pkgdesc = Open-source version of the shiny web development framework server
+ pkgver = 20150608
+ pkgrel = 1
+ url = http://www.rstudio.com/shiny/server/install-opensource
+ install = accounts.install
+ arch = i686
+ arch = x86_64
+ license = AGPL
+ makedepends = git
+ makedepends = python2
+ makedepends = cmake
+ makedepends = r
+ depends = r
+ backup = shiny-server.conf
+ source = shiny-server::git+https://github.com/rstudio/shiny-server.git
+ source = shiny-server.service
+ md5sums = SKIP
+ md5sums = 78811ea3ebc75bf875e13e202e4587ae
+
+pkgname = shiny-server-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..882a521f4e8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: Stephen Martin <stephensrmmartin at gmail dot com>
+pkgname=shiny-server-git
+pkgver=20150608
+pkgrel=1
+pkgdesc="Open-source version of the shiny web development framework server"
+arch=('i686' 'x86_64')
+url="http://www.rstudio.com/shiny/server/install-opensource"
+license=('AGPL')
+depends=('r')
+makedepends=('git' 'python2' 'cmake' 'r')
+install='accounts.install'
+backup='shiny-server.conf'
+source=('shiny-server::git+https://github.com/rstudio/shiny-server.git'
+ 'shiny-server.service')
+pkver(){
+ cd "$srcdir/$pkgname"
+ git describe --long|sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+}
+
+_gitroot=https://github.com/rstudio/shiny-server.git
+_gitname=shiny-server
+prepare(){
+ cd $srcdir
+ find -type f -exec sed \
+ -e 's_^#!/usr/bin/env python$_&2_' \
+ -e 's_^\(#!/usr/bin/python2\).[45]$_\1_' \
+ -e 's_^#!/usr/bin/python$_&2_' \
+ -e "s_'python'_'python2'_" -i {} \;
+ }
+
+build() {
+ cd "$srcdir/$_gitname"
+ mkdir tmp
+ cd tmp
+ DIR=`pwd`
+ PATH=$DIR/../bin/:$PATH
+ ln -s `which python2` ../bin/python
+ export _PYTHON=`which python2`
+
+ export PYTHON=`which python2`
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON="$_PYTHON" ../
+ make
+
+ mkdir ../build
+ (cd .. && bin/npm --python="$PYTHON" rebuild)
+ (cd .. && ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --python="$PYTHON" rebuild)
+}
+
+package() {
+ cd "$srcdir/$_gitname/tmp"
+ make DESTDIR="$pkgdir/" install
+ mkdir -p $pkgdir/usr/bin/
+ ln -s /usr/shiny-server/bin/shiny-server $pkgdir/usr/bin/shiny-server
+ install -m 644 -D $srcdir/shiny-server.service $pkgdir/usr/lib/systemd/system/shiny-server.service
+ install -m 644 -D $srcdir/$_gitname/config/default.config $pkgdir/etc/shiny-server/shiny-server.conf
+}
+
+# vim:set ts=2 sw=2 et:
+md5sums=('SKIP'
+ '78811ea3ebc75bf875e13e202e4587ae')
diff --git a/accounts.install b/accounts.install
new file mode 100644
index 00000000000..6ce2a5b9267
--- /dev/null
+++ b/accounts.install
@@ -0,0 +1,48 @@
+# This is a default template for a post-install scriptlet.
+# Uncomment only required functions and remove any functions
+# you don't need (and this header).
+
+## arg 1: the new package version
+#pre_install() {
+ # do something here
+#}
+
+## arg 1: the new package version
+post_install() {
+ # do something here
+ getent group "shiny" &>/dev/null || groupadd -r shiny 1>/dev/null
+ getent passwd "shiny" &>/dev/null || useradd -r -g shiny -m -d "/srv/shiny-server" -s "/bin/sh" shiny 1>/dev/null
+ mkdir -p /var/log/shiny-server
+ mkdir -p /var/lib/shiny-server
+ chown shiny:shiny /srv/shiny-server
+ chown shiny:shiny /var/log/shiny-server
+ chown shiny:shiny /var/lib/shiny-server
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+#pre_upgrade() {
+ # do something here
+#}
+
+## arg 1: the new package version
+## arg 2: the old package version
+#post_upgrade() {
+ # do something here
+#}
+
+## arg 1: the old package version
+#pre_remove() {
+ # do something here
+#}
+
+## arg 1: the old package version
+post_remove() {
+ # do something here
+ if getent passwd "shiny" >/dev/null; then
+ userdel shiny >/dev/null
+ fi
+ if getent group "shiny" >/dev/null; then
+ groupdel shiny >/dev/null
+ fi
+}
diff --git a/shiny-server.service b/shiny-server.service
new file mode 100644
index 00000000000..615173e57de
--- /dev/null
+++ b/shiny-server.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Shiny Server
+After=syslog.target network.target
+
+[Service]
+User=shiny
+ExecStart=/usr/bin/shiny-server
+
+[Install]
+WantedBy=multi-user.target