diff options
author | Eric Liu | 2019-03-26 21:34:11 -0400 |
---|---|---|
committer | Eric Liu | 2019-03-26 21:34:11 -0400 |
commit | 2e850ea5c523be8bb9cb62f6dc9c2aece1d39b63 (patch) | |
tree | b96592f3dbc09daccc92d704a45484aff9913320 | |
download | aur-2e850ea5c523be8bb9cb62f6dc9c2aece1d39b63.tar.gz |
initial commit for ELK with xpack
-rw-r--r-- | .SRCINFO | 49 | ||||
-rw-r--r-- | PKGBUILD | 116 | ||||
-rw-r--r-- | build.patch | 58 | ||||
-rw-r--r-- | bundle.config | 4 | ||||
-rw-r--r-- | logstash-sysuser.conf | 1 | ||||
-rw-r--r-- | logstash-tmpfile.conf | 6 | ||||
-rw-r--r-- | logstash.service | 23 | ||||
-rw-r--r-- | logstash@.service | 7 |
8 files changed, 264 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e03b2fe2765d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,49 @@ +pkgbase = logstash-xpack + pkgdesc = Tool for managing events and logs + pkgver = 6.6.2 + pkgrel = 1 + url = https://www.elastic.co/products/logstash/ + arch = x86_64 + license = Apache + makedepends = java-environment<11 + makedepends = git + depends = java-runtime-headless>=8 + depends = ruby + depends = ruby-bundler + depends = coreutils + depends = awk + provides = logstash + conflicts = logstash + noextract = jruby-dist-9.1.13.0-bin.tar.gz + backup = etc/conf.d/logstash + backup = etc/logstash/jvm.options + backup = etc/logstash/log4j2.properties + backup = etc/logstash/logstash.yml + backup = etc/logstash/pipelines.yml + source = https://github.com/elastic/logstash/archive/v6.6.2/logstash-6.6.2.tar.gz + source = https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.1.13.0/jruby-dist-9.1.13.0-bin.tar.gz + source = build.patch + source = logstash.service + source = logstash@.service + source = logstash-sysuser.conf + source = logstash-tmpfile.conf + source = bundle.config + sha256sums = bfbd7de22693a34c33c04778823af7a2549e0df74ae9aa01b5f0ef94b59347bf + sha256sums = 9d156646623ac2f27174721035b52572a4b05690db7c1293295aa2c04aad3908 + sha256sums = 640f1c81e6c68f9d1256875db89f5439992e2b8188fb7e6e3ddcdae1c33a3af8 + sha256sums = 2b8b29297202334c784fdd7f2eb8d7e776c24c783b3c9f8387b500ab0039335c + sha256sums = a01ea29d4f53d785f6eb926ebfe445e64ed5b3dab5d0418848589dd79502d876 + sha256sums = 18a68a59ddb0ce19778e83b65e68dd568d65b7180bf45b4cf298fb332d69eb26 + sha256sums = 346b630484f8a35b1a549e94e53e3e151527852a29c72cc6e529221215a7f533 + sha256sums = fe05315345e4489458c3eecac43726800109c1e390e74a14584096f6c041fee1 + sha512sums = 7de3c50018f20617acc4881fd7fee64be98a53d2abd4867d928519c91fd028affa2e588fcec7806b0b689de4ab707e7001a60d09b13ff76ecd0f52fae7fee5b2 + sha512sums = ef88f613ada2665d4f63b2e2f15594739de8ba501406e76de417821f44847b0e258524687b0ae0cf5b737520aa4dd9bb59d80a4b89a81408cda638f28bebbead + sha512sums = 21adfc88d980cabb3a45ac029b5dddf8c4b4bc96ac95999ae85fa655101ff58b139bceb613c0e91c108f3f78dcb21ba6f997ee2884c58c3a55eaa7938b6959c4 + sha512sums = 817097565519dc7c5eac7521339947c74c6148683ca594356dd2ceb3274a1e94f8e7318ce310e0fe5789d7ab0d4c23404f814bef31036a11ddfec08d16814c69 + sha512sums = ce2cef4a784845b00d7c867273555811450bc459669abb5be944bfbbb02708129983e45376a9b308d6db22b2c7b4a7a212827a4826f2a27bc7e143cebc9abfe0 + sha512sums = d811dc3b18d0032b79b4669c9f6aefca49963897c309d83cbf87616c7b8cb5944c17c8072980bcd115d0fb57ef1624d98259ff1082d402d308c33e766ee89699 + sha512sums = 05ea8af97c4f6ac9ba5518b99dc3136859edd24d8376940b48b8c7a70586c8bc188deb1079a99e19d437c39e0eb17d68e7cc3f9af4aa3ad2bc6a87c08cae94a6 + sha512sums = 5091aa34cc31acd50fd2865714080cf6e67c2d437424f27e001bb409c2885a0e82eabe4ce17461d60c181f460a16df0a03d53bac6015fb731b3e5225735fd4da + +pkgname = logstash-xpack + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..913807c55d92 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,116 @@ +# Maintainer: Eric Liu <eric@hnws.me> +# Official repo maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org> +# Official repo maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com> + +pkgname=logstash-xpack +relpkgname=logstash +pkgver=6.6.2 +_jrubyver=9.1.13.0 +pkgrel=1 +pkgdesc='Tool for managing events and logs' +url='https://www.elastic.co/products/logstash/' +arch=('x86_64') +license=('Apache') +depends=('java-runtime-headless>=8' 'ruby' 'ruby-bundler' 'coreutils' 'awk') +makedepends=('java-environment<11' 'git') +provides=('logstash') +conflicts=('logstash') +backup=('etc/conf.d/logstash' + 'etc/logstash/jvm.options' + 'etc/logstash/log4j2.properties' + 'etc/logstash/logstash.yml' + 'etc/logstash/pipelines.yml') +_jrubydist=jruby-dist-${_jrubyver}-bin.tar.gz +source=(https://github.com/elastic/logstash/archive/v${pkgver}/$relpkgname-${pkgver}.tar.gz + https://repo1.maven.org/maven2/org/jruby/jruby-dist/${_jrubyver}/${_jrubydist} + build.patch + logstash.service + logstash@.service + logstash-sysuser.conf + logstash-tmpfile.conf + bundle.config) +noextract=(${_jrubydist}) +sha256sums=('bfbd7de22693a34c33c04778823af7a2549e0df74ae9aa01b5f0ef94b59347bf' + '9d156646623ac2f27174721035b52572a4b05690db7c1293295aa2c04aad3908' + '640f1c81e6c68f9d1256875db89f5439992e2b8188fb7e6e3ddcdae1c33a3af8' + '2b8b29297202334c784fdd7f2eb8d7e776c24c783b3c9f8387b500ab0039335c' + 'a01ea29d4f53d785f6eb926ebfe445e64ed5b3dab5d0418848589dd79502d876' + '18a68a59ddb0ce19778e83b65e68dd568d65b7180bf45b4cf298fb332d69eb26' + '346b630484f8a35b1a549e94e53e3e151527852a29c72cc6e529221215a7f533' + 'fe05315345e4489458c3eecac43726800109c1e390e74a14584096f6c041fee1') +sha512sums=('7de3c50018f20617acc4881fd7fee64be98a53d2abd4867d928519c91fd028affa2e588fcec7806b0b689de4ab707e7001a60d09b13ff76ecd0f52fae7fee5b2' + 'ef88f613ada2665d4f63b2e2f15594739de8ba501406e76de417821f44847b0e258524687b0ae0cf5b737520aa4dd9bb59d80a4b89a81408cda638f28bebbead' + '21adfc88d980cabb3a45ac029b5dddf8c4b4bc96ac95999ae85fa655101ff58b139bceb613c0e91c108f3f78dcb21ba6f997ee2884c58c3a55eaa7938b6959c4' + '817097565519dc7c5eac7521339947c74c6148683ca594356dd2ceb3274a1e94f8e7318ce310e0fe5789d7ab0d4c23404f814bef31036a11ddfec08d16814c69' + 'ce2cef4a784845b00d7c867273555811450bc459669abb5be944bfbbb02708129983e45376a9b308d6db22b2c7b4a7a212827a4826f2a27bc7e143cebc9abfe0' + 'd811dc3b18d0032b79b4669c9f6aefca49963897c309d83cbf87616c7b8cb5944c17c8072980bcd115d0fb57ef1624d98259ff1082d402d308c33e766ee89699' + '05ea8af97c4f6ac9ba5518b99dc3136859edd24d8376940b48b8c7a70586c8bc188deb1079a99e19d437c39e0eb17d68e7cc3f9af4aa3ad2bc6a87c08cae94a6' + '5091aa34cc31acd50fd2865714080cf6e67c2d437424f27e001bb409c2885a0e82eabe4ce17461d60c181f460a16df0a03d53bac6015fb731b3e5225735fd4da') + +prepare() { + cd $relpkgname-${pkgver} + rm bin/*.bat + sed -e 's|LS_SETTINGS_DIR=.*|LS_SETTINGS_DIR="/etc/logstash"|' -i config/startup.options + sed -e '1i [ -f /etc/profile.d/jre.sh ] && . /etc/profile.d/jre.sh' -i bin/logstash.lib.sh + + # remove deprecated JVM options + sed 's|"-XX:+UseParNewGC", ||g' -i logstash-core/benchmarks/build.gradle + sed 's|-XX:+UseParNewGC||g' -i config/jvm.options + + patch -p1 -i "$srcdir"/build.patch + + # Use system gradle (currently not working) + # sed 's;./gradlew;gradle;g' -i rakelib/*.rake + + # Skip downloadAndInstallJRuby task in the bootstrap process + sed /downloadAndInstallJRuby/d -i rakelib/vendor.rake + + mkdir -p vendor/_/ + cd vendor/_/ + ln -s "$srcdir"/${_jrubydist} +} + +build() { + cd $relpkgname-${pkgver} + export PATH="/usr/lib/jvm/java-10-openjdk/bin:$PWD/vendor/jruby/bin:$PATH" + + # gradle downloadAndInstallJRuby (system gradle currently not working) + ./gradlew downloadAndInstallJRuby + rake bootstrap + rake plugin:install-default + + rm -r vendor/_ build ci logstash-core/{build,src,spec} qa pkg spec rakelib tools vendor/bundle/jruby/*/cache .gradle + + cd vendor/jruby/lib + mv jni jni-temp + mkdir jni + mv jni-temp/x86_64-Linux jni/ + rm -rf jni-temp +} + +package() { + cd $relpkgname-${pkgver} + + install -dm 755 "${pkgdir}/usr/share/logstash" "${pkgdir}/etc/conf.d" + mv config/startup.options "${pkgdir}/etc/conf.d/logstash" + mv config "${pkgdir}/etc/logstash" + chmod 750 "${pkgdir}/etc/logstash" + + cp -a bin data lib logstash* modules vendor Gemfile* "${pkgdir}/usr/share/logstash" + rm -rf "${pkgdir}/usr/share/logstash/logstash-core/"{.lock,benchmarks,*gradle*} + chmod -R go-w "${pkgdir}/usr/share/logstash/" + + install -Dm 644 "${srcdir}"/{logstash.service,logstash@.service} -t "${pkgdir}/usr/lib/systemd/system" + install -Dm 644 "${srcdir}/logstash-sysuser.conf" "${pkgdir}/usr/lib/sysusers.d/logstash.conf" + install -Dm 644 "${srcdir}/logstash-tmpfile.conf" "${pkgdir}/usr/lib/tmpfiles.d/logstash.conf" + install -Dm 644 "${srcdir}/bundle.config" "${pkgdir}/usr/share/logstash/.bundle/config" + + install -dm 755 "${pkgdir}/var/lib/logstash" + install -dm 755 "${pkgdir}/var/log/logstash" + install -dm 755 "${pkgdir}/etc/logstash/conf.d" + + install -d "${pkgdir}/usr/bin" + ln -s /usr/share/logstash/bin/logstash "${pkgdir}/usr/bin/logstash" +} + +# vim: ts=2 sw=2 et: diff --git a/build.patch b/build.patch new file mode 100644 index 000000000000..b4ab046f16d3 --- /dev/null +++ b/build.patch @@ -0,0 +1,58 @@ +diff --git a/build.gradle b/build.gradle +index 3fda82e..d926183 100644 +--- a/build.gradle ++++ b/build.gradle +@@ -121,7 +121,6 @@ if (versionMap["jruby-runtime-override"]) { + clean { + delete "${projectDir}/Gemfile" + delete "${projectDir}/Gemfile.lock" +- delete "${projectDir}/vendor" + delete "${projectDir}/.bundle" + delete "${projectDir}/qa/integration/Gemfile.lock" + delete "${projectDir}/qa/integration/.bundle" +@@ -158,7 +157,7 @@ task downloadJRuby(type: Download) { + + downloadJRuby.onlyIf { customJRubyDir == "" } + +-task verifyFile(dependsOn: downloadJRuby, type: Verify) { ++task verifyFile(type: Verify) { + description "Verify the SHA1 of the download JRuby artifact" + inputs.file(jrubyTarPath) + outputs.file(jrubyTarPath) +@@ -169,35 +168,7 @@ task verifyFile(dependsOn: downloadJRuby, type: Verify) { + + verifyFile.onlyIf { customJRubyDir == "" } + +-task buildCustomJRuby(type: Exec) { +- description "Build tar.gz and .jar artifacts from JRuby source directory" +- workingDir customJRubyDir +- commandLine './mvnw', 'clean', 'install', '-Pdist', '-Pcomplete' +- standardOutput = new ByteArrayOutputStream() +- errorOutput = new ByteArrayOutputStream() +- ext.output = { +- standardOutput.toString() + errorOutput.toString() +- } +-} +- +-buildCustomJRuby.onlyIf { customJRubyDir != "" } +- +-task installCustomJRuby(dependsOn: buildCustomJRuby, type: Copy) { +- description "Install custom built JRuby in the vendor directory" +- inputs.file(customJRubyTar) +- outputs.dir("${projectDir}/vendor/jruby") +- from tarTree(customJRubyTar == "" ? jrubyTarPath : customJRubyTar) +- eachFile { f -> +- f.path = f.path.replaceFirst("^jruby-${customJRubyVersion}", '') +- } +- exclude "**/stdlib/rdoc/**" +- includeEmptyDirs = false +- into "${projectDir}/vendor/jruby" +-} +- +-installCustomJRuby.onlyIf { customJRubyDir != "" } +- +-task downloadAndInstallJRuby(dependsOn: [verifyFile, installCustomJRuby], type: Copy) { ++task downloadAndInstallJRuby(dependsOn: [verifyFile], type: Copy) { + description "Install JRuby in the vendor directory" + inputs.file(jrubyTarPath) + outputs.dir("${projectDir}/vendor/jruby") diff --git a/bundle.config b/bundle.config new file mode 100644 index 000000000000..40858967d81d --- /dev/null +++ b/bundle.config @@ -0,0 +1,4 @@ +--- +BUNDLE_PATH: /usr/share/logstash/vendor/bundle +BUNDLE_WITHOUT: build:development +BUNDLE_GEMFILE: /usr/share/logstash/Gemfile diff --git a/logstash-sysuser.conf b/logstash-sysuser.conf new file mode 100644 index 000000000000..4bbf30cd96b8 --- /dev/null +++ b/logstash-sysuser.conf @@ -0,0 +1 @@ +u logstash - "Logstash user" /var/lib/logstash diff --git a/logstash-tmpfile.conf b/logstash-tmpfile.conf new file mode 100644 index 000000000000..7499137b19e9 --- /dev/null +++ b/logstash-tmpfile.conf @@ -0,0 +1,6 @@ +d /var/log/logstash 0755 logstash logstash - +d /var/lib/logstash 0755 logstash logstash - +d /usr/share/logstash 0755 logstash logstash - +Z /usr/share/logstash - logstash logstash - + +d /etc/logstash 0750 logstash logstash - diff --git a/logstash.service b/logstash.service new file mode 100644 index 000000000000..cba0a738e5df --- /dev/null +++ b/logstash.service @@ -0,0 +1,23 @@ +[Unit] +Description=Logstash +Documentation=http://www.elastic.co +After=elasticsearch.service + +[Service] +Environment=LS_HOME=/var/lib/logstash +Environment=LS_HEAP_SIZE="500m" +Environment=LS_CONF_DIR=/etc/logstash/conf.d +Environment=LS_LOG_DIR=/var/log/logstash +Environment=LS_SETTINGS_DIR=/etc/logstash +User=logstash +Group=logstash +ExecStart=/usr/share/logstash/bin/logstash -f $LS_CONF_DIR --path.logs $LS_LOG_DIR --path.data $LS_HOME --path.settings $LS_SETTINGS_DIR +StandardOutput=null +StandardError=journal +SuccessExitStatus=143 +LimitNOFILE=65535 +TimeoutStopSec=20 +LimitMEMLOCK=infinity + +[Install] +WantedBy=multi-user.target diff --git a/logstash@.service b/logstash@.service new file mode 100644 index 000000000000..082930e550f6 --- /dev/null +++ b/logstash@.service @@ -0,0 +1,7 @@ +.include /usr/lib/systemd/system/logstash.service + +[Unit] +Description=logstash (%I) + +[Service] +Environment=LOGSTASH_CONF=/etc/logstash/%I.conf |