summaryrefslogtreecommitdiff
path: root/extra/x2goserver/PKGBUILD
blob: 81cd35dc2a8b393e6a8d417d9c097c1973617038 (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
# $Id: PKGBUILD 203654 2014-01-13 17:17:44Z andyrtr $
# Maintainer: AndyRTR <andyrtr@archlinux.org>

# Contributor: Gerhard Brauer <gerbra@archlinux.de>
# Contributor: Richard Murri <admin@richardmurri.com>
# Contributor: Markus Opitz <mastero23 at gmail dot com>
# Contributor: Milan Knížek <knizek@volny.cz>

pkgname=x2goserver
pkgver=4.0.1.12
pkgrel=2
pkgdesc="Open source terminal server"
arch=('i686' 'x86_64')
url="http://www.x2go.org/"
license=('GPL2')
# see x2goserver.spec
depends=(# 'perl-file-basedir'
         #'python' 'xorg-xauth' 

         # For x2goruncommand - for now
         'bc'
         # For netstat in x2goresume-session
         'net-tools'
         'openssh'
         'perl-file-readbackwards'
         # We need a database
         'perl-dbd-sqlite' 
         # For killall in x2gosuspend-session
         'psmisc'
         # For x2goshowblocks
         'lsof'
         # For x2godbadmin
		 'pwgen' # in community
         # For printing, file-sharing
         'sshfs'
         # For /etc/sudoers.d
         'sudo'
         'x2go-agent'
         # For /etc/X11/Xresources
         'xorg-xinit'
         'xorg-fonts-misc'
         'shadow'
         
         # for post install actions
         'desktop-file-utils'
         'shared-mime-info'
         
         'perl-capture-tiny'
         'perl-config-simple'

         #x2goserver-extensions
         #x2goserver-xsession
         #x2goserver-fmbindings
         #x2goserver-printing
)
makedepends=('man2html' 'perl-extutils-makemaker' 'systemd')
#optdepends=('cups-x2go: printing support')
options=('emptydirs')
install=x2goserver.install
backup=('etc/x2go/x2goserver.conf' 'etc/x2go/x2gosql/sql')
source=(http://code.x2go.org/releases/source/${pkgname}/${pkgname}-${pkgver}.tar.gz)
md5sums=('2f41accfb7b7d8b8113eb6f2f686e340')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # -r option does not exist in Arch linux
  # (However, html man pages do not get installed anyway...)
  for Makefile in $(find . -type f -name Makefile); do
    sed -i 's@(MAN2HTML_BIN) -r @(MAN2HTML_BIN) < @g' $Makefile
    sed -i 's@ \$(MAN2HTML_SRC)/@ < \$(MAN2HTML_SRC)/@g' $Makefile
  done

  # fix some Makefile permission options
  for Makefile in $(find . -type f -name Makefile); do
    sed -i "s:-o root -g root ::g" $Makefile
  done
  # Do not ship xsession - Debian specific
  sed -i -e '/xsession/s/^/#/' Makefile
  
  make PREFIX=/usr SBINDIR=/usr/bin DESTDIR="$pkgdir" PERL_INSTALLDIRS=vendor
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make -j1 PREFIX=/usr SBINDIR=/usr/bin DESTDIR="$pkgdir" install

  # systemd service file 
  install -Dm 644 "$srcdir/${pkgname}-${pkgver}/x2goserver.service" "$pkgdir/usr/lib/systemd/system/x2goserver.service"
  
  # X2go homedir + printing spool dir
  install -dm 770 $pkgdir/var/lib/x2go
  install -dm 770 $pkgdir/var/spool/x2go
  
  # load fuse module at system start
  install -dm755 $pkgdir/usr/lib/modules-load.d
  echo "fuse" > $pkgdir/usr/lib/modules-load.d/x2goserver.conf

  install -dm 755 "${pkgdir}/usr/share/doc/${pkgname}"
  install -m 644 "debian/changelog" "${pkgdir}/usr/share/doc/${pkgname}/changelog.DEBIAN"
  install -m 644 "debian/copyright" "${pkgdir}/usr/share/doc/${pkgname}/copyright.DEBIAN"

  # fix permission
  chmod 750 ${pkgdir}/etc/sudoers.d
}