summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a2facc936355ac0d23178cac033df1be09b4f3c (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
# Maintainer: tarball <bootctl@gmail.com>
# Contributor: Karol Babioch <karol@babioch.de

pkgname=('tika' 'tika-server')
pkgver=2.9.2
pkgrel=1
pkgdesc='Apache Tika — detect and extract metadata and text from over a thousand different file types'
arch=('any')
url='https://tika.apache.org'
license=('Apache')
depends=('java-runtime-headless')
optdepends=(
  'tesseract: OCR support'
)
makedepends=('git' 'maven')
source=(
  "https://github.com/apache/tika/archive/refs/tags/$pkgver.tar.gz"
  'tika-server.service'
  'tika.desktop'
  'tika.sh'
  'tika.svg'
)
sha256sums=('6d4ddf8676c4081e239a9baabd48ed1c39b4cfb02601ba67466ef7bf01094c11'
            '4bfed9962d831fa5de01c94f83ee4784c9dd371d72035125508a63debd161862'
            '490cfc11aa05722a7831a3938a63df39b9d4d08e47e88b973479fffac17ce246'
            'caf002fe624623a6598e1753e42400e58f951d37cdf2410aaf0fd8e6343bc5c5'
            'ccae8a7ff8b30e73511e11f5c33facbf87d7e47db8cc86e14a52116ac96da9b7')

# Tests: https://issues.apache.org/jira/browse/TIKA-2487
#
# Vulnerability scanning only creates problems for the end user. There has been
# a vulnerability in a SQLite package at the time of writing this that the
# upstream does not consider serious enough to warrant a new release. They
# actually recommend disabling scanning if it breaks your builds…
build() {
  cd "$srcdir/$pkgname-$pkgver"

  mvn clean install \
    -Dmaven.test.skip=true \
    -Dmaven.repo.local=m2 \
    -Dossindex.skip
}

package_tika() {
  install -Dm755 tika.sh "$pkgdir/usr/bin/tika"
  install -Dm644 tika.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/tika.svg"
  install -Dm644 tika.desktop "$pkgdir/usr/share/applications/tika.desktop"

  cd "$srcdir/$pkgname-$pkgver"

  install -Dm644 "tika-app/target/tika-app-$pkgver.jar" \
    "$pkgdir/usr/lib/tika/tika-app.jar"
}

package_tika-server() {
  install -dm755 "$pkgdir/etc/default"

  cat >"$pkgdir/etc/default/tika-server" <<EOF
HOST=localhost
PORT=9998
EOF

  install -Dm644 tika-server.service \
    "$pkgdir/usr/lib/systemd/system/tika-server.service"

  cd "$srcdir/tika-$pkgver"

  install -Dm644 "tika-server/tika-server-standard/target/tika-server-standard-$pkgver.jar" \
    "$pkgdir/usr/lib/tika-server/tika-server.jar"
}