Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > f71d4a68d2fccd52bd199f32484ef8ef > files > 3

webmin-theme-mandriva-1.220-1mdk.src.rpm

%define webmin_rootdir	%{_datadir}/webmin

Name: webmin-theme-mandriva
Version: 1.220
Release: 1mdk
Summary: Theme Mandriva for Webmin
Summary(pt_BR): Tema Mandriva para o Webmin
URL: http://qa.mandriva.com/
Group: Graphics
Group(es): Gráficos
Group(pt_BR): Gráficos
License: GPL
Source: tema-mandriva.tar.bz2
Source1: tema-mandriva-images.tar.bz2
# This is becose of the %%post section. We must be sure that
# webmin is installed before this.
PreReq: webmin
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
Webmin's default theme adopted by Mandriva (http://www.mandriva.com/)

%description -l pt_BR
Tema padrão do Webmin adotado pela Mandriva (http://www.mandriva.com/)

%prep
%setup -q -c -a 1

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{webmin_rootdir}
tar -cf - mandriva/ | tar -C %{buildroot}%{webmin_rootdir} -xf -
find %{buildroot}%{webmin_rootdir} -name *.png -exec chmod 644 {} \;

%clean
rm -rf %{buildroot}

%post
if [ ! -e %{webmin_rootdir}/defaulttheme ]; then
	echo 'mandriva' > %{webmin_rootdir}/defaulttheme
	echo 'theme=mandriva' >> %{_sysconfdir}/webmin/config
	echo 'preroot=mandriva' >> %{_sysconfdir}/webmin/miniserv.conf
	if [ "$1" = "0" ]; then
		if %{_sysconfdir}/rc.d/init.d/webmin status >/dev/null 2>&1; then
			%{_sysconfdir}/rc.d/init.d/webmin restart
		fi
	fi
fi

%preun
if [ "$1" -eq "0" ]; then
  if [ -e %{webmin_rootdir}/defaulttheme ]; then
    if grep -q mandriva %{webmin_rootdir}/defaulttheme 2> /dev/null; then
	rm -f %{webmin_rootdir}/defaulttheme
	grep -Ev '^theme=mandriva$' %{_sysconfdir}/webmin/config \
		> %{_sysconfdir}/webmin/config.new		\
		&& mv %{_sysconfdir}/webmin/config.new		\
			%{_sysconfdir}/webmin/config 2> /dev/null
	grep -Ev '^preroot=mandriva$' %{_sysconfdir}/webmin/miniserv.conf \
		> %{_sysconfdir}/webmin/miniserv.conf.new		\
		&& mv %{_sysconfdir}/webmin/miniserv.conf.new		\
			%{_sysconfdir}/webmin/miniserv.conf 2> /dev/null
    fi
  fi
fi

%files
%defattr(-,root,root,755)
%{webmin_rootdir}/mandriva

%changelog
* Thu Aug 04 2005 Marcelo Ricardo Leitner <mrl@mandriva.com> 1.220-1mdk
- Adopted Conectiva's Webmin theme.