File nagios-theme-nuvola.spec of Package nagios-theme-nuvola

# spec file for package nagios-theme-nuvola
# Copyright (c) 2013-2014 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

Name:           nagios-theme-nuvola
Version:        1.0.3
Release:        0
License:        LGPL ; Other Free License
Summary:        Nuvola theme for Nagios webfrontend
Group:          System/Monitoring
Source0:        nagios-nuvola-%{version}.tar.bz2
Source1:        robots.txt
Patch1:         nagios-theme-nuvola-suse.patch
# openSUSE - Patch fix upstream (see bnc #656576)
Patch2:         nagios-theme-nuvola-fixed_with.patch
BuildRequires:  nagios-rpm-macros
BuildRequires:  nagios-www
Requires:       nagios-www >= 2.0
%if 0%{?suse_version} > 1020
BuildRequires:  fdupes
Requires:       nagios-www >= 2.0
BuildRequires:  nagios-www
PreReq:         nagios-theme-switcher
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%define         install_dir /usr/share/nagios-themes/nuvola

This package contains a complete image pack and stylesheets for Nagios.
Icons are from the Nuvola KDE theme (

The DHTML Tree Menu source script is not bundle in this package, you will
need to go and download it from their web site and install it separately.

%setup -q -T -c %{name} -a0
%patch1 -p0
%patch2 -p0


mkdir -p %{buildroot}%{install_dir}
mkdir -p %{buildroot}%{_defaultdocdir}/%name/
for file in *.txt ; do
	sed -e "s|||" $file > %{buildroot}%{_defaultdocdir}/%name/$file
chmod 644 %{buildroot}%{_defaultdocdir}/%name/*
install -m644 %{SOURCE1} %{buildroot}%{install_dir}/
cp -a html/* %{buildroot}%{install_dir}/
pushd %{buildroot}%{install_dir}/
cp -a %{nagios_datadir}/includes .
cp -a %{nagios_datadir}/docs .
find %{buildroot}%{install_dir}/ -type f -exec chmod 644 {} \;
find %{buildroot}%{install_dir}/ -type d -exec chmod 755 {} \;
%if 0%{?suse_version} > 1020
%fdupes %{buildroot}%{install_dir}/

rm -rf %{buildroot}

if [ ${1:-0} -eq 1 ]; then
	# Only switch the theme if we're not in update mode.
    if [ -x %{_sbindir}/switch-nagios-theme ] && [ ! -f /.buildenv ]; then
        %{_sbindir}/switch-nagios-theme nuvola

if [ ${1:-0} -eq 1 ]; then
	# Only switch the theme if we're not in update mode.
    if [ -x %{_sbindir}/switch-nagios-theme ] && [ ! -f /.buildenv ]; then
        %{_sbindir}/switch-nagios-theme nagios

%doc %{_defaultdocdir}/%name