]> granicus.if.org Git - icinga2/blobdiff - icinga2.spec
Cli: Add blacklist/whitelist commands for agent commands
[icinga2] / icinga2.spec
index 01ca17932b3a825c78e20dd9eabd9d4c95c3a454..ba32fa4a5bf57b3c0f795eb3a259fced81ced3c8 100644 (file)
 
 %define revision 1
 
+# make sure that _rundir is working on older systems
+%if ! %{defined _rundir}
+%define _rundir %{_localstatedir}/run
+%endif
+
 %if "%{_vendor}" == "redhat"
 %define apachename httpd
 %define apacheconfdir %{_sysconfdir}/httpd/conf.d
 %endif
 %endif
 
-%{!?__python2: %global __python2 /usr/bin/python2}
-%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
-%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
-
 %define icinga_user icinga
 %define icinga_group icinga
 %define icingacmd_group icingacmd
 
 Summary: Network monitoring application
 Name: icinga2
-Version: 2.0.2
+Version: 2.1.1
 Release: %{revision}%{?dist}
 License: GPL-2.0+
 Group: Applications/System
 Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
 URL: http://www.icinga.org/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Requires: %{name}-bin = %{version}
+Requires: %{name}-bin = %{version}-%{release}
 
 %description
 Meta package for Icinga 2 Core, DB IDO and Web.
@@ -76,9 +77,10 @@ Meta package for Icinga 2 Core, DB IDO and Web.
 Summary:      Icinga 2 binaries and libraries
 Group:        Applications/System
 
-Requires: python-%{name} = %{version}
 %if "%{_vendor}" == "suse"
-PreReq: permissions
+PreReq:        permissions
+Provides:      monitoring_daemon
+Recommends:    monitoring-plugins
 %endif
 BuildRequires: openssl-devel
 BuildRequires: gcc-c++
@@ -100,7 +102,7 @@ BuildRequires: systemd
 Requires: systemd
 %endif
 
-Requires: %{name}-common = %{version}
+Requires: %{name}-common = %{version}-%{release}
 
 %description bin
 Icinga 2 is a general-purpose network monitoring application.
@@ -162,6 +164,9 @@ 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
 
@@ -170,17 +175,6 @@ Icinga 1.x Classic UI Standalone configuration with locations
 for Icinga 2.
 
 
-%package -n python-icinga2
-Summary:      Python module for Icinga 2
-Group:        Application/System
-BuildRequires: python
-BuildRequires: python-devel
-BuildRequires: python-setuptools
-Requires:     python-setuptools
-
-%description -n python-icinga2
-Python module for Icinga 2.
-
 %prep
 %setup -q -n %{name}-%{version}
 
@@ -189,10 +183,11 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
          -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+         -DICINGA2_RUNDIR=%{_rundir} \
          -DICINGA2_USER=%{icinga_user} \
          -DICINGA2_GROUP=%{icinga_group} \
-         -DICINGA2_COMMAND_USER=%{icinga_user} \
-         -DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
+         -DICINGA2_COMMAND_GROUP=%{icingacmd_group} \
+         -DICINGA2_UNITY_BUILD=TRUE"
 %if "%{_vendor}" == "redhat"
 %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5"
 # Boost_VERSION 1.41.0 vs 101400 - disable build tests
@@ -222,7 +217,6 @@ make %{?_smp_mflags}
 
 
 %install
