summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c77fcc42494c72798eb616763c51b610cc8ffc88 (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
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Tom Wizetek <tom@wizetek.com>

# TODO: Further cleanup

pkgname=jxplorer
pkgver=3.3.1
pkgrel=1
pkgdesc='Java LDAP client'
_pkgbin="${pkgname}-${pkgver}-linux-installer.run"
_desktop='usr/share/applications/JXplorer.desktop'
url='http://jxplorer.org/'
license=('custom')
arch=('any')
depends=('java-runtime')
source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/version%20${pkgver}/${_pkgbin}")
md5sums=('19d7f034b3b0687800c0efb2f6ec35ab')

package() {
  chmod 0700 ${_pkgbin}
  ./${_pkgbin} --mode unattended --prefix ${srcdir}/${pkgname}
  
  install -d -m 0755 ${pkgdir}/opt
  cp -r ${srcdir}/${pkgname} ${pkgdir}/opt
  chmod 0755 ${pkgdir}/opt/${pkgname}/jxplorer.sh
  
  # Regrettably, there is no user settings separation (as far as I can tell).
  # We will use globally writeable config files then. Sorry.
  # There may be more than these two files and the plugins directory!
  touch ${pkgdir}/opt/${pkgname}/gssapi.conf
  touch ${pkgdir}/opt/${pkgname}/jxconfig.txt
  chmod 0666 ${pkgdir}/opt/${pkgname}/gssapi.conf
  chmod 0666 ${pkgdir}/opt/${pkgname}/jxconfig.txt
  chmod 0777 ${pkgdir}/opt/${pkgname}/plugins
  
  cat > ${pkgname}.run << EoF
#!/bin/sh
cd /opt/${pkgname}
sh jxplorer.sh "\$@"
EoF
  install -d "$pkgdir/usr/bin"
  install -Dm755 "$pkgname.run" "$pkgdir/usr/bin/$pkgname"
  
  install -Dm644 "$srcdir/$pkgname/JXplorer.desktop" "$pkgdir/$_desktop"
  sed -i "s,${srcdir},/opt," "$pkgdir/$_desktop"
  sed -i "/^Version=/c\Version=${pkgver}" "$pkgdir/$_desktop"
  sed -i "/^Comment=/c\Comment=${pkgdesc}" "$pkgdir/$_desktop"
  
  rm "$pkgdir/opt/$pkgname/uninstall" \
    "$pkgdir/opt/$pkgname/"*.desktop \
    "$pkgdir/opt/$pkgname/"*.bat
}

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