view Kibana.spec @ 25:d058481276aa

replace logstash embedded web server with kibana
author Carl Byington <>
date Mon, 29 Apr 2013 13:38:05 -0700
children 610835fb4209
line wrap: on
line source

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

%global commit df8ae2344433e5072a8dfe77082acfd1c9b6ed62
%global shortcommit %(c=%{commit}; echo ${c:0:8})
%global name2 kibana

Name:           Kibana
Version:        0.2.0
Release:        0%{?dist}
Summary:        Kibana is a user friendly way to view, search and visualize your log data

Group:          System Environment/Daemons
License:        MIT
BuildArch:      noarch
#Source0:{version} >%{name}-%{version}.tar.gz
#Source0:        %{name}-%{version}.tar.gz
Source10:       %{name}.rc
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Autoreq:        0

BuildRequires:  jruby java-devel

Requires:       jruby java-devel elasticsearch logstash
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

Kibana is a highly scalable interface for Logstash and ElasticSearch
that allows you to efficiently search, graph, analyze and otherwise
make sense of a mountain of logs.

%setup -qn %{name}-%{commit}
#%setup -q

if [ "$(which jruby)" == '' ]; then
    JRUBY_CMD="java -jar /usr/share/jruby.jar"
export GEM_HOME=$(pwd)
export GEM_PATH=
$JRUBY_CMD -S gem install bundler
$JRUBY_CMD bin/bundle install
rm -rf gems/*/test
rm -rf gems/*/spec
rm -rf gems/*/examples
rm -rf sample spec

rm -rf                          $RPM_BUILD_ROOT
install -d                      $RPM_BUILD_ROOT/var/log/%{name}
install -d                      $RPM_BUILD_ROOT/%{_javadir}/%{name}
cp -a *                         $RPM_BUILD_ROOT/%{_javadir}/%{name}
install -D -m 755 %SOURCE10     $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}

/usr/bin/getent passwd %{name2} >/dev/null || /usr/sbin/useradd -r -c "%{name} pseudo-user" %{name2} >/dev/null

/sbin/chkconfig --add %{name}

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

[ $1 = 0 ] && userdel %{name2} || :


%attr(0750,%{name2},root) %{_javadir}/*
%dir %attr(0750,%{name2},root) /var/log/%{name}

* Fri Apr 25 2013  <> - 0.2.0-0
- Initial build.