File nagios-eventhandlers-send_messages.spec of Package nagios-eventhandlers-send_mail
#
# spec file for package nagios-eventhandlers-send_messages
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: nagios-eventhandlers-send_messages
Summary: Commandline tools for sending Nagios notifications
Version: 0.1.3
Release: 1
Url: http://www.nagios.org/
License: GPL-2.0+
Group: System/Monitoring
Provides: nagios-eventhandlers-send_mail = %{version}
Obsoletes: nagios-eventhandlers-send_mail < 0.1.0
Source0: send_mail
Source1: send_mail.cfg
Source2: send_mail-logrotate
Source3: COPYING
Source4: create_manfile.pl
Source5: send_mail_nagios
Source6: permissions.%{name}
Source7: nagios-eventhandlers-send_messages-rpmlintrc
Source10: send_irc_message
Source11: send_irc_message.cfg
BuildRequires: nagios-rpm-macros
BuildRequires: perl(Pod::Man)
Requires: perl(Carp)
Requires: perl(Config::IniFiles)
Requires: perl(English)
Requires: perl(Getopt::Long)
Requires: perl(Net::SMTP)
Requires: perl(Pod::Usage)
Requires: perl(URI::Escape)
Requires: logrotate
Requires: netcat
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Instead of using the standard printf commandline given by Nagios, you can use
these scripts to generate notification Emails or IRC messages with Nagios.
The scripts will take care of unset variables, formatting URLs and add the
ability to format the output in your way.
%prep
%build
%install
install -D -m755 %{SOURCE0} %buildroot/%{nagios_eventhandlerdir}/send_mail
install -D -m640 %{SOURCE1} %buildroot/%{nagios_sysconfdir}/send_mail.cfg
install -D -m644 %{SOURCE2} %buildroot/%{_sysconfdir}/logrotate.d/%{name}
install -D -m644 %{SOURCE3} %buildroot/%{_defaultdocdir}/%{name}/COPYING
install -m644 %{SOURCE5} %buildroot/%{_defaultdocdir}/%{name}/nagios_send_mail_command.cfg
install -D -m644 %{SOURCE6} %buildroot/%{_sysconfdir}/permissions.d/%{name}
install -D -m755 %{SOURCE10} %buildroot/%{nagios_eventhandlerdir}/send_irc_message
install -D -m640 %{SOURCE11} %buildroot/%{nagios_sysconfdir}/send_irc_message.cfg
echo "# %{nagios_sysconfdir}/send_mail.cfg nagios:nagcmd 0644" >> %buildroot/%{_sysconfdir}/permissions.d/%{name}
echo "# %{nagios_sysconfdir}/send_irc_message.cfg nagios:nagcmd 0644" >> %buildroot/%{_sysconfdir}/permissions.d/%{name}
echo "# %{nagios_logdir}/send_mail.log nagios:nagcmd 0644" >> %buildroot/%{_sysconfdir}/permissions.d/%{name}
echo "# %{nagios_logdir}/send_irc_message.log nagios:nagcmd 0644" >> %buildroot/%{_sysconfdir}/permissions.d/%{name}
mkdir -p %buildroot/%{nagios_logdir}
touch %buildroot/%{nagios_logdir}/send_mail.log
touch %buildroot/%{nagios_logdir}/send_irc_message.log
mkdir -p %buildroot/%_mandir/man1
perl %{SOURCE4} "%version" "1" %buildroot/%{nagios_eventhandlerdir}/send_mail %buildroot/%_mandir/man1/send_mail.1
perl %{SOURCE4} "%version" "1" %buildroot/%{nagios_eventhandlerdir}/send_irc_message %buildroot/%_mandir/man1/send_irc_message.1
%clean
rm -rf %buildroot
%files
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}
%doc %_mandir/man1/send_mail.1*
%doc %_mandir/man1/send_irc_message.1*
# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nagios_eventhandlerdir}
%dir %{nagios_sysconfdir}
%dir %{nagios_logdir}
%{nagios_eventhandlerdir}/send_mail
%{nagios_eventhandlerdir}/send_irc_message
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/permissions.d/%{name}
%defattr(-,%{nagios_user},%{nagios_command_group})
%config(noreplace) %{nagios_sysconfdir}/send_mail.cfg
%config(noreplace) %{nagios_sysconfdir}/send_irc_message.cfg
%ghost %config(noreplace) %{nagios_logdir}/send_mail.log
%ghost %config(noreplace) %{nagios_logdir}/send_irc_message.log
%changelog