File logstash.spec of Package logstash

#
# spec file for package logstash
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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
%define real_name 	logstash
%define version		1.5.0
%define prefix		/%{real_name}/%{version}
%define logstash_home /var/run/logstash
%if 0%{?suse_version}
%define ls_sysconfdir %{_localstatedir}/adm/fillup-templates/sysconfig.
%else
%define ls_sysconfdir %{_sysconfdir}/sysconfig/
%endif


Name:           %{real_name}
Summary:        logstash is a tool for managing events and logs 1.5.0
Version:        %{version}
Release:        1
AutoReqProv:    on
License:        BSD
Group:          System Environment/Daemons
URL:            http://logstash.net/
Source:         https://download.elasticsearch.org/logstash/logstash/%{real_name}-%{version}.tar.gz
Source1:	%{real_name}-rpmlintrc
Source2:        logstash.logrotate
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

# needed for brp-check-bytecode-version (jar, fastjar would do as well)
BuildRequires:	unzip

%if 0%{?suse_version} >= 1100
BuildRequires:  -post-build-checks
%endif

Requires:       logrotate

%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). Speaking of searching, logstash comes with a web interface for searching and drilling into all of your logs.

It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.

%prep
%setup -q -n %{real_name}-%{version}


%build


%install
# suppress bytecode version error
%if 0%{?suse_version} >= 1100
export NO_BRP_CHECK_BYTECODE_VERSION=true
%endif

%{__mkdir_p} %{buildroot}%{prefix}
%{__cp} -a bin lib vendor %{buildroot}%{prefix}/
find %{buildroot}%{prefix} -name ".keep" -o -name "*.gemtest" -o -name ".gitignore" |xargs -i rm -f {}


%{__install} -Dm 644 %{SOURCE2}  %{buildroot}%{_sysconfdir}/logrotate.d/%name

%post
cd %{prefix}/..
%{__rm} -fv 1.4.latest
%{__ln_s} -f %{version} 1.4.latest


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root)
%doc LICENSE
%dir %{prefix}
%{prefix}
%config(noreplace) %{_sysconfdir}/logrotate.d/%name


%changelog
* Thr May 21 2015 Markus Ballmann <extern.markus.ballmann@porscheinformatik.at>
- added logrotate file
* Tue Mar 31 2015 Florian Asche <florian.asche@bertelsmann.de>
- inital version