icinga2/icinga2.spec.in

145 lines
3.7 KiB
Plaintext
Raw Normal View History

%define revision 1
%define opensuse_boost_version 1_49_0
%define logmsg logger -t %{name}/rpm
2012-05-26 14:42:03 +02:00
Summary: network monitoring application
Name: @PACKAGE@
Version: @VERSION@
Release: %{revision}%{?dist}
License: GPLv2+
2012-05-26 23:12:46 +02:00
Group: Applications/System
2012-05-27 16:21:50 +02:00
Source: %{name}-%{version}.tar.gz
2012-05-26 14:42:03 +02:00
URL: http://www.icinga.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
2013-08-16 16:17:14 +02:00
BuildRequires: doxygen
2012-05-26 14:42:03 +02:00
BuildRequires: openssl-devel
BuildRequires: gcc-c++
2013-08-16 16:17:14 +02:00
BuildRequires: libstdc++-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: flex
BuildRequires: bison
2013-08-27 19:36:03 +02:00
# TODO: figure out how to handle boost on el5
%if "%{_vendor}" == "redhat"
BuildRequires: boost >= 1.41
BuildRequires: boost-devel >= 1.41
BuildRequires: boost-test >= 1.41
Requires: boost >= 1.41
%endif
%if "%{_vendor}" == "suse"
BuildRequires: boost-devel >= 1.41
Requires: libboost_program_options%{opensuse_boost_version}
Requires: libboost_signals%{opensuse_boost_version}
Requires: libboost_system%{opensuse_boost_version}
Requires: libboost_test%{opensuse_boost_version}
Requires: libboost_thread%{opensuse_boost_version}
%endif
2012-05-26 14:42:03 +02:00
%description
2012-05-27 16:21:50 +02:00
Icinga is a general-purpose network monitoring application.
2012-05-26 14:42:03 +02:00
%package ido-mysql
Summary: ido mysql database backend for Icinga 2
Group: Applications/System
%if "%{_vendor}" == "suse"
BuildRequires: libmysqlclient-devel
Requires: libmysqlclient18
%endif
%if "%{_vendor}" == "redhat"
BuildRequires: mysql-devel
Requires: mysql
%endif
%description ido-mysql
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
IDOUtils schema >= 1.10
2012-05-26 14:42:03 +02:00
%prep
2012-05-27 16:21:50 +02:00
%setup -q -n %{name}-%{version}
2012-05-26 14:42:03 +02:00
%build
%configure --with-icinga-user=$USER \
--with-icinga-group=$USER \
--with-icingacmd-user=$USER \
--with-icingacmd-group=$USER
2012-05-27 16:21:50 +02:00
make %{?_smp_mflags}
2012-05-26 14:42:03 +02:00
%install
2012-05-27 16:21:50 +02:00
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
make install \
DESTDIR="%{buildroot}" \
INSTALL_OPTS="" \
COMMAND_OPTS=""
%pre
%{_sbindir}/groupadd icinga 2> /dev/null || :
%{_sbindir}/groupadd icingacmd 2> /dev/null || :
%{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G icingacmd -g icinga icinga 2> /dev/null || :
%post
/sbin/chkconfig --add %{name}
/sbin/service %{name} start &>/dev/null || :
2012-05-26 14:42:03 +02:00
%preun
if [ $1 -eq 0 ]; then
/sbin/service %{name} stop &>/dev/null || :
/sbin/chkconfig --del %{name}
fi
%postun
2012-05-26 14:42:03 +02:00
%clean
2012-05-27 16:21:50 +02:00
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
2012-05-26 14:42:03 +02:00
%files
%defattr(-,root,root)
2013-08-16 16:58:31 +02:00
%doc README AUTHORS ChangeLog COPYING COPYING.Exceptions
%{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/conf.d/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/features-available/*.conf
%attr(755,-,-) %{_sysconfdir}/init.d/%{name}
2013-08-16 14:52:34 +02:00
%{_bindir}/%{name}
%{_sbindir}/i2enfeature
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
%{_libdir}/%{name}
%{_datadir}/doc/%{name}
%{_datadir}/%{name}
%{_datadir}/%{name}/itl
%{_mandir}/man8/%{name}.8.gz
2013-08-16 16:58:31 +02:00
%{_localstatedir}/cache/%{name}
%{_localstatedir}/log/%{name}
%{_localstatedir}/run/%{name}
%{_localstatedir}/lib/%{name}
%{_localstatedir}/spool/%{name}
%{_localstatedir}/spool/%{name}/perfdata
%attr(2755,icinga,icingacmd) %{_localstatedir}/run/icinga2/cmd
%files ido-mysql
%{_libdir}/%{name}/libdb_ido_mysql*
%changelog
* Tue Oct 01 2013 Michael Friedrich <michael.friedrich@netways.de> - 0.0.3-1
- revamp package
* Sat May 04 2013 Michael Friedrich <michael.friedrich@netways.de> - 0.0.2-1
- new initscript in initdir
- itl is installed into datadir
- man pages in mandir
- use name macro to avoid typos
* Fri Nov 19 2012 Gunnar Beutner <gunnar.beutner@netways.de> - 0.0.1-1
- initial version