comparison logstash.spec @ 3:796ac0b50dbf

add cron.daily index cleaning
author Carl Byington <carl@five-ten-sg.com>
date Thu, 07 Mar 2013 10:41:01 -0800
parents 9e0cdf091b8a
children 6b7beb807d14
comparison
equal deleted inserted replaced
2:9e0cdf091b8a 3:796ac0b50dbf
1 # prevent brp repack jar files 1 # prevent brp repack jar files
2 %define __os_install_post %{nil} 2 %define __os_install_post %{nil}
3 3
4 %define _bindir /usr/local/bin 4 %define _bindir /usr/local/bin
5 5
6 Summary: A tool for managing your logs 6 Summary: logstash is a tool for managing events and logs.
7 Name: logstash 7 Name: logstash
8 Version: 1.1.9 8 Version: 1.1.9
9 Release: 0 9 Release: 0
10 License: new BSD 10 License: Apache 2.0
11 Group: Applications/Productivity 11 Group: System Environment/Daemons
12 URL: http://logstash.net/ 12 URL: http://logstash.net/
13 BuildArch: noarch 13 BuildArch: noarch
14 Source0: https://logstash.objects.dreamhost.com/release/%{name}-%{version}-monolithic.jar 14 Source0: https://logstash.objects.dreamhost.com/release/%{name}-%{version}-monolithic.jar
15 #ource0: http://logstash.objects.dreamhost.com/release/%{name}-%{version}-flatjar.jar 15 #ource0: http://logstash.objects.dreamhost.com/release/%{name}-%{version}-flatjar.jar
16 Source1: logstash.rc 16 Source1: %{name}.rc
17 Source2: %{name}.conf 17 Source2: %{name}.conf
18 Source3: apache.pattern 18 Source3: apache.pattern
19 Source4: sendmail.pattern 19 Source4: sendmail.pattern
20 Requires: httpd java-1.7.0-openjdk 20 Source5: https://logstash.jira.com/secure/attachment/12610/logstash_index_cleaner.py
21 Source6: %{name}.cron
22 Requires: httpd java-1.7.0-openjdk python-pip python-argparse python-ordereddict
21 Requires(pre): /usr/sbin/useradd 23 Requires(pre): /usr/sbin/useradd
22 Requires(pre): /usr/bin/getent 24 Requires(pre): /usr/bin/getent
23 Requires(postun): /usr/sbin/userdel 25 Requires(postun): /usr/sbin/userdel
24 Requires(post,preun): /sbin/chkconfig 26 Requires(post,preun): /sbin/chkconfig
25 Requires(post,preun): /sbin/service 27 Requires(post,preun): /sbin/service
26 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) 28 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
27 29
28 30
29 %description 31 %description
30 logstash tool for managing your logs 32 logstash is a tool for managing events and logs. You can use it to
33 collect logs, parse them, and store them for later use (like, for
34 searching). Speaking of searching, logstash comes with a web interface
35 for searching and drilling into all of your logs.
31 36
32 37
33 %prep 38 %prep
34 cp -p %SOURCE0 . 39 true
35 cp -p %SOURCE1 .
36 cp -p %SOURCE2 .
37 cp -p %SOURCE3 .
38 cp -p %SOURCE4 .
39 40
40 41
41 %build 42 %build
43 true
42 44
43 45
44 %install 46 %install
45 rm -rf $RPM_BUILD_ROOT 47 rm -rf $RPM_BUILD_ROOT
46 mkdir -p $RPM_BUILD_ROOT/var/log/%{name} 48 mkdir -p $RPM_BUILD_ROOT/var/log/%{name}
47 install -D -m 640 apache.pattern $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/apache 49 install -D -m 750 %SOURCE0 $RPM_BUILD_ROOT/%{_bindir}/%{name}.jar
48 install -D -m 640 sendmail.pattern $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/sendmail 50 install -D -m 750 %SOURCE5 $RPM_BUILD_ROOT/%{_bindir}/logstash_index_cleaner.py
49 install -D -m 755 %{name}.rc $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} 51 install -D -m 755 %SOURCE1 $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
50 install -D -m 750 %{name}-%{version}-monolithic.jar $RPM_BUILD_ROOT/%{_bindir}/%{name}.jar 52 install -D -m 755 %SOURCE6 $RPM_BUILD_ROOT/etc/cron.daily/%{name}
51 #nstall -D -m 750 %{name}-%{version}-flatjar.jar $RPM_BUILD_ROOT/%{_bindir}/%{name}.jar 53 install -D -m 640 %SOURCE2 $RPM_BUILD_ROOT/etc/%{name}/%{name}.conf
52 install -D -m 640 %{name}.conf $RPM_BUILD_ROOT/etc/%{name}/%{name}.conf 54 install -D -m 640 %SOURCE3 $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/apache
55 install -D -m 640 %SOURCE4 $RPM_BUILD_ROOT/var/lib/%{name}/data/patterns/sendmail
53 56
54 57
55 %pre 58 %pre
56 /usr/bin/getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -d /var/lib/%{name} -M -c "%{name} pseudo-user" %{name} >/dev/null 59 /usr/bin/getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -d /var/lib/%{name} -M -c "%{name} pseudo-user" %{name} >/dev/null
60 pip-python install pyes || :
57 61
58 62
59 %post 63 %post
60 /sbin/chkconfig --add %{name} 64 /sbin/chkconfig --add %{name}
61 setfacl -m u:logstash:rx /var/log/httpd 65 setfacl -m u:logstash:rx /var/log/httpd
83 %defattr(-,root,root,-) 87 %defattr(-,root,root,-)
84 %attr(0750,%{name},root) %{_bindir}/* 88 %attr(0750,%{name},root) %{_bindir}/*
85 %config(noreplace) %attr(0750,%{name},root) /etc/%{name} 89 %config(noreplace) %attr(0750,%{name},root) /etc/%{name}
86 %config(noreplace) %attr(0640,%{name},root) /etc/%{name}/%{name}.conf 90 %config(noreplace) %attr(0640,%{name},root) /etc/%{name}/%{name}.conf
87 /etc/rc.d/init.d/%{name} 91 /etc/rc.d/init.d/%{name}
92 /etc/cron.daily/%{name}
88 %dir %attr(0750,%{name},root) /var/log/%{name} 93 %dir %attr(0750,%{name},root) /var/log/%{name}
89 %dir %attr(0750,%{name},root) /var/lib/%{name} 94 %dir %attr(0750,%{name},root) /var/lib/%{name}
90 %dir %attr(0750,%{name},root) /var/lib/%{name}/data 95 %dir %attr(0750,%{name},root) /var/lib/%{name}/data
91 %dir %attr(0750,%{name},root) /var/lib/%{name}/data/patterns 96 %dir %attr(0750,%{name},root) /var/lib/%{name}/data/patterns
92 %config(noreplace) %attr(0640,%{name},root) /var/lib/%{name}/data/patterns/sendmail 97 %config(noreplace) %attr(0640,%{name},root) /var/lib/%{name}/data/patterns/sendmail