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

pkgname=jmol
pkgver=14.12.0
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-dontsign.patch'
        'jmol-build.patch')
sha256sums=('812118fd960774ae308d0335c39f225fb487dc622997e9d3451f763392e88a63'
            '3356db7f8c61c77a96269b245ec55835e2fa399efab43350979449b6802d8f39'
            '42e9c4e6a3df0341c3af985ed8b5bf4ba662ddbecd1f296c460076bfc20f5670')

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-dontsign.patch
  patch -Np1 -i ../jmol-build.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"
}