comparison Kibana.spec @ 25:d058481276aa

replace logstash embedded web server with kibana
author Carl Byington <carl@five-ten-sg.com>
date Mon, 29 Apr 2013 13:38:05 -0700
parents
children 610835fb4209
comparison
equal deleted inserted replaced
24:0f249d38da21 25:d058481276aa
1 # prevent brp repack jar files
2 %define __os_install_post %{nil}
3
4 %global commit df8ae2344433e5072a8dfe77082acfd1c9b6ed62
5 %global shortcommit %(c=%{commit}; echo ${c:0:8})
6 %global name2 kibana
7
8 Name: Kibana
9 Version: 0.2.0
10 Release: 0%{?dist}
11 Summary: Kibana is a user friendly way to view, search and visualize your log data
12
13 Group: System Environment/Daemons
14 License: MIT
15 URL: http://kibana.org/
16 BuildArch: noarch
17 #Source0: https://codeload.github.com/rashidkpc/Kibana/tar.gz/v%{version} >%{name}-%{version}.tar.gz
18 #Source0: %{name}-%{version}.tar.gz
19 Source0: https://nodeload.github.com/rashidkpc/Kibana/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
20 Source10: %{name}.rc
21 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
22 Autoreq: 0
23
24 BuildRequires: jruby java-devel
25
26 Requires: jruby java-devel elasticsearch logstash
27 Requires(pre): /usr/sbin/useradd
28 Requires(pre): /usr/bin/getent
29 Requires(postun): /usr/sbin/userdel
30 Requires(post,preun): /sbin/chkconfig
31 Requires(post,preun): /sbin/service
32
33 %description
34 Kibana is a highly scalable interface for Logstash and ElasticSearch
35 that allows you to efficiently search, graph, analyze and otherwise
36 make sense of a mountain of logs.
37
38
39 %prep
40 %setup -qn %{name}-%{commit}
41 #%setup -q
42
43
44 %build
45 if [ "$(which jruby)" == '' ]; then
46 JRUBY_CMD="java -jar /usr/share/jruby.jar"
47 else
48 JRUBY_CMD="jruby"
49 fi
50 export GEM_HOME=$(pwd)
51 export GEM_PATH=
52 $JRUBY_CMD -S gem install bundler
53 $JRUBY_CMD bin/bundle install
54 rm -rf gems/*/test
55 rm -rf gems/*/spec
56 rm -rf gems/*/examples
57 rm -rf sample spec
58
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT/var/log/%{name}
63 install -d $RPM_BUILD_ROOT/%{_javadir}/%{name}
64 cp -a * $RPM_BUILD_ROOT/%{_javadir}/%{name}
65 install -D -m 755 %SOURCE10 $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
66
67
68 %pre
69 /usr/bin/getent passwd %{name2} >/dev/null || /usr/sbin/useradd -r -c "%{name} pseudo-user" %{name2} >/dev/null
70
71
72 %post
73 /sbin/chkconfig --add %{name}
74
75
76 %preun
77 [ $1 = 0 ] && /sbin/service %{name} stop || :
78 [ $1 = 0 ] && /sbin/chkconfig --del %{name} || :
79
80
81 %postun
82 [ $1 = 0 ] && userdel %{name2} || :
83
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88
89 %files
90 %defattr(-,root,root,-)
91 %attr(0750,%{name2},root) %{_javadir}/*
92 %dir %attr(0750,%{name2},root) /var/log/%{name}
93 /etc/rc.d/init.d/%{name}
94
95
96
97 %changelog
98 * Fri Apr 25 2013 <carl@five-ten-sg.com> - 0.2.0-0
99 - Initial build.
100