Guest User

PKGBUILD shiny-server-git 1.5.6.875.r37.g66e45ab-1

a guest
Apr 4th, 2018
334
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Stephen Martin <stephensrmmartin at gmail dot com>
  2. pkgname=shiny-server-git
  3. pkgver=1.5.6.875.r37.g66e45ab
  4. pkgrel=1
  5. epoch=1
  6. pkgdesc="Open-source version of the shiny web development framework server"
  7. arch=('i686' 'x86_64')
  8. url="http://www.rstudio.com/shiny/server/install-opensource"
  9. license=('AGPL')
  10. depends=('r')
  11. makedepends=('git' 'python2' 'cmake' 'r' 'gcc6')
  12. backup=('etc/shiny-server/shiny-server.conf')
  13. install='accounts.install'
  14. source=('shiny-server::git+https://github.com/rstudio/shiny-server.git'
  15. 'shiny-server.service')
  16. sha256sums=('SKIP'
  17. '8486c5e5d2c8362daf2c6826ea702e3f49dd6ee64c30ca79bdf2f4edbe0d2744')
  18. _gitroot=https://github.com/rstudio/shiny-server.git
  19. _gitname=shiny-server
  20.  
  21. pkgver(){
  22. cd "$srcdir/$_gitname"
  23. git describe --tags --long | sed -E 's/v//;s/([^-]*-g)/r\1/;s/-/./g'
  24. }
  25.  
  26. prepare(){
  27. # Vigorously force the use of python2
  28. cd $srcdir
  29. find -type f -exec sed \
  30. -e 's_^#!/usr/bin/env python$_&2_' \
  31. -e 's_^\(#!/usr/bin/python2\).[45]$_\1_' \
  32. -e 's_^#!/usr/bin/python$_&2_' \
  33. -e "s_'python'_'python2'_" -i {} \;
  34. }
  35.  
  36. build() {
  37. cd "$srcdir/$_gitname"
  38. mkdir tmp
  39. cd tmp
  40. # More python2 hackery
  41. PATH=$PWD/../bin/:$PATH
  42. ln -s `which python2` ../bin/python
  43. export _PYTHON=`which python2`
  44. export PYTHON=`which python2`
  45.  
  46. # Node fails with gcc7
  47. export CC=/bin/gcc-6
  48. export CXX=/bin/g++-6
  49.  
  50. # CMake
  51. cmake -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON="$_PYTHON" ../
  52. make
  53.  
  54. mkdir ../build
  55. (cd .. && external/node/install-node.sh)
  56. (cd .. && bin/npm --python="$PYTHON" install)
  57. (cd .. && bin/node ext/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js --python="$PYTHON" rebuild)
  58. }
  59.  
  60. package() {
  61. cd "$srcdir/$_gitname/tmp"
  62. make DESTDIR="$pkgdir/" install
  63. mkdir -p $pkgdir/usr/bin/
  64. mkdir -p $pkgdir/etc/shiny-server/
  65. ln -s /usr/shiny-server/bin/shiny-server $pkgdir/usr/bin/shiny-server
  66. install -m 644 -D $srcdir/shiny-server.service $pkgdir/usr/lib/systemd/system/shiny-server.service
  67. install -m 644 -D $srcdir/$_gitname/config/default.config $pkgdir/etc/shiny-server/shiny-server.conf
  68. }
RAW Paste Data