mirror of
https://git.icinga.com/packaging/rpm-icinga2.git
synced 2025-09-25 19:09:35 +02:00
Merge pull request #2 from thardeck/opensuse-sles-changes
Fix issues and improve spec for SLE submit request
This commit is contained in:
commit
37104df3f5
207
icinga2.spec
207
icinga2.spec
@ -77,95 +77,95 @@
|
||||
|
||||
%define logmsg logger -t %{name}/rpm
|
||||
|
||||
Summary: Network monitoring application
|
||||
Name: icinga2
|
||||
Version: 2.8.1
|
||||
Release: %{revision}%{?dist}
|
||||
License: GPLv2+
|
||||
URL: https://www.icinga.com/
|
||||
Group: System/Monitoring
|
||||
Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
|
||||
Summary: Network monitoring application
|
||||
Name: icinga2
|
||||
Version: 2.8.1
|
||||
Release: %{revision}%{?dist}
|
||||
License: GPL-2.0+
|
||||
Url: https://www.icinga.com/
|
||||
Group: System/Monitoring
|
||||
Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Requires: %{name}-bin = %{version}-%{release}
|
||||
Requires: %{name}-bin = %{version}-%{release}
|
||||
|
||||
%description
|
||||
Meta package for Icinga 2 Core, DB IDO and Web.
|
||||
|
||||
%package bin
|
||||
Summary: Icinga 2 binaries and libraries
|
||||
Group: System/Monitoring
|
||||
Summary: Icinga 2 binaries and libraries
|
||||
Group: System/Monitoring
|
||||
|
||||
%if "%{_vendor}" == "suse"
|
||||
PreReq: permissions
|
||||
Provides: monitoring_daemon
|
||||
Recommends: monitoring-plugins
|
||||
PreReq: permissions
|
||||
Provides: monitoring_daemon
|
||||
Recommends: monitoring-plugins
|
||||
%if 0%{?suse_version} >= 1310
|
||||
BuildRequires: libyajl-devel
|
||||
BuildRequires: libyajl-devel
|
||||
%endif
|
||||
%endif
|
||||
BuildRequires: libedit-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: libedit-devel
|
||||
BuildRequires: ncurses-devel
|
||||
%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
|
||||
BuildRequires: gcc48-c++
|
||||
BuildRequires: libstdc++48-devel
|
||||
BuildRequires: libopenssl1-devel
|
||||
BuildRequires: gcc48-c++
|
||||
BuildRequires: libopenssl1-devel
|
||||
BuildRequires: libstdc++48-devel
|
||||
%else
|
||||
%if "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
|
||||
# Requires devtoolset-2 scl
|
||||
BuildRequires: devtoolset-2-gcc-c++
|
||||
BuildRequires: devtoolset-2-libstdc++-devel
|
||||
BuildRequires: devtoolset-2-binutils
|
||||
BuildRequires: devtoolset-2-binutils
|
||||
BuildRequires: devtoolset-2-gcc-c++
|
||||
BuildRequires: devtoolset-2-libstdc++-devel
|
||||
%define scl_enable scl enable devtoolset-2 --
|
||||
%else
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libstdc++-devel
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libstdc++-devel
|
||||
%endif
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: openssl-devel
|
||||
%endif
|
||||
BuildRequires: cmake
|
||||
BuildRequires: flex >= 2.5.35
|
||||
BuildRequires: bison
|
||||
BuildRequires: make
|
||||
BuildRequires: bison
|
||||
BuildRequires: cmake
|
||||
BuildRequires: flex >= 2.5.35
|
||||
BuildRequires: make
|
||||
|
||||
%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
|
||||
# el5 and el6 require packages.icinga.com
|
||||
BuildRequires: boost153-devel
|
||||
BuildRequires: boost153-devel
|
||||
%else
|
||||
%if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310
|
||||
# sles 11 sp3 requires packages.icinga.com
|
||||
BuildRequires: boost153-devel
|
||||
BuildRequires: boost153-devel
|
||||
%else
|
||||
%if "%{_vendor}" == "suse" && 0%{?suse_version} > 1320
|
||||
BuildRequires: libboost_thread-devel >= 1.48
|
||||
BuildRequires: libboost_program_options-devel >= 1.48
|
||||
BuildRequires: libboost_regex-devel >= 1.48
|
||||
BuildRequires: libboost_system-devel >= 1.48
|
||||
BuildRequires: libboost_program_options-devel >= 1.48
|
||||
BuildRequires: libboost_regex-devel >= 1.48
|
||||
BuildRequires: libboost_system-devel >= 1.48
|
||||
BuildRequires: libboost_thread-devel >= 1.48
|
||||
%else
|
||||
%if (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
|
||||
# Requires EPEL repository
|
||||
BuildRequires: boost148-devel >= 1.48
|
||||
BuildRequires: boost148-devel >= 1.48
|
||||
%else
|
||||
BuildRequires: boost-devel >= 1.48
|
||||
BuildRequires: boost-devel >= 1.48
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?use_systemd}
|
||||
BuildRequires: systemd-devel
|
||||
Requires: systemd
|
||||
BuildRequires: systemd-devel
|
||||
Requires: systemd
|
||||
%endif
|
||||
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
|
||||
%description bin
|
||||
Icinga 2 is a general-purpose network monitoring application.
|
||||
This subpackage provides the binaries for Icinga 2 Core.
|
||||
|
||||
%package common
|
||||
Summary: Common Icinga 2 configuration
|
||||
Group: System/Monitoring
|
||||
Summary: Common Icinga 2 configuration
|
||||
Group: System/Monitoring
|
||||
%if (0%{?amzn} || 0%{?fedora} || 0%{?rhel})
|
||||
Requires(pre): shadow-utils
|
||||
Requires(post): shadow-utils
|
||||
@ -195,36 +195,36 @@ among Icinga 2 related packages.
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for Icinga 2
|
||||
Group: Documentation/Other
|
||||
Summary: Documentation for Icinga 2
|
||||
Group: Documentation/Other
|
||||
|
||||
%description doc
|
||||
This subpackage provides documentation for Icinga 2.
|
||||
|
||||
|
||||
%package libs
|
||||
Summary: Libraries for Icinga 2
|
||||
Group: System/Libraries
|
||||
Requires: %{name}-common = %{version}-%{release}
|
||||
Summary: Libraries for Icinga 2
|
||||
Group: System/Libraries
|
||||
Requires: %{name}-common = %{version}-%{release}
|
||||
|
||||
%description libs
|
||||
This subpackage provides the internal libraries for the daemon.
|
||||
|
||||
|
||||
%package ido-mysql
|
||||
Summary: IDO MySQL database backend for Icinga 2
|
||||
Group: System/Monitoring
|
||||
Summary: IDO MySQL database backend for Icinga 2
|
||||
Group: System/Monitoring
|
||||
%if "%{_vendor}" == "suse"
|
||||
BuildRequires: libmysqlclient-devel
|
||||
BuildRequires: libmysqlclient-devel
|
||||
%if 0%{?suse_version} >= 1310
|
||||
BuildRequires: mysql-devel
|
||||
BuildRequires: mysql-devel
|
||||
%endif
|
||||
|
||||
%else
|
||||
BuildRequires: mysql-devel
|
||||
BuildRequires: mysql-devel
|
||||
%endif #suse
|
||||
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description ido-mysql
|
||||
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
|
||||
@ -232,14 +232,14 @@ IDOUtils schema >= 1.12
|
||||
|
||||
|
||||
%package ido-pgsql
|
||||
Summary: IDO PostgreSQL database backend for Icinga 2
|
||||
Group: System/Monitoring
|
||||
Summary: IDO PostgreSQL database backend for Icinga 2
|
||||
Group: System/Monitoring
|
||||
%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
|
||||
BuildRequires: postgresql-devel >= 8.4
|
||||
BuildRequires: postgresql-devel >= 8.4
|
||||
%else
|
||||
BuildRequires: postgresql-devel
|
||||
BuildRequires: postgresql-devel
|
||||
%endif
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description ido-pgsql
|
||||
Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
|
||||
@ -252,40 +252,45 @@ IDOUtils schema >= 1.12
|
||||
%package selinux
|
||||
Summary: SELinux policy module supporting icinga2
|
||||
Group: System/Base
|
||||
BuildRequires: checkpolicy, selinux-policy-devel, hardlink
|
||||
BuildRequires: checkpolicy
|
||||
BuildRequires: hardlink
|
||||
BuildRequires: selinux-policy-devel
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires(post): policycoreutils-python
|
||||
Requires(postun): policycoreutils-python
|
||||
|
||||
%description selinux
|
||||
SELinux policy module supporting icinga2
|
||||
SELinux policy module supporting icinga2.
|
||||
%endif
|
||||
|
||||
|
||||
%package -n vim-icinga2
|
||||
Summary: Vim syntax highlighting for icinga2
|
||||
Group: Productivity/Text/Editors
|
||||
Summary: Vim syntax highlighting for icinga2
|
||||
Group: Productivity/Text/Editors
|
||||
%if "%{_vendor}" == "suse"
|
||||
BuildRequires: vim
|
||||
Requires: vim
|
||||
BuildRequires: vim
|
||||
Requires: vim
|
||||
%else
|
||||
Requires: vim-filesystem
|
||||
Requires: vim-filesystem
|
||||
%endif
|
||||
|
||||
%description -n vim-icinga2
|
||||
Vim syntax highlighting for icinga2
|
||||
Provides Vim syntax highlighting for icinga2.
|
||||
|
||||
|
||||
%package -n nano-icinga2
|
||||
Summary: Nano syntax highlighting for icinga2
|
||||
Group: Productivity/Text/Editors
|
||||
Requires: nano
|
||||
Summary: Nano syntax highlighting for icinga2
|
||||
Group: Productivity/Text/Editors
|
||||
Requires: nano
|
||||
|
||||
%description -n nano-icinga2
|
||||
Nano syntax highlighting for icinga2
|
||||
Provides Nano syntax highlighting for icinga2.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
# use absolute shebang instead of env on SUSE distributions
|
||||
%if "%{_vendor}" == "suse"
|
||||
find . -type f -name '*.sh' -exec sed -i -e 's|\/usr\/bin\/env bash|\/bin\/bash|g' {} \;
|
||||
%endif
|
||||
|
||||
%build
|
||||
CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
@ -359,7 +364,7 @@ cd -
|
||||
|
||||
%install
|
||||
make install \
|
||||
DESTDIR="%{buildroot}"
|
||||
DESTDIR="%{buildroot}"
|
||||
|
||||
# install custom limits.conf for systemd
|
||||
%if 0%{?configure_systemd_limits}
|
||||
@ -377,9 +382,14 @@ rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
|
||||
%else
|
||||
ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}"
|
||||
%endif
|
||||
%if ( 0%{?sle_version} >= 150000 && 0%{?is_opensuse} ) || 0%{?suse_version} > 1500
|
||||
mkdir -p "%{buildroot}%{_fillupdir}/"
|
||||
mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_fillupdir}/sysconfig.%{name}"
|
||||
%else
|
||||
mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/"
|
||||
mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?use_selinux}
|
||||
cd tools/selinux
|
||||
@ -444,10 +454,10 @@ getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /s
|
||||
|
||||
if [ ${1:-0} -eq 1 ]
|
||||
then
|
||||
# initial installation, enable default features
|
||||
for feature in checker notification mainlog; do
|
||||
ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
|
||||
done
|
||||
# initial installation, enable default features
|
||||
for feature in checker notification mainlog; do
|
||||
ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -463,10 +473,10 @@ exit 0
|
||||
|
||||
if [ ${1:-0} -eq 1 ]
|
||||
then
|
||||
# initial installation, enable default features
|
||||
for feature in checker notification mainlog; do
|
||||
ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
|
||||
done
|
||||
# initial installation, enable default features
|
||||
for feature in checker notification mainlog; do
|
||||
ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -491,7 +501,7 @@ exit 0
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
%else
|
||||
if [ "$1" -ge "1" ]; then
|
||||
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
|
||||
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
@ -499,8 +509,8 @@ fi
|
||||
# suse / rhel
|
||||
|
||||
if [ "$1" = "0" ]; then
|
||||
# deinstallation of the package - remove enabled features
|
||||
rm -rf %{_sysconfdir}/%{name}/features-enabled
|
||||
# deinstallation of the package - remove enabled features
|
||||
rm -rf %{_sysconfdir}/%{name}/features-enabled
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -524,8 +534,8 @@ exit 0
|
||||
%systemd_preun %{name}.service
|
||||
%else
|
||||
if [ "$1" = "0" ]; then
|
||||
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
||||
/sbin/chkconfig --del %{name} || :
|
||||
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
||||
/sbin/chkconfig --del %{name} || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
@ -537,16 +547,16 @@ exit 0
|
||||
%post ido-mysql
|
||||
if [ ${1:-0} -eq 1 ]
|
||||
then
|
||||
# initial installation, enable ido-mysql feature
|
||||
ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
||||
# initial installation, enable ido-mysql feature
|
||||
ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
%postun ido-mysql
|
||||
if [ "$1" = "0" ]; then
|
||||
# deinstallation of the package - remove feature
|
||||
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
||||
# deinstallation of the package - remove feature
|
||||
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -554,16 +564,16 @@ exit 0
|
||||
%post ido-pgsql
|
||||
if [ ${1:-0} -eq 1 ]
|
||||
then
|
||||
# initial installation, enable ido-pgsql feature
|
||||
ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
||||
# initial installation, enable ido-pgsql feature
|
||||
ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
%postun ido-pgsql
|
||||
if [ "$1" = "0" ]; then
|
||||
# deinstallation of the package - remove feature
|
||||
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
||||
# deinstallation of the package - remove feature
|
||||
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -631,7 +641,11 @@ fi
|
||||
%endif
|
||||
%if "%{_vendor}" == "suse"
|
||||
%{_sbindir}/rc%{name}
|
||||
%if ( 0%{?sle_version} >= 150000 && 0%{?is_opensuse} ) || 0%{?suse_version} > 1500
|
||||
%{_fillupdir}/sysconfig.%{name}
|
||||
%else
|
||||
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
|
||||
%endif
|
||||
%else
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
||||
%endif
|
||||
@ -659,13 +673,12 @@ fi
|
||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
|
||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
|
||||
%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
|
||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
|
||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %dir %{_rundir}/%{name}
|
||||
%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
|
||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
|
||||
%attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
|
||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
|
||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
|
||||
%{_datadir}/%{name}/include
|
||||
%attr(0750,%{icinga_user},%{icinga_group}) %{_datadir}/%{name}/include
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root,-)
|
||||
|
Loading…
x
Reference in New Issue
Block a user