aboutsummaryrefslogtreecommitdiffstats
path: root/community/elasticsearch/APKBUILD
blob: 5d6851eb0798fbd6e46461ffa335c977f110ec5b (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=elasticsearch
pkgver=2.3.5
pkgrel=0
pkgdesc="Open Source, Distributed, RESTful Search Engine"
url="https://www.elastic.co/products/elasticsearch"
arch="x86 x86_64"
license="ASL-2.0"
depends="java-jna-native>=4.1 openjdk8-jre"
makedepends=""
install="$pkgname.pre-install"
source="https://download.elasticsearch.org/$pkgname/release/org/$pkgname/distribution/tar/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	"
builddir="$srcdir/$pkgname-$pkgver"

_modules="lang-expression lang-groovy reindex"
for _mod in $_modules; do
	subpackages="$subpackages $pkgname-$_mod:_${_mod//-/_}"
	eval "_${_mod//-/_}() { _builtin_module $_mod; }"
done

_basedir="/usr/share/java/$pkgname"

build() {
	sed "s/@@ES_VERSION@@/$pkgver/" "$srcdir"/$pkgname.initd \
		> "$builddir"/$pkgname.initd
}

package() {
	local destdir="$pkgdir/$_basedir"
	local confdir="$pkgdir/etc/$pkgname"
	local user="elastico"
	local group="$user"

	cd "$builddir"

	install -dm755 "$destdir"/lib "$destdir"/modules
	install -m644 -t "$destdir"/lib lib/* || return 1

	install -dm755 "$confdir"
	install -m644 -t "$confdir" config/* || return 1

	install -m755 -D $pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1

	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

_builtin_module() {
	local name="$1"
	local destdir="$subpkgdir/$_basedir/modules/$name"

	install -dm755 "$destdir"
	install -m644 -t "$destdir" "$builddir"/modules/$name/*
}

md5sums="8274f2a966bd888b108a834f64b99ce6  elasticsearch-2.3.5.tar.gz
8588526df39a4d7fab06cf885edec731  elasticsearch.initd
11ca8100933039b8433eac9342e9e326  elasticsearch.confd"
sha256sums="1119a8c18620b98c4b85261318663a1f26dea92a26f34dfeb7f813fb7cbb468a  elasticsearch-2.3.5.tar.gz
b4cacc84afac4f4d51cad888b0dca034a91e3aed96543d43126a86fa7c3f2bb6  elasticsearch.initd
356989a74e111a50862712f877da1078ffbc77a4a2735090e2aa87bfa9cbf1e0  elasticsearch.confd"
sha512sums="9c0cc8a9ae0fa2b52db583a5c006b05a84c1f84e1b8dbbafa88bec111190d056a23bd384d4241ce00dc8b56a6840857b296e4c0d2bf911f352ef67f128a87ca7  elasticsearch-2.3.5.tar.gz
9fe933d6b1b53a02514d34377e6362d176148da3297edbea5902a1c4aff9762aa9c9cb00f053c9aec42db8dea22f722f8a3e16f5ed5b32f5b975e0b311a5e6ff  elasticsearch.initd
e1e4b31f8bac2e79118e7bf9b25ca8a31eefa6fb00d35c57ccf2db718236a3255d5cbfe429009a98c6f4a8ded19d291e97e5a4d9c44fa044ed6f9961792f5d62  elasticsearch.confd"