Created
December 23, 2012 14:29
-
-
Save anonymous/4363674 to your computer and use it in GitHub Desktop.
elasticsearch 0.20.1-3 PKGBUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install(){ | |
useradd -r -g daemon -d /usr/share/elasticsearch -s /bin/false elasticsearch | |
chown -R elasticsearch:daemon /usr/share/elasticsearch | |
chown -R elasticsearch:daemon /var/lib/elasticsearch | |
chown -R elasticsearch:daemon /var/log/elasticsearch | |
} | |
post_remove(){ | |
userdel elasticsearch | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=ElasticSearch | |
BindTo=network.target | |
After=syslog.target | |
[Service] | |
User=elasticsearch | |
ExecStart=/usr/share/elasticsearch/bin/elasticsearch -f | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Marcello "mererghost" Rocha <https://github.com/mereghost> | |
# Refactored by Blaž "Speed" Hrastnik <https://github.com/archSeer> | |
pkgname=elasticsearch | |
pkgver=0.20.1 | |
pkgrel=3 | |
pkgdesc="Distributed RESTful search engine built on top of Lucene" | |
arch=('i686' 'x86_64') | |
url="http://www.elasticsearch.org/" | |
license=('APACHE') | |
depends=('java-runtime') | |
install='elasticsearch.install' | |
source=( | |
"http://download.elasticsearch.org/$pkgname/$pkgname/$pkgname-$pkgver.tar.gz" | |
elasticsearch.service | |
) | |
md5sums=('63996902e06dee8f397fe86fc625b505' | |
'2511ba1465ca3e8266e101806c29196a') | |
build() { | |
# Remove unnesessary libraries | |
cd "$srcdir/$pkgname-$pkgver" | |
case $CARCH in | |
i686) _bits=32 ;; | |
x86_64) _bits=64 ;; | |
*) echo "Unknown architecture '$CARCH'"; exit 1 | |
esac | |
find lib/sigar/* ! -name '*.jar' ! -name '*x86-linux.so' -delete | |
# Edit the values of the config files | |
sed -e 's/# \(path\.conf: \).*$/\1\/etc\/elasticsearch/' \ | |
-e '0,/# \(path\.data: \).*$/s//\1\/var\/lib\/elasticsearch/' \ | |
-e 's/# \(path\.work: \).*$/\1\/tmp\/elasticsearch/' \ | |
-e 's/# \(path\.logs: \).*$/\1\/var\/log\/elasticsearch/' \ | |
-i config/elasticsearch.yml | |
} | |
package() { | |
cd "$srcdir/$pkgname-$pkgver" | |
# creates the necessary dirs | |
install -dm755 "$pkgdir/usr/share/elasticsearch/bin" | |
install -dm755 "$pkgdir/etc/elasticsearch" | |
install -dm755 "$pkgdir/var/lib/elasticsearch" | |
install -dm755 "$pkgdir/var/log/elasticsearch" | |
install -dm755 "$pkgdir/run/elasticsearch" | |
cp config/* "$pkgdir/etc/elasticsearch/" | |
cp -r {bin,lib} "$pkgdir/usr/share/elasticsearch" | |
# install systemd script | |
install -Dm644 "$srcdir/elasticsearch.service" "$pkgdir/usr/lib/systemd/system/elasticsearch.service" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment