summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5606b29c3fc4c635042db2039f5f95db617399cf (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
# Maintainer: Joan Figueras <ffigue at gmail dot com>
# Contributor: Black_Codec <orso.f.regna@gmail.com>

pkgname=guacamole-client
pkgver=1.0.0
pkgrel=2
pkgdesc="Java and Maven components of Guacamole"
arch=('any')
url="http://guacamole.sourceforge.net/"
license=('GPL3')
replaces=('guacamole')
depends=('java-runtime' 'tomcat8' 'jre8-openjdk')
makedepends=('maven' 'jdk8-openjdk')
source=("http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${pkgver}/source/${pkgname}-${pkgver}.tar.gz"
        "guacamole.properties")
install=guacamole-client.install

md5sums=('76970caf9b88882d44e298698cbb72fe'
         '1f3ec0a32cc3c6b4f7aeb8a3b2e7531b')

backup=('usr/share/tomcat8/.guacamole/guacamole.properties' 'usr/share/tomcat8/.guacamole/user-mapping.xml')

build() {
  # force current Java to 1.8, if not, Guacamole doesn't build
  if [ "$(archlinux-java get)" != "java-8-openjdk" ]; then
    JAVA_HOME=/usr/lib/jvm/java-8-openjdk
    PATH="$JAVA_HOME/bin:$PATH"
  fi
  cd "$srcdir"/$pkgname-$pkgver
  mvn package
}
 
package() {
  cd "$srcdir"/$pkgname-$pkgver
  mkdir -m 775 -p "$pkgdir"/var/lib/tomcat8/
  mkdir -m 775 -p "$pkgdir"/var/lib/tomcat8/webapps/
  mkdir -p "$pkgdir"/usr/share/tomcat8/.${pkgname%-*}/
  install -D ${pkgname%-*}/target/${pkgname%-*}-$pkgver.war "$pkgdir"/var/lib/tomcat8/webapps/guacamole.war
  install -D ${pkgname%-*}/doc/example/user-mapping.xml "$pkgdir"/usr/share/tomcat8/.guacamole/
  install -D "$srcdir"/guacamole.properties "$pkgdir"/usr/share/tomcat8/.guacamole/
}