#!/bin/bash

# configure for building all plugins in a predefined set
#
# Copyright (C) 2006-2009 by Ricardo Mones <mones@debian.org>
#
# You are free to distribute this software under the terms of
# the GNU General Public License.

TOBEBUILTNAMES=vcalendar\ perl_plugin\ rssyl\ mailmbox\ gtkhtml2_viewer\ acpi_notifier\ att_remover\ fetchinfo-plugin\ newmail\ notification_plugin\ attachwarner\ spam_report\ tnef_parse\ archive\ bsfilter_plugin\ python_plugin\ fancy\ geolocation_plugin\ address_keeper\ clamd

TOBEBUILT="";
for name in $TOBEBUILTNAMES;
do TOBEBUILT="$TOBEBUILT "`echo -n $name-*`;
done;

if [ "$1" = "--get-plugin-list" ];
then echo $TOBEBUILT;
     exit 0;
fi

if [ "$1" = "--unconfigure" ];
then for plugin in $TOBEBUILT;
     do test -d $plugin \
     	&& cd $plugin \
	&& echo "*** Unconfiguring $plugin " \
	&& cd ..;
     done;
     exit 0;
fi

for plugin in $TOBEBUILT;
do test -d $plugin \
   && cd $plugin \
   && echo "*** Configuring $plugin " \
   && ./configure "$@" \
   && cd ..;
done;

