summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorHa The Tung2020-02-17 14:56:23 +0800
committerHa The Tung2020-02-17 14:56:23 +0800
commitb9ecaca56769d65002b13d353e3bc595c8cb403f (patch)
tree26d4148cadee24b080828842b5b1cd980d8e310b /PKGBUILD
downloadaur-b9ecaca56769d65002b13d353e3bc595c8cb403f.tar.gz
es 6.8.6-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD90
1 files changed, 90 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..630a12f66327
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,90 @@
+# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Contributor: Marcello "mererghost" Rocha <https://github.com/mereghost>
+# Refactored by Blaž "Speed" Hrastnik <https://github.com/archSeer>
+
+pkgname=elasticsearch6
+_pkgname=elasticsearch
+pkgver=6.8.6
+pkgrel=1
+pkgdesc="Distributed RESTful search engine built on top of Lucene"
+arch=('any')
+url="https://www.elastic.co/products/elasticsearch"
+license=('Apache')
+depends=('java-runtime-headless' 'systemd')
+source=(
+ "https://artifacts.elastic.co/downloads/$_pkgname/$_pkgname-oss-$pkgver.tar.gz"
+ elasticsearch-env
+ elasticsearch.service
+ elasticsearch@.service
+ elasticsearch-keystore.service
+ elasticsearch-keystore@.service
+ elasticsearch-sysctl.conf
+ elasticsearch-user.conf
+ elasticsearch-tmpfile.conf
+ elasticsearch.default
+)
+sha256sums=('351861766c5fd8c1148e74c4186c6f77dcfe14b0c2c3a7e74315d3989b9ae068'
+ 'cce7cfe85ddea80ff6db10ec88f973b87ffa97b9f6a2614234b846551a7731d7'
+ 'ff1c01c16f77d18b0cf8c94798dd74f86a1f89d132508b98dcc8a8e9251c1750'
+ '2af4e23d1e1b99211c413a73600e369b190eb7d5ff1ad844ad93191b0adc5311'
+ '51ec569bbcbcb16929f6f39d7dfda9a0a8938225e4041e2e84aa18cb2c36dd3f'
+ 'bc159a611dbb4a05dfe8805429bc02a65b4f78191e14d17a68f655e90237a327'
+ 'b3feb1e9c7e7ce6b33cea6c727728ed700332aae942ca475c3bcc1d56b9f113c'
+ '815f6a39db6f54bb40750c382ffbdc298d2c4c187ee8ea7e2f855923e2ff354b'
+ '0ead1f4724268b51c0db15ee8f0612d23f87c3dc0445b737bc9b96e5511cb38c'
+ 'bb74e5fb8bc28f2125e015395ab05bea117b72bfc6dadbca827694b362ee0bf8')
+
+backup=('etc/elasticsearch6/elasticsearch.yml'
+ 'etc/elasticsearch6/log4j2.properties'
+ 'etc/elasticsearch6/jvm.options'
+ 'etc/default/elasticsearch6')
+
+prepare() {
+ cd "$srcdir"/$_pkgname-$pkgver
+
+ find bin -type f \( -name \*.bat -o -name \*.exe \) -delete
+ find bin -type f \( -name \*.jar -o -name \*-env \) -exec chmod a-x {} +
+ find bin -type f ! -name \*.jar -exec \
+ sed -r 's;source .*/(.*)-env;source /usr/share/elasticsearch6/\1-env;' -i {} +
+ find bin -type f -name "elasticsearch-*" ! -name elasticsearch-bin -exec \
+ sed 's/`dirname "$0"`/$(dirname "$(realpath "$0")")/' -i {} +
+}
+
+package() {
+ cd "$pkgdir"
+ install -dm750 etc/elasticsearch6{,/scripts}
+ install -dm755 {usr/share,var/lib,var/log}/elasticsearch6
+ install -dm755 usr/bin
+
+ cd "$srcdir"/$_pkgname-$pkgver
+ cp -R bin lib modules plugins "$pkgdir"/usr/share/elasticsearch6/
+
+ cd config
+ for conf in *; do
+ install -Dm644 "$conf" "$pkgdir/etc/elasticsearch6/$conf"
+ done
+
+ cd ..
+ mv bin/elasticsearch-env .
+ # find bin/ -type f -name elasticsearch-\* ! -name elasticsearch-cli -exec \
+ # ln -s ../share/elasticsearch6/{} "$pkgdir"/usr/{} \;
+ ln -s ../share/elasticsearch6/elasticsearch-keystore "$pkgdir"/usr/elasticsearch6-keystore
+ ln -s ../share/elasticsearch6/elasticsearch-plugin "$pkgdir"/usr/elasticsearch6-plugin
+ ln -s ../share/elasticsearch6/elasticsearch-shard "$pkgdir"/usr/elasticsearch6-shard
+ ln -s ../share/elasticsearch6/elasticsearch-translog "$pkgdir"/usr/elasticsearch6-translog
+
+ cd "$pkgdir"/usr/share/elasticsearch6
+ ln -s ../../../var/log/elasticsearch6 logs
+ ln -s ../../../var/lib/elasticsearch6 data
+
+ cd "$pkgdir"
+ install -Dm644 "$srcdir"/elasticsearch-env usr/share/elasticsearch6/elasticsearch-env
+ install -Dm644 "$srcdir"/elasticsearch.service usr/lib/systemd/system/elasticsearch6.service
+ install -Dm644 "$srcdir"/elasticsearch@.service usr/lib/systemd/system/elasticsearch6@.service
+ install -Dm644 "$srcdir"/elasticsearch-keystore.service usr/lib/systemd/system/elasticsearch6-keystore.service
+ install -Dm644 "$srcdir"/elasticsearch-keystore@.service usr/lib/systemd/system/elasticsearch6-keystore@.service
+ install -Dm644 "$srcdir"/elasticsearch-user.conf usr/lib/sysusers.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch-tmpfile.conf usr/lib/tmpfiles.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch-sysctl.conf usr/lib/sysctl.d/elasticsearch6.conf
+ install -Dm644 "$srcdir"/elasticsearch.default etc/default/elasticsearch6
+}