Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
security:logging
logstash
logstash.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File logstash.spec of Package logstash
# # spec file for package logstash # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 Klaus Kämpf <kkaempf@suse.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define _binaries_in_noarch_packages_terminate_build 0 %global _binaries_in_noarch_packages_terminate_build 0 %global jruby_version 9.2.12.0 %global jruby_api_version 2.5.0 Name: logstash Version: 7.8.0 Release: 0 Summary: A tool for managing events and logs License: Apache-2.0, MIT, LGPL-2.1, BSD, BSD-3-clause, Ruby Group: System/Monitoring Url: https://github.com/elastic/logstash Source: %{name}-%{version}.tar.gz Source1: logstash.service Source2: logstash.logrotate Source4: logstash.init Source5: logstash.conf Source6: logstash-rpmlintrc # Local maven repo Patch1: 0001-maven-local.patch # Use installed JRuby Patch2: 0002-Use-installed-jruby.patch # Use installed gradle Patch3: 0003-Use-installed-gradle.patch # Run bundler in offline mode Patch4: 0004-run-bundler-with-local-for-offline-mode.patch # Don't reference rubygems.org in Gemfile Patch5: 0005-drop-rubygems.org-reference.patch # Use startup.options for /etc/sysconfig, set log and data in logstash.yml Patch6: 0006-Fix-default-configs.patch # Fix6failure if bin/logstash symlink is relative Patch7: 0007-logstash-symlink-might-be-relative.patch # Don't download elasticsearch Patch8: 0008-drop-ES-download.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: java-headless = 1.8.0 Requires: jruby = %{jruby_version} Requires: logrotate # to find java Requires: which Requires(pre): pwdutils BuildRequires: %{name}-kit = %{version} BuildRequires: ca-certificates-mozilla BuildRequires: fdupes BuildRequires: gradle # Can't run with Java 11: https://discuss.elastic.co/t/unsupported-platform-x86-64-linux/121234 BuildRequires: java-devel BuildRequires: jruby = %{jruby_version} BuildRequires: strace # needed for brp-check-bytecode-version (jar, fastjar would do as well) BuildRequires: unzip %if 0%{?suse_version} >= 1210 BuildRequires: systemd-rpm-macros %{?systemd_requires} %bcond_without systemd %else %bcond_with systemd %endif %description logstash is a tool for managing events and logs. You can use it to collect logs, parse them, and store them for later use (like, for searching). %prep %setup -q -n %{name}-%{version} #%%patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 rm -rf /tmp/gradle* /tmp/apache* # Disable JRuby download mkdir -p vendor/jruby/%{jruby_api_version} # vendor/bundle cp -RLf %{_datadir}/tetra/kit/bundle vendor # gradle cache cp -a %{_datadir}/tetra/gradle* /tmp # use builtin stdlib mkdir -p /tmp/lib/ruby ln -sf /usr/share/jruby/lib/ruby/stdlib /tmp/lib/ruby # disable gradle download rm ./gradle/wrapper/gradle-wrapper.properties # local gems rm -rf ~/.gem ln -s `pwd`/vendor/bundle ~/.gem %build # logstash-core/src/main/java/org/logstash/common/io/RecordIOWriter.java has a utf-8 dash export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 # JARS_SKIP=true: see https://github.com/elastic/logstash/issues/5072 export GRADLE_USER_HOME=/tmp/gradle # OSS components only export OSS=true # build release, not snapshot export RELEASE=1 JARS_SKIP=true DEBUG=1 jrake plugin:install-default gradle \ --gradle-user-home $GRADLE_USER_HOME \ --project-cache-dir /tmp/gradle-cache \ -Dcustom.jruby.path=/usr/share/jruby \ --offline \ --no-daemon \ assemble chmod 644 logstash-core/lib/jars/*.jar %install export NO_BRP_CHECK_BYTECODE_VERSION=true export CLASSPATH=%{_javadir} ## usr %{__install} -d -m 755 %{buildroot}/%{_sbindir} ## etc %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/conf.d/ %{__install} -m 644 config/jvm.options %{buildroot}%{_sysconfdir}/%{name} %{__install} -m 644 config/log4j2.properties %{buildroot}%{_sysconfdir}/%{name} %{__install} -m 644 config/logstash.yml %{buildroot}%{_sysconfdir}/%{name} %{__install} -m 644 config/startup.options %{buildroot}%{_sysconfdir}/%{name} %{__install} -D -m 644 %{S:5} %{buildroot}%{_sysconfdir}/%{name}/sample.conf %{__install} -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %define logstashdir %{_datadir}/%{name} ## /usr/share %{__install} -d -m 755 %{buildroot}%{logstashdir} ln -s %{_sysconfdir}/%{name} %{buildroot}%{logstashdir}/config %{__install} -m 644 Gemfile* %{buildroot}%{logstashdir} %{__install} -d -m 755 %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/cpdump %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/logstash %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/ruby %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/logstash.lib.sh %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/logstash-plugin %{buildroot}%{logstashdir}/bin %{__install} -m 755 bin/system-install %{buildroot}%{logstashdir}/bin cp -a lib %{buildroot}%{logstashdir} cp -a modules %{buildroot}%{logstashdir} cp -a logstash-core-plugin-api %{buildroot}%{logstashdir} # logstash-core %{__install} -d -m 755 %{buildroot}%{logstashdir}/logstash-core %{__install} -m 644 logstash-core/*gem* %{buildroot}%{logstashdir}/logstash-core # this is coming from jruby.rpm rm logstash-core/lib/jars/jruby*.jar cp -a logstash-core/lib %{buildroot}%{logstashdir}/logstash-core ln -s /usr/share/jruby/lib/jruby.jar %{buildroot}%{logstashdir}/logstash-core/lib/jars/ cp -a logstash-core/locales %{buildroot}%{logstashdir}/logstash-core # vendor %{__install} -d -m 755 %{buildroot}%{logstashdir}/vendor # drop /usr/bin/ruby autorequires rm -rf vendor/bundle/jruby/%{jruby_api_version}/gems/xmpp4r-0.5/test rm -rf vendor/bundle/jruby/%{jruby_api_version}/gems/xmpp4r-0.5/data rm -rf vendor/bundle/jruby/%{jruby_api_version}/build_info rm -rf vendor/bundle/jruby/%{jruby_api_version}/cache rm -rf vendor/bundle/jruby/%{jruby_api_version}/doc rm -rf vendor/bundle/jruby/%{jruby_api_version}/extensions rm -rf vendor/bundle/jruby/%{jruby_api_version}/gems/cache find vendor/bundle/jruby/%{jruby_api_version} -name \.autotest | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.document | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.git\* | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.rspec | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.travis | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.\*yml | xargs rm -rf find vendor/bundle/jruby/%{jruby_api_version} -name \.yardopts | xargs rm -rf cp -a vendor/bundle %{buildroot}%{logstashdir}/vendor ## var %{__install} -d -m 755 %{buildroot}/var/log/%{name}/ %{__install} -d -m 755 %{buildroot}/var/lib/%{name}/ %{__install} -d -m 755 %{buildroot}/var/lib/%{name}/queue ln -sf /var/lib/%{name} %{buildroot}%{logstashdir}/data ## service (systemd or sysVinit) %if %{with systemd} %{__mkdir} -p %{buildroot}%{_unitdir} %{__install} -m 444 %{S:1} %{buildroot}%{_unitdir}/%{name}.service ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name} %else %{__install} -D -m 755 %{S:4} %{buildroot}%{_initrddir}/%{name} %{__mkdir} -p %{buildroot}%{_sbindir} ln -sf %{_initrddir}/%{name} %{buildroot}%{_sbindir}/rc%{name} %endif # /usr/bin symlinks %{__mkdir} -p %{buildroot}%{_bindir} ln -sf %{logstashdir}/bin/logstash %{buildroot}%{_bindir} ln -sf %{logstashdir}/bin/logstash-plugin %{buildroot}%{_bindir} ## delete zero files from logstash find %{buildroot} -size 0 -delete ## finds duplicate files in a given set of directories %fdupes $RPM_BUILD_ROOT %pre ## Register service systemd %if %{with systemd} %service_add_pre %{name}.service %endif ## create logstash group and user getent group logstash >/dev/null || groupadd -r logstash getent passwd logstash >/dev/null || useradd -r -g logstash -d /var/lib/%{name} -s /sbin/nologin -c "service user for logstash" logstash exit 0 %post ## Register service systemd %if %{with systemd} %service_add_post %{name}.service %endif cat <<EOF ================================================================================ Please create logstash pipeline config files in: /etc/logstash/conf.d/ Here is a sample pipeline config file: /etc/logstash/sample.conf Maybe you also have to adjust: /etc/sysconfig/logstash ================================================================================ EOF %preun ## Stop service (systemd or sysVinit) %if %{with systemd} %service_del_preun %{name}.service %else %stop_on_removal %endif %postun ## no auto restart on update export DISABLE_RESTART_ON_UPDATE=1 ## Unregister service (systemd or sysVinit) %if %{with systemd} %service_del_postun %{name}.service %else %insserv_cleanup %endif # only execute in case of package removal, not on upgrade if [ $1 -eq 0 ] ; then getent passwd logstash > /dev/null if [ "$?" == "0" ] ; then userdel logstash fi getent group logstash >/dev/null if [ "$?" == "0" ] ; then groupdel logstash fi fi %files %defattr(-,root,root) %doc CONTRIBUTORS README.md ROADMAP.md %license COPYING.csv LICENSE.txt %if %{with systemd} %{_unitdir}/%{name}.service %else %{_initrddir}/%{name} %endif %{_sbindir}/rc%{name} %{_bindir}/* %dir %{logstashdir} %{logstashdir}/* %dir %{_sysconfdir}/%{name}/ %dir %{_sysconfdir}/%{name}/conf.d %doc %{_sysconfdir}/%{name}/sample.conf %config(noreplace) %{_sysconfdir}/%{name}/startup.options %config(noreplace) %{_sysconfdir}/%{name}/%{name}.yml %config(noreplace) %{_sysconfdir}/%{name}/jvm.options %config(noreplace) %{_sysconfdir}/%{name}/log4j2.properties %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %defattr(-,logstash,logstash) %dir /var/log/%{name} %dir /var/lib/%{name} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor