view logstash.spec @ 29:b37cde5bac95

switch kibana to ruby gem rather than jruby
author Carl Byington <carl@five-ten-sg.com>
date Tue, 07 May 2013 11:03:17 -0700
parents 01ebc38d772e
children f2691b83bafa
line wrap: on
line source

# prevent brp repack jar files
%define __os_install_post %{nil}

Summary:        logstash is a tool for managing events and logs.
Name:           logstash
Version:        1.1.10
Release:        0%{?dist}

Group:          System Environment/Daemons
License:        Apache 2.0
URL:            http://logstash.net/
BuildArch:      noarch
#Source0:         curl https://nodeload.github.com/logstash/logstash/tar.gz/v%{version} >%{name}-%{version}.tar.gz
Source0:        %{name}-%{version}.tar.gz
Source1:        https://logstash.jira.com/secure/attachment/12610/logstash_index_cleaner.py
Source2:        http://logstash.objects.dreamhost.com/maxmind/GeoLite-City-2013-01-18.dat.gz
Source4:        %{name}.Makefile
Source5:        %{name}.manifest
Source10:       %{name}.rc
Source11:       %{name}.cron
Source12:       %{name}.conf
Source13:       %{name}.sysconfig
Source20:       apache.pattern
Source21:       sendmail.pattern
Source22:       dnsbl.pattern
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires:  ragel jruby java-devel

Requires:       logrotate httpd java-devel python-pip python-argparse python-ordereddict
Requires:       jruby elasticsearch GraphTastic-client
Requires(pre):          /usr/sbin/useradd
Requires(pre):          /usr/bin/getent
Requires(postun):       /usr/sbin/userdel
Requires(post,preun):   /sbin/chkconfig
Requires(post,preun):   /sbin/service


%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.


%prep
%setup -q
sed -i -e 's,jarpath =.*,jarpath = "%{_javadir}/elasticsearch/*.jar",g' lib/logstash/outputs/elasticsearch.rb
sed -i -e 's,jarpath =.*,jarpath = "%{_javadir}/elasticsearch/*.jar",g' lib/logstash/outputs/elasticsearch_river.rb


%build
cp %SOURCE5 .
gunzip -c %SOURCE2 >GeoLiteCity.dat
make -f %SOURCE4


%install
rm -rf                                $RPM_BUILD_ROOT
install -d                            $RPM_BUILD_ROOT/var/log/%{name}
install -D -m 750 build/logstash.jar  $RPM_BUILD_ROOT/%{_javadir}/%{name}.jar
install -D -m 750 %SOURCE1            $RPM_BUILD_ROOT/%{_javadir}/logstash_index_cleaner.py
install -D -m 755 %SOURCE10           $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
install -D -m 755 %SOURCE11           $RPM_BUILD_ROOT/etc/cron.daily/%{name}
install -D -m 640 %SOURCE12           $RPM_BUILD_ROOT/etc/%{name}/%{name}.conf
install -D -m 640 %SOURCE13           $RPM_BUILD_ROOT/etc/sysconfig/%{name}
install -D -m 640 %SOURCE20           $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/apache
install -D -m 640 %SOURCE21           $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/sendmail
install -D -m 640 %SOURCE22           $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/dnsbl


%pre
/usr/bin/getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -d /var/lib/%{name} -M -c "%{name} pseudo-user" %{name} >/dev/null
pip-python install pyes || :


%post
/sbin/chkconfig --add %{name}
setfacl -m u:logstash:rx /var/log/httpd
setfacl -m u:logstash:r  /var/log/messages
setfacl -m u:logstash:r  /var/log/maillog


%preun
[ $1 = 0 ] && /sbin/service %{name} stop    || :
[ $1 = 0 ] && /sbin/chkconfig --del %{name} || :


%postun
[ $1 = 0 ] && setfacl -x u:logstash /var/log/httpd    || :
[ $1 = 0 ] && setfacl -x u:logstash /var/log/messages || :
[ $1 = 0 ] && setfacl -x u:logstash /var/log/maillog  || :
[ $1 = 0 ] && userdel %{name} || :


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%attr(0750,%{name},root) %{_javadir}/*
%dir %attr(0750,%{name},root) /etc/%{name}
%config(noreplace) %attr(0640,%{name},root) /etc/%{name}/%{name}.conf
%config(noreplace) %attr(0640,%{name},root) /etc/sysconfig/%{name}
/etc/rc.d/init.d/%{name}
/etc/cron.daily/%{name}
%dir %attr(0750,%{name},root) /var/log/%{name}
%dir %attr(0750,%{name},root) /var/lib/%{name}
%dir %attr(0750,%{name},root) /var/lib/%{name}/data
%dir %attr(0750,%{name},root) /var/lib/%{name}/data/patterns
%config(noreplace) %attr(0640,%{name},root) /var/lib/%{name}/data/patterns/sendmail
%config(noreplace) %attr(0640,%{name},root) /var/lib/%{name}/data/patterns/apache
%config(noreplace) %attr(0640,%{name},root) /var/lib/%{name}/data/patterns/dnsbl


%changelog
* Wed Apr 17 2013  <carl@five-ten-sg.com> - 1.1.10-0
- update to newer logstash

* Fri Mar 22 2013  <carl@five-ten-sg.com> - 1.1.9-0
- Initial build.