Sophie

Sophie

distrib > Mandriva > 10.1 > i586 > by-pkgid > 85bb18b1f569c6d0efd31b378b88095e > files > 3

webalizer-2.01.10-12mdk.src.rpm

#!/usr/bin/perl

my @lang = split /\s+/, $ARGV[1];
my @lang_requires = split /\s+/, $ARGV[2];

for (my $pos = 0; $pos < @lang; $pos++) {
  my $l = $lang[$pos];
  if (lc($ARGV[0]) eq '-packages') {
    print <<"EOP";
%package $l
Summary: %{summary}
Group: Monitoring
Requires: webalizer
Requires: locales-$lang_requires[$pos]

EOP
  } elsif (lc($ARGV[0]) eq '-descriptions') {
    print <<"EOP";
%description $l
Provides the webalizer binary localized for the $l language.

EOP
  } elsif (lc($ARGV[0]) eq '-posts') {
    print <<"EOP";
%post $l
update-alternatives --install %{_bindir}/webalizer webalizer %{_bindir}/webalizer-$l 10 --slave %{_bindir}/webazolver webazolver %{_bindir}/webalizer-$l

EOP
  } elsif (lc($ARGV[0]) eq '-postuns') {
    print <<"EOP";
%postun $l
update-alternatives --remove webalizer %{_bindir}/webalizer-$l

EOP
  } elsif (lc($ARGV[0]) eq '-files') {
    print <<"EOP";
%files $l
%defattr(-,root,root)
%{_bindir}/webalizer-$l

EOP
  }
}