-[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
 make install \
        DESTDIR="%{buildroot}"
 
@@ -257,7 +251,7 @@ exit 0
 
 %if "%{_vendor}" == "suse"
 %verifyscript bin
-%verify_permissions -e /var/run/icinga2/cmd
+%verify_permissions -e %{_rundir}/%{name}/cmd
 %endif
 
 
@@ -268,13 +262,15 @@ exit 0
 %endif
 %endif
 
+%post common
+/usr/share/icinga2/migrate-hosts
 
 # all restart/feature actions belong to icinga2-bin
 %post bin
 # suse
 %if "%{_vendor}" == "suse"
 %if 0%{?suse_version} >= 1310
-%set_permissions /var/run/icinga2/cmd
+%set_permissions %{_rundir}/%{name}/cmd
 %endif
 %if 0%{?use_systemd}
 %fillup_only  %{name}
@@ -284,7 +280,7 @@ exit 0
 %endif
 
 # initial installation, enable default features
-%{_sbindir}/icinga2-enable-feature checker notification mainlog
+%{_sbindir}/icinga2 feature enable checker notification mainlog
 
 exit 0
 
@@ -300,7 +296,7 @@ exit 0
 if [ ${1:-0} -eq 1 ]
 then
        # initial installation, enable default features
-       %{_sbindir}/icinga2-enable-feature checker notification mainlog
+       %{_sbindir}/icinga2 feature enable checker notification mainlog
 fi
 
 exit 0
@@ -372,7 +368,7 @@ exit 0
 if [ ${1:-0} -eq 1 ]
 then
        # initial installation, enable ido-mysql feature
-       %{_sbindir}/icinga2-enable-feature ido-mysql
+       %{_sbindir}/icinga2 feature enable ido-mysql
 fi
 
 exit 0
@@ -380,7 +376,7 @@ exit 0
 %postun ido-mysql
 if [ "$1" = "0" ]; then
        # deinstallation of the package - remove feature
-       test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql
+       test -x %{_sbindir}/icinga2 && %{_sbindir}/icinga2 feature disable ido-mysql
 fi
 
 exit 0
@@ -389,7 +385,7 @@ exit 0
 if [ ${1:-0} -eq 1 ]
 then
        # initial installation, enable ido-pgsql feature
-       %{_sbindir}/icinga2-enable-feature ido-pgsql
+       %{_sbindir}/icinga2 feature enable ido-pgsql
 fi
 
 exit 0
@@ -397,7 +393,7 @@ exit 0
 %postun ido-pgsql
 if [ "$1" = "0" ]; then
        # deinstallation of the package - remove feature
-       test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-pgsql
+       test -x %{_sbindir}/icinga2 && %{_sbindir}/icinga2 feature disable ido-pgsql
 fi
 
 exit 0
@@ -406,7 +402,7 @@ exit 0
 if [ ${1:-0} -eq 1 ]
 then
         # initial installation, enable features
-        %{_sbindir}/icinga2-enable-feature statusdata compatlog command
+        %{_sbindir}/icinga2 feature enable statusdata compatlog command
 fi
 
 exit 0
@@ -414,9 +410,9 @@ exit 0
 %postun classicui-config
 if [ "$1" = "0" ]; then
         # deinstallation of the package - remove feature
-        test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature statusdata
-        test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature compatlog
-        test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command
+        test -x %{_sbindir}/icinga2 && %{_sbindir}/icinga2 feature disable statusdata
+        test -x %{_sbindir}/icinga2 && %{_sbindir}/icinga2 feature disable compatlog
+        test -x %{_sbindir}/icinga2 && %{_sbindir}/icinga2 feature disable command
 fi
 
 exit 0
@@ -445,57 +441,53 @@ exit 0
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d/hosts/localhost
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled
+%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
+%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
+%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/init.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/*.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
+%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/repository.d/*
 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
 %config(noreplace) %{_sysconfdir}/%{name}/scripts/*
 %{_sbindir}/%{name}
-%{_bindir}/%{name}-build-ca
-%{_bindir}/%{name}-build-key
-%{_bindir}/%{name}-sign-key
-%{_sbindir}/%{name}-list-objects
-%{_sbindir}/%{name}-enable-feature
-%{_sbindir}/%{name}-disable-feature
 %{_sbindir}/%{name}-prepare-dirs
 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
 %{_libdir}/%{name}
 %{_datadir}/%{name}
 %exclude %{_datadir}/%{name}/include
+%exclude %{_datadir}/%{name}/migrate-hosts
 %{_mandir}/man8/%{name}.8.gz
-%{_mandir}/man8/%{name}-enable-feature.8.gz
-%{_mandir}/man8/%{name}-disable-feature.8.gz
-%{_mandir}/man8/%{name}-build-ca.8.gz
-%{_mandir}/man8/%{name}-build-key.8.gz
-%{_mandir}/man8/%{name}-sign-key.8.gz
 %{_mandir}/man8/%{name}-prepare-dirs.8.gz
 
-%attr(0755,%{icinga_user},%{icinga_group}) %{_localstatedir}/cache/%{name}
-%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}
-%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat
-%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
-%attr(0755,%{icinga_user},%{icinga_group}) %ghost %{_localstatedir}/run/%{name}
+%attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
+%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
+%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(2755,%{icinga_user},%{icingacmd_group}) %ghost %{_localstatedir}/run/icinga2/cmd
+%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
+%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
 
 %files common
 %defattr(-,root,root,-)
 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
-%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}
+%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%{_sysconfdir}/bash_completion.d/%{name}
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
 %attr(0750,%{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
+%{_datadir}/%{name}/migrate-hosts
 
 %files doc
 %defattr(-,root,root,-)
@@ -504,13 +496,15 @@ exit 0
 
 %files ido-mysql
 %defattr(-,root,root,-)
-%doc components/db_ido_mysql/schema COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
 %{_libdir}/%{name}/libdb_ido_mysql*
+%{_datadir}/icinga2-ido-mysql
 
 %files ido-pgsql
 %defattr(-,root,root,-)
-%doc components/db_ido_pgsql/schema COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
+%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
 %{_libdir}/%{name}/libdb_ido_pgsql*
+%{_datadir}/icinga2-ido-pgsql
 
 %files classicui-config
 %defattr(-,root,root,-)
@@ -519,8 +513,4 @@ exit 0
 %config(noreplace) %{apacheconfdir}/icinga.conf
 %config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
 
-%files -n python-icinga2
-%{python2_sitelib}/icinga2*
-
-
 %changelog