2 # - run as dedicated user
3 Summary: A syslog implementation that stores logs in MongoDB
9 URL: http://www.graylog2.org/
10 Source0: https://github.com/downloads/Graylog2/graylog2-server/%{name}-%{version}.tar.gz
11 # Source0-md5: 499ae16dcae71eeb7c3a30c75ea7a1a6
13 BuildRequires: jpackage-utils
14 BuildRequires: rpm-javaprov
15 BuildRequires: rpmbuild(macros) >= 1.300
16 Requires: jpackage-utils
18 Requires(post): /sbin/chkconfig
19 Requires(preun): /sbin/chkconfig
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Graylog2 is an open source syslog implementation that stores logs in
26 MongoDB. It consists of a server written in Java that accepts syslog
27 messages via TCP or UDP and stores them in the database.
33 rm -rf $RPM_BUILD_ROOT
34 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_javadir},%{_initrddir}}
35 # Install the application
36 cp -p %{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
37 ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
39 # Install the config file
40 cp -p graylog2.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/graylog2.conf
42 # Install the init script
43 install -d $RPM_BUILD_ROOT
44 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}
46 # Create the log directory
47 install -d $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
50 rm -rf $RPM_BUILD_ROOT
53 /sbin/chkconfig --add %{name}
54 %service %{name} restart
59 /sbin/chkconfig --del %{name}
63 %defattr(644,root,root,755)
64 %doc README graylog2.conf.example build_date
65 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/graylog2.conf
66 %attr(754,root,root) /etc/rc.d/init.d/graylog2-server
67 %{_javadir}/graylog2-server*.jar
68 %dir %{_localstatedir}/log/%{name}