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 http://bugs.opensuse.org/
#

Name:           nagios-theme-nuvola
Version:        1.0.3
Release:        0
License:        LGPL ; Other Free License
Summary:        Nuvola theme for Nagios webfrontend
Url:            http://exchange.nagios.org/directory/Addons/Frontends-%28GUIs-and-CLIs%29/Web-Interfaces/Themes-and-Skins/Nuvola-Style/details
Group:          System/Monitoring
Source0:        nagios-nuvola-%{version}.tar.bz2
Source1:        robots.txt
# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
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
%endif
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

%description
This package contains a complete image pack and stylesheets for Nagios.
Icons are from the Nuvola KDE theme (http://www.icon-king.com/).

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.

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

%build

%install
mkdir -p %{buildroot}%{install_dir}
mkdir -p %{buildroot}%{_defaultdocdir}/%name/
for file in *.txt ; do
	sed -e "s|||" $file > %{buildroot}%{_defaultdocdir}/%name/$file
done
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 .
popd
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}/
%endif

%clean
rm -rf %{buildroot}

%post
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
    fi
fi

%postun
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
    fi
fi

%files
%defattr(-,root,root)
%doc %{_defaultdocdir}/%name
%install_dir/

%changelog