summaryrefslogtreecommitdiff
path: root/libre/jmol/PKGBUILD
blob: e812c0c0f614846bcab6ebe200eaca8519ba7f3c (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
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=jmol
pkgver=14.6.5
_pkgver=${pkgver}_2016.12.06
pkgrel=1.parabola1
pkgdesc="a Java 3D viewer for chemical structures"
arch=(any)
url="http://jmol.sourceforge.net"
license=(LGPL)
depends=('java-runtime')
makedepends=('apache-ant-contrib' 'icedtea-web' 'java-commons-cli' 'java-naga' 'saxon6' 'unzip')
source=("http://downloads.sourceforge.net/jmol/Jmol-$_pkgver-full.tar.gz"
        'jmol-14.6.4_dontsign.patch')
sha1sums=('ebac77a2f6c7bb0694d90fde9766d4846c02e4e0'
          '03c3ba2a05d0e2192a627b6cd00219b5e4389e75')

prepare() {
  cd $pkgname-$_pkgver
  rm src/com/sparshui/cpp/HPTouchSmart/*.{dll,exe}
  rm -v {.,jars,plugin-jars,tools}/*.jar
  rm -v doc/jcfl-*.tar.gz
  rm -v jsmol.zip

  patch -Np1 -i ../jmol-14.6.4_dontsign.patch

  ln -sf /usr/share/icedtea-web/plugin.jar jars/netscape.jar
  ln -sf /usr/share/java/commons-cli.jar jars/commons-cli-1.2.jar
  ln -sf /usr/share/java/naga-3_0.jar jars/naga-3_0.jar
  ln -sf /usr/share/java/saxon.jar jars/saxon.jar
}

build() {
  cd $pkgname-$_pkgver
  ant classes \
    -lib /usr/share/java/ant-contrib.jar
  jar -cvf jars/JSpecView.jar -C build/classes/ jspecview

  ant init jar applet-jar doc \
    -lib /usr/share/java/ant-contrib.jar
}

package() {
  cd $pkgname-$_pkgver

  # Install license file
  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"

  # Install documentation
  install -d "$pkgdir/usr/share/doc/$pkgname"
  cp -r build/javadoc "$pkgdir/usr/share/doc/$pkgname"

  # Install jsmol
  unzip appletweb/jsmol.zip -d "$pkgdir/usr/share/"

  # Install jmol
  install -d "$pkgdir/usr/share/$pkgname"
  cp build/{Jmol,JmolData,JmolLib}.jar "$pkgdir/usr/share/$pkgname"
  cp jars/JSpecView.jar "$pkgdir/usr/share/$pkgname"
  cp build/jmol.sh "$pkgdir/usr/share/$pkgname"

  install -d "$pkgdir/usr/bin"
  ln -s "/usr/share/$pkgname/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
}