Fix RPM warnings.

Fixes #5193
This commit is contained in:
Gunnar Beutner 2013-11-25 17:35:44 +01:00
parent 593025f763
commit 7910a8fa37
2 changed files with 30 additions and 8 deletions

View File

@ -15,10 +15,13 @@
DAEMON=@CMAKE_INSTALL_FULL_SBINDIR@/icinga2 DAEMON=@CMAKE_INSTALL_FULL_SBINDIR@/icinga2
ICINGA2_CONFIG_FILE=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2/icinga2.conf ICINGA2_CONFIG_FILE=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2/icinga2.conf
ICINGA2_PID_FILE=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/run/icinga2/icinga2.pid ICINGA2_STATE_DIR=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@
ICINGA2_ERROR_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log ICINGA2_PID_FILE=$ICINGA2_STATE_DIR/run/icinga2/icinga2.pid
ICINGA2_ERROR_LOG=$ICINGA2_STATE_DIR/log/icinga2/error.log
ICINGA2_USER=@ICINGA2_USER@ ICINGA2_USER=@ICINGA2_USER@
ICINGA2_GROUP=@ICINGA2_GROUP@ ICINGA2_GROUP=@ICINGA2_GROUP@
ICINGA2_COMMAND_USER=@ICINGA2_COMMAND_USER@
ICINGA2_COMMAND_GROUP=@ICINGA2_COMMAND_GROUP@
test -x $DAEMON || exit 0 test -x $DAEMON || exit 0
@ -44,8 +47,12 @@ fi
# Start Icinga 2 # Start Icinga 2
start() { start() {
mkdir -p `dirname -- $ICINGA2_PID_FILE` mkdir -p $(dirname -- $ICINGA2_PID_FILE)
mkdir -p `dirname -- $ICINGA2_ERROR_LOG` mkdir -p $(dirname -- $ICINGA2_ERROR_LOG)
mkdir -p $ICINGA2_STATE_DIR/run/icinga2/cmd
chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_STATE_DIR/run/icinga2/cmd
chmod 2755 $ICINGA2_STATE_DIR/run/icinga2/cmd
echo "Validating the configuration file:" echo "Validating the configuration file:"
if ! $DAEMON -c $ICINGA2_CONFIG_FILE -C; then if ! $DAEMON -c $ICINGA2_CONFIG_FILE -C; then

View File

@ -45,7 +45,7 @@
%define logmsg logger -t %{name}/rpm %define logmsg logger -t %{name}/rpm
Summary: network monitoring application Summary: Network monitoring application
Name: icinga2 Name: icinga2
Version: 0.0.4 Version: 0.0.4
Release: %{revision}%{?dist} Release: %{revision}%{?dist}
@ -259,12 +259,16 @@ then
%{_sbindir}/icinga2-enable-feature ido-mysql %{_sbindir}/icinga2-enable-feature ido-mysql
fi fi
exit 0
%postun ido-mysql %postun ido-mysql
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove feature # deinstallation of the package - remove feature
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-mysql
fi fi
exit 0
%post ido-pgsql %post ido-pgsql
if [ ${1:-0} -eq 1 ] if [ ${1:-0} -eq 1 ]
then then
@ -272,12 +276,16 @@ then
%{_sbindir}/icinga2-enable-feature ido-pgsql %{_sbindir}/icinga2-enable-feature ido-pgsql
fi fi
exit 0
%postun ido-pgsql %postun ido-pgsql
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove feature # deinstallation of the package - remove feature
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-pgsql test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature ido-pgsql
fi fi
exit 0
%post classicui-config %post classicui-config
if [ ${1:-0} -eq 1 ] if [ ${1:-0} -eq 1 ]
then then
@ -287,6 +295,8 @@ then
%{_sbindir}/icinga2-enable-feature command %{_sbindir}/icinga2-enable-feature command
fi fi
exit 0
%postun classicui-config %postun classicui-config
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove feature # deinstallation of the package - remove feature
@ -295,17 +305,20 @@ if [ "$1" = "0" ]; then
test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command test -x %{_sbindir}/icinga2-disable-feature && %{_sbindir}/icinga2-disable-feature command
fi fi
exit 0
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog %doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
%attr(755,-,-) %{_sysconfdir}/init.d/%{name} %attr(755,-,-) %{_sysconfdir}/init.d/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available %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}/features-enabled
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.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/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-enabled/*.conf %config(noreplace) %{_sysconfdir}/%{name}/features-enabled/*.conf
%{_sbindir}/%{name} %{_sbindir}/%{name}
%{_bindir}/%{name}-migrate-config %{_bindir}/%{name}-migrate-config
%{_bindir}/%{name}-build-ca %{_bindir}/%{name}-build-ca
@ -313,6 +326,7 @@ fi
%{_sbindir}/%{name}-enable-feature %{_sbindir}/%{name}-enable-feature
%{_sbindir}/%{name}-disable-feature %{_sbindir}/%{name}-disable-feature
%exclude %{_libdir}/%{name}/libdb_ido_mysql* %exclude %{_libdir}/%{name}/libdb_ido_mysql*
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
%{_libdir}/%{name} %{_libdir}/%{name}
%{_datadir}/%{name} %{_datadir}/%{name}
%exclude %{_datadir}/%{name}/itl %exclude %{_datadir}/%{name}/itl
@ -322,10 +336,10 @@ fi
%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{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
%attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat/archives %attr(0755,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
%attr(0755,%{icinga_user},%{icinga_group}) %{_localstatedir}/run/%{name} %attr(0755,%{icinga_user},%{icinga_group}) %ghost %{_localstatedir}/run/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name} %attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
%attr(2755,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/run/icinga2/cmd %attr(2755,%{icinga_user},%{icingacmd_group}) %ghost %{_localstatedir}/run/icinga2/cmd
%files common %files common
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -354,6 +368,7 @@ fi
%files classicui-config %files classicui-config
%defattr(-,root,root,-) %defattr(-,root,root,-)
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
%config(noreplace) %{icingaclassicconfdir}/cgi.cfg %config(noreplace) %{icingaclassicconfdir}/cgi.cfg
%config(noreplace) %{apacheconfdir}/icinga.conf %config(noreplace) %{apacheconfdir}/icinga.conf
%config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd %config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd