aboutsummaryrefslogtreecommitdiffstats
path: root/testing/elasticsearch/APKBUILD
blob: d35ae4acdf6c7e4456384116a684ec69a4fc27ff (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.1
pkgrel=1
pkgdesc="Open Source, Distributed, RESTful Search Engine"
url="https://www.elastic.co/products/elasticsearch"
arch="noarch"
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="64e2333b904c07d320f3e995a8cf1489  elasticsearch-2.3.1.tar.gz
8588526df39a4d7fab06cf885edec731  elasticsearch.initd
11ca8100933039b8433eac9342e9e326  elasticsearch.confd"
sha256sums="f0092e73038e0472fcdd923e5f2792e13692ea0f09ca034a54dd49b217110ebb  elasticsearch-2.3.1.tar.gz
b4cacc84afac4f4d51cad888b0dca034a91e3aed96543d43126a86fa7c3f2bb6  elasticsearch.initd
356989a74e111a50862712f877da1078ffbc77a4a2735090e2aa87bfa9cbf1e0  elasticsearch.confd"
sha512sums="447d8824c4bfbec9b8431d213e3a8ae6720d1486e1389c271cc67cce5546861a817ef8c7db1c3c3669a50a61b5305739ac26f46b04d5674bbca203c3b5dbcf2f  elasticsearch-2.3.1.tar.gz
9fe933d6b1b53a02514d34377e6362d176148da3297edbea5902a1c4aff9762aa9c9cb00f053c9aec42db8dea22f722f8a3e16f5ed5b32f5b975e0b311a5e6ff  elasticsearch.initd
e1e4b31f8bac2e79118e7bf9b25ca8a31eefa6fb00d35c57ccf2db718236a3255d5cbfe429009a98c6f4a8ded19d291e97e5a4d9c44fa044ed6f9961792f5d62  elasticsearch.confd"