]> granicus.if.org Git - icinga2/blobdiff - icinga2.spec
Docs: Add a note for upgrading with removed classicui-config package
[icinga2] / icinga2.spec
index 858b2aff1be51686895787b44bf48c754f1b785b..4eaa3e72c083b683145b9a1f89ac79263aab91c8 100644 (file)
@@ -1,6 +1,6 @@
 #/******************************************************************************
 # * Icinga 2                                                                   *
-# * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)  *
+# * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)  *
 # *                                                                            *
 # * This program is free software; you can redistribute it and/or              *
 # * modify it under the terms of the GNU General Public License                *
 %endif
 
 %define _libexecdir %{_prefix}/lib/
+%define plugindir %{_libdir}/nagios/plugins
 
 %if "%{_vendor}" == "redhat"
 %define apachename httpd
 %define apacheconfdir %{_sysconfdir}/httpd/conf.d
 %define apacheuser apache
 %define apachegroup apache
-%if 0%{?el5}%{?el6}
+%if 0%{?el5}%{?el6}%{?amzn}
 %define use_systemd 0
 %if %(uname -m) != "x86_64"
 %define march_flag -march=i686
@@ -43,6 +44,7 @@
 %endif
 
 %if "%{_vendor}" == "suse"
+%define plugindir %{_prefix}/lib/nagios/plugins
 %define apachename apache2
 %define apacheconfdir  %{_sysconfdir}/apache2/conf.d
 %define apacheuser wwwrun
 %define icingaweb2name icingaweb2
 %define icingaweb2version 2.0.0
 
-%define icingaclassicconfdir %{_sysconfdir}/icinga
-
 %define logmsg logger -t %{name}/rpm
 
 Summary: Network monitoring application
 Name: icinga2
-Version: 2.4.7
+Version: 2.7.1
 Release: %{revision}%{?dist}
 License: GPL-2.0+
 Group: Applications/System
 Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
-URL: https://www.icinga.org/
+URL: https://www.icinga.com/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires: %{name}-bin = %{version}-%{release}
 
@@ -94,11 +94,19 @@ BuildRequires: libedit-devel
 BuildRequires: ncurses-devel
 %if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
 BuildRequires: gcc48-c++
-BuildRequires: libstdc++47-devel
+BuildRequires: libstdc++48-devel
 BuildRequires: libopenssl1-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
+%define scl_enable scl enable devtoolset-2 --
+%else
 BuildRequires: gcc-c++
 BuildRequires: libstdc++-devel
+%endif
 BuildRequires: openssl-devel
 %endif
 BuildRequires: cmake
@@ -107,24 +115,22 @@ BuildRequires: bison
 BuildRequires: make
 %if 0%{?fedora}
 BuildRequires: wxGTK3-devel
-BuildRequires: firewalld-filesystem
-Requires: firewalld-filesystem
-Requires(post): firewalld-filesystem
-%endif
-%if 0%{?rhel} == 7
-Requires: firewalld
-Requires(post): firewalld
 %endif
 
 %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.org
+# el5 and el6 require packages.icinga.com
 BuildRequires: boost153-devel
 %else
 %if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310
-# sles 11 sp3 requires packages.icinga.org
+# sles 11 sp3 requires packages.icinga.com
 BuildRequires: boost153-devel
 %else
-BuildRequires: boost-devel >= 1.41
+%if (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
+# Requires EPEL repository
+BuildRequires: boost148-devel >= 1.48
+%else
+BuildRequires: boost-devel >= 1.48
+%endif
 %endif
 %endif
 
@@ -142,12 +148,23 @@ Provides binaries for Icinga 2 Core.
 %package common
 Summary:      Common Icinga 2 configuration
 Group:        Applications/System
-%if "%{_vendor}" == "redhat"
-Requires(pre): shadow-utils
+%if (0%{?amzn} || 0%{?fedora} || 0%{?rhel})
+Requires(pre):  shadow-utils
 Requires(post): shadow-utils
 %endif
 %if "%{_vendor}" == "suse"
-Recommends:   logrotate
+Requires(pre):  shadow
+Requires(post): shadow
+# Coreutils is added because of autoyast problems reported
+Requires(pre):  coreutils
+Requires(post): coreutils
+%if 0%{?suse_version} >= 1200
+BuildRequires:  monitoring-plugins-common
+Requires:       monitoring-plugins-common
+%else
+Recommends:     monitoring-plugins-common
+%endif
+Recommends:     logrotate
 %endif
 
 %description common
@@ -196,30 +213,17 @@ IDOUtils schema >= 1.12
 %package ido-pgsql
 Summary:      IDO PostgreSQL database backend for Icinga 2
 Group:        Applications/System
+%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
+BuildRequires: postgresql-devel >= 8.4
+%else
 BuildRequires: postgresql-devel
+%endif
 Requires: %{name} = %{version}-%{release}
 
 %description ido-pgsql
 Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
 IDOUtils schema >= 1.12
 
-
-%package classicui-config
-Summary:      Icinga 2 Classic UI Standalone configuration
-Group:        Applications/System
-BuildRequires: %{apachename}
-Requires:     %{apachename}
-Requires:     %{name} = %{version}-%{release}
-%if "%{_vendor}" == "suse"
-Recommends:   icinga-www
-%endif
-Provides:     icinga-classicui-config
-Conflicts:    icinga-gui-config
-
-%description classicui-config
-Icinga 1.x Classic UI Standalone configuration with locations
-for Icinga 2.
-
 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
 %global selinux_variants mls targeted
 %{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)}
@@ -233,8 +237,8 @@ BuildRequires:  checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/poli
 Requires:       selinux-policy >= %{_selinux_policy_version}
 %endif
 Requires:       %{name} = %{version}-%{release}
-Requires(post):   /usr/sbin/semodule, /sbin/restorecon
-Requires(postun): /usr/sbin/semodule, /sbin/restorecon
+Requires(post):   policycoreutils-python
+Requires(postun): policycoreutils-python
 
 %description selinux
 SELinux policy module supporting icinga2
@@ -253,6 +257,28 @@ Provides a GUI for the Icinga 2 API.
 %endif
 
 
+%package -n vim-icinga2
+Summary:      Vim syntax highlighting for icinga2
+Group:        Applications/System
+%if "%{_vendor}" == "suse"
+BuildRequires: vim
+Requires:      vim
+%else
+Requires:      vim-filesystem
+%endif
+
+%description -n vim-icinga2
+Vim syntax highlighting for icinga2
+
+
+%package -n nano-icinga2
+Summary:       Nano syntax highlighting for icinga2
+Group:         Applications/System
+Requires:      nano
+
+%description -n nano-icinga2
+Nano syntax highlighting for icinga2
+
 %prep
 %setup -q -n %{name}-%{version}
 
@@ -261,8 +287,10 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
          -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+         -DICINGA2_LTO_BUILD=ON \
          -DCMAKE_VERBOSE_MAKEFILE=ON \
          -DBoost_NO_BOOST_CMAKE=ON \
+         -DICINGA2_PLUGINDIR=%{plugindir} \
          -DICINGA2_RUNDIR=%{_rundir} \
          -DICINGA2_USER=%{icinga_user} \
          -DICINGA2_GROUP=%{icinga_group} \
@@ -272,39 +300,44 @@ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
 %endif
 %if "%{_vendor}" == "redhat"
 %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
+%if 0%{?build_icinga_org}
 # Boost_VERSION 1.41.0 vs 101400 - disable build tests
-# details in https://dev.icinga.org/issues/5033
-CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
+# details in https://dev.icinga.com/issues/5033
+CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost153 \
  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
- -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
+ -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0'"
+%else
+CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost148 \
+ -DBOOST_INCLUDEDIR=/usr/include/boost148 \
+ -DBoost_ADDITIONAL_VERSIONS='1.48;1.48.0'"
+%endif
+CMAKE_OPTS="$CMAKE_OPTS \
  -DBoost_NO_SYSTEM_PATHS=TRUE \
  -DBUILD_TESTING=FALSE \
  -DBoost_NO_BOOST_CMAKE=TRUE"
 %endif
-%if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
-CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=FALSE"
-%endif
 %endif
 
-%if "%{_vendor}" != "suse"
-CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins"
-%else
-%if 0%{?suse_version} < 1310
-CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
+%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1310
+CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=%{_libdir}/boost153 \
  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
  -DBoost_NO_SYSTEM_PATHS=TRUE \
  -DBUILD_TESTING=FALSE \
  -DBoost_NO_BOOST_CMAKE=TRUE"
 %endif
-CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins"
-%endif
 
 %if 0%{?use_systemd}
 CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
 %endif
 
-cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .
+%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
+# from package gcc48-c++
+export CC=gcc-4.8
+export CXX=g++-4.8
+%endif
+
+%{?scl_enable} cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .
 
 make %{?_smp_mflags}
 
@@ -323,11 +356,6 @@ cd -
 make install \
        DESTDIR="%{buildroot}"
 
-# install classicui config
-install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd
-install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg
-install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf
-
 # remove features-enabled symlinks
 rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
 
@@ -352,7 +380,8 @@ do
 done
 cd -
 
