summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f28d6cc116dfde879b1373c0228365b1a468b3ef (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
pkgname=crate
pkgver=0.36.6
pkgrel=1
pkgdesc="shared nothing, fully searchable, document oriented cluster datastore."
arch=('any')
url='http://crate.io'
license=('custom:APACHE')
depends=('java-runtime')
install='crate.install'
source=(https://cdn.crate.io/downloads/releases/$pkgname-$pkgver.tar.gz
        crate.service)

backup=('etc/crate/crate.yml'
        'etc/crate/logging.yml')

package() {
    cd "$srcdir/$pkgname-$pkgver"

    # create dirs
    install -dm755 "$pkgdir/usr/share/$pkgname/"
    install -dm755 "$pkgdir/etc/$pkgname/"
    install -dm755 "$pkgdir/var/lib/$pkgname/"
    install -dm755 "$pkgdir/var/log/$pkgname/"

    if [ $CARCH = 'x86_64' ]; then
        install -Dm644 lib/sigar/libsigar-amd64-linux.so "$pkgdir/usr/share/crate/lib/sigar/libsigar-amd64-linux.so"
    else
        install -Dm644 lib/sigar/libsigar-x86-linux.so "$pkgdir/usr/share/crate/lib/sigar/libsigar-x86-linux.so"
    fi
    cp lib/sigar/sigar*.jar "$pkgdir/usr/share/crate/lib/sigar/"
    cp lib/*.jar "$pkgdir/usr/share/crate/lib/"

    cp config/* $pkgdir/etc/$pkgname
    cp -r {bin,plugins} $pkgdir/usr/share/crate

    # documentation
    install -dm755 $pkgdir/usr/share/doc/$pkgname/
    cp LICENSE.txt $pkgdir/usr/share/doc/$pkgname/LICENSE
    cp NOTICE $pkgdir/usr/share/doc/$pkgname/NOTICE
    cp CHANGES.txt $pkgdir/usr/share/doc/$pkgname/CHANGES

    install -Dm644 "$srcdir/crate.service" "$pkgdir/usr/lib/systemd/system/crate.service"
    # sphinx generated text docs
    if [ -d docs ]; then
        cp -r docs/ $pkgdir/usr/share/doc/$pkgname/
    fi
}