Index: configure.in
===================================================================
--- configure.in	(revision 35015)
+++ configure.in	(working copy)
@@ -1929,6 +1929,7 @@
 calendar/gui/Makefile
 calendar/gui/alarm-notify/Makefile
 calendar/gui/dialogs/Makefile
+calendar/tools/Makefile
 composer/Makefile
 mail/Makefile
 mail/default/Makefile
Index: calendar/tools/evolution-vcs-import.c
===================================================================
--- calendar/tools/evolution-vcs-import.c	(revision 0)
+++ calendar/tools/evolution-vcs-import.c	(revision 0)
@@ -0,0 +1,125 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ *  Suman Manjunath <msuman@novell.com>
+ *  Copyright (C) 2008 Novell, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <config.h>
+
+#include <gnome.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include <libecal/e-cal.h>
+
+/* Command-Line Options */
+static gchar **opt_remaining = NULL;
+
+static GOptionEntry entries[] = {
+	{ G_OPTION_REMAINING, '\0', 0,
+	  G_OPTION_ARG_STRING_ARRAY, &opt_remaining },
+	{ NULL }
+};
+
+static void 
+get_subcomps (icalcomponent *icalcomp, icalcomponent_kind kind)
+{
+	ECal *ecal = NULL;
+	icalcomponent *subcomp = NULL;
+
+	switch (kind) {
+		case ICAL_VEVENT_COMPONENT:
+			ecal = e_cal_new_system_calendar ();
+			break; 
+		case ICAL_VTODO_COMPONENT:
+			ecal = e_cal_new_system_tasks ();
+			break;
+		case ICAL_VJOURNAL_COMPONENT:
+			ecal = e_cal_new_system_memos ();
+			break;		
+		default:
+			return;
+	}
+
+	if (!ecal || !e_cal_open (ecal, TRUE, NULL)) {
+		g_warning (N_("Could not load Evolution calendars/tasks/memos"));
+		return;
+	}
+
+	if (icalcomponent_isa (icalcomp) == kind)
+		subcomp = icalcomp;
+	else 
+		subcomp = icalcomponent_get_first_component (icalcomp, kind);
+
+	while (subcomp) {
+		char *uid = NULL;
+		if (!e_cal_create_object (ecal, subcomp, &uid, NULL))
+			g_warning (N_("Could not create an object in Evolution calendars/tasks/memos"));
+		else
+			g_free (uid);
+		subcomp = icalcomponent_get_next_component (icalcomp, kind);
+	}
+
+	g_object_unref (ecal);
+}
+
+int
+main (int argc, char **argv)
+{
+	GnomeProgram *program;
+	GOptionContext *context;
+	icalcomponent *vcalcomp = NULL;
+	gchar *opt_vcs_data = NULL;
+	int status = 0;
+
+	/* i18n-lize */
+	bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+
+	context = g_option_context_new (NULL);
+	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+	program = gnome_program_init (
+		PACKAGE, VERSION, GNOME_BONOBO_MODULE, argc, argv,
+		GNOME_PARAM_GOPTION_CONTEXT, context,
+		GNOME_PARAM_NONE);
+
+	/* Parsing Parameter */
+	if (opt_remaining && g_strv_length (opt_remaining) > 0)
+		opt_vcs_data = opt_remaining[0];
+
+	if (opt_vcs_data && *opt_vcs_data)
+		vcalcomp = icalparser_parse_string (opt_vcs_data);
+
+	if (!vcalcomp) {
+		g_warning (N_("Unable to parse ICS data"));
+		status = -1;
+		goto done;
+	}
+
+	get_subcomps (vcalcomp, ICAL_VEVENT_COMPONENT);
+	get_subcomps (vcalcomp, ICAL_VTODO_COMPONENT);
+	get_subcomps (vcalcomp, ICAL_VJOURNAL_COMPONENT);
+
+	icalcomponent_free (vcalcomp);
+
+done:
+	g_option_context_free (context);
+	exit (status);
+}
Index: calendar/tools/Makefile.am
===================================================================
--- calendar/tools/Makefile.am	(revision 0)
+++ calendar/tools/Makefile.am	(revision 0)
@@ -0,0 +1,21 @@
+privlibexec_PROGRAMS =					\
+	evolution-vcs-import	
+
+INCLUDES =						\
+	-DG_LOG_DOMAIN=\"evolution-calendar-tools\"	\
+	-I$(top_srcdir)					\
+	-I$(top_builddir)				\
+	-DEVOLUTION_LOCALEDIR=\""$(localedir)"\"	\
+	-DPREFIX=\""$(prefix)"\"			\
+	-DSYSCONFDIR=\""$(sysconfdir)"\"		\
+	-DDATADIR=\""$(datadir)"\"			\
+	-DLIBDIR=\""$(libdir)"\"			\
+	-I$(top_srcdir)/calendar			\
+	-I$(top_builddir)/calendar			\
+	$(EVOLUTION_CALENDAR_CFLAGS)
+
+evolution_vcs_import_SOURCES =				\
+	evolution-vcs-import.c
+
+evolution_vcs_import_LDADD =				\
+	$(EVOLUTION_CALENDAR_LIBS)
Index: calendar/Makefile.am
===================================================================
--- calendar/Makefile.am	(revision 35015)
+++ calendar/Makefile.am	(working copy)
@@ -4,7 +4,7 @@
 CONDUIT_DIR =
 endif
 
-SUBDIRS = idl common importers gui $(CONDUIT_DIR)
+SUBDIRS = idl common importers gui tools $(CONDUIT_DIR)
 
 error_DATA = calendar.error
 errordir = $(privdatadir)/errors