-/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
+# TODO: Fix build problems on Icinga, see https://github.com/Icinga/puppet-icinga_build/issues/11
+#/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
 %endif
 
 %if 0%{?fedora}
@@ -373,11 +402,16 @@ Categories=GTK;Utility;
 Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop
 %endif
 
-%if 0%{?fedora} || 0%{?rhel} == 7
-mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services
-install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services
+%if "%{_vendor}" == "suse"
+install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/site/syntax/%{name}.vim
+install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/site/ftdetect/%{name}.vim
+%else
+install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
+install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
 %endif
 
+install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
+
 %clean
 [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
 
@@ -408,14 +442,6 @@ getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /s
 
 %endif #suse/rhel
 
-%if 0%{?fedora}
-%firewalld_reload
-%endif
-%if 0%{?rhel} == 7
-test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :
-%endif
-
-
 %post common
 # suse
 %if "%{_vendor}" == "suse"
@@ -426,10 +452,13 @@ test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :
 %fillup_and_insserv %{name}
 %endif
 
-# 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
+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
+fi
 
 exit 0
 
@@ -458,7 +487,7 @@ exit 0
 %postun common
 # suse
 %if "%{_vendor}" == "suse"
-%if 0%{?using_systemd}
+%if 0%{?use_systemd}
   %service_del_postun %{name}.service
 %else
   %restart_on_update %{name}
@@ -549,27 +578,6 @@ fi
 
 exit 0
 
-%post classicui-config
-if [ ${1:-0} -eq 1 ]
-then
-        # initial installation, enable features
-       for feature in statusdata compatlog command; do
-               ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
-       done
-fi
-
-exit 0
-
-%postun classicui-config
-if [ "$1" = "0" ]; then
-        # deinstallation of the package - remove feature
-       for feature in statusdata compatlog command; do
-               rm -f %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
-       done
-fi
-
-exit 0
-
 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
 %post selinux
 for selinuxvariant in %{selinux_variants}
@@ -600,10 +608,11 @@ fi
 
 %files bin
 %defattr(-,root,root,-)
-%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS CHANGELOG.md
 %{_sbindir}/%{name}
 %dir %{_libdir}/%{name}/sbin
 %{_libdir}/%{name}/sbin/%{name}
+%{plugindir}/check_nscp_api
 %{_datadir}/%{name}
 %exclude %{_datadir}/%{name}/include
 %{_mandir}/man8/%{name}.8.gz
@@ -618,13 +627,9 @@ fi
 %attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
 %attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
 
-%if 0%{?fedora} || 0%{?rhel} == 7
-%{_prefix}/lib/firewalld/services/%{name}.xml
-%endif
-
 %files libs
 %defattr(-,root,root,-)
-%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS CHANGELOG.md
 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
 %dir %{_libdir}/%{name}
@@ -632,7 +637,7 @@ fi
 
 %files common
 %defattr(-,root,root,-)
-%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS CHANGELOG.md tools/syntax
 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 %{_sysconfdir}/bash_completion.d/%{name}
@@ -681,25 +686,18 @@ fi
 
 %files ido-mysql
 %defattr(-,root,root,-)
-%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS CHANGELOG.md
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf
 %{_libdir}/%{name}/libdb_ido_mysql*
 %{_datadir}/icinga2-ido-mysql
 
 %files ido-pgsql
 %defattr(-,root,root,-)
-%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS CHANGELOG.md
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf
 %{_libdir}/%{name}/libdb_ido_pgsql*
 %{_datadir}/icinga2-ido-pgsql
 
-%files classicui-config
-%defattr(-,root,root,-)
-%attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
-%config(noreplace) %{icingaclassicconfdir}/cgi.cfg
-%config(noreplace) %{apacheconfdir}/icinga.conf
-%config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
-
 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
 %files selinux
 %defattr(-,root,root,0755)
@@ -715,4 +713,23 @@ fi
 %{_datadir}/applications/icinga2-studio.desktop
 %endif
 
+%files -n vim-icinga2
+%defattr(-,root,root,-)
+%if "%{_vendor}" == "suse"
+%{_datadir}/vim/site/syntax/%{name}.vim
+%{_datadir}/vim/site/ftdetect/%{name}.vim
+%else
+%{_datadir}/vim/vimfiles/syntax/%{name}.vim
+%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
+%endif
+
+%files -n nano-icinga2
+%defattr(-,root,root,-)
+%if "%{_vendor}" == "suse"
+%dir %{_datadir}/nano
+%endif
+%{_datadir}/nano/%{name}.nanorc
+
 %changelog
+* Tue Jun 20 2017 Markus Frosch <markus.frosch@icinga.com> 2.7.0-1
+- Update to 2.7.0