view 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
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
URL:            http://kibana.org/
BuildArch:      noarch
#Source0:        https://codeload.github.com/rashidkpc/Kibana/tar.gz/v%{version} >%{name}-%{version}.tar.gz
#Source0:        %{name}-%{version}.tar.gz
Source0:        https://nodeload.github.com/rashidkpc/Kibana/archive/%{commit}/%{name}-%{version}-%{shortcommit}.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

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


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


%build
if [ "$(which jruby)" == '' ]; then
    JRUBY_CMD="java -jar /usr/share/jruby.jar"
else
    JRUBY_CMD="jruby"
fi
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


%install
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}


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


%post
/sbin/chkconfig --add %{name}


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


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


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%attr(0750,%{name2},root) %{_javadir}/*
%dir %attr(0750,%{name2},root) /var/log/%{name}
/etc/rc.d/init.d/%{name}



%changelog
* Fri Apr 25 2013  <carl@five-ten-sg.com> - 0.2.0-0
- Initial build.