A spar is a zip file renamed spar. The SP Developers guide talks about what is in a spar, all you need to do is build a directory structure up and the zip it, rename it and you are good. The contents are documented *somewhere* but for the life of me, I cannot find it now. You may want to unzip an existing spar and replicate it. The manifest is the only custom file you need to create
#!D:\Interwoven\TeamSite/iw-perl/bin/iwperluse Archive::zip;use File::stat;use Time::localtime;use Date::Manip;use TeamSite::Config;my $iw_home = TeamSite::Config::iwgethome();my $iwmount = TeamSite::Config::iwgetmount();$date_to_check=shift;$date_to_check="01/01/2000" if (!$date_to_check);use File::Temp qw(tempfile);Date_Init('TZ=MST'); # Set Greenwich Mean Time Zoneuse File::Find;my $branch = "INSERT-BRANCH-HERE";my $workarea = "INSERT-WORKAREA-HERE";my $dir = $iwmount."/default/main/".$branch."/STAGING/";my $zipfile="C:/documents and settings/aknipp/desktop/myspar.spar";$days_ago = ParseDate($date_to_check);my @files;find(\&wanted, $dir);$zip = Archive::Zip->new();foreach $filepath(@files) { my $timestamp = ctime(stat($filepath)->mtime); $flag = Date_Cmp($timestamp,$days_ago); if ($flag<0) { } else { ($shortfile = $filepath) =~ s|\Q$dir||; $zip->addFile($filepath, $workarea."/".$shortfile); }}$dir=$iwmount."/iwadmin/main/livesite/component/WORKAREA/shared/";@files=();find(\&wanted, $dir);foreach $filepath(@files) { my $timestamp = ctime(stat($filepath)->mtime); $flag = Date_Cmp($timestamp,$days_ago); if ($flag<0) { } else { ($shortfile = $filepath) =~ s|\Q$dir||; $zip->addFile($filepath, "component/".$shortfile); }}$dir=$iwmount."/iwadmin/main/livesite/template/WORKAREA/shared/";@files=();find(\&wanted, $dir);foreach $filepath(@files) { my $timestamp = ctime(stat($filepath)->mtime); $flag = Date_Cmp($timestamp,$days_ago); if ($flag<0) { } else { ($shortfile = $filepath) =~ s|\Q$dir||; $zip->addFile($filepath, "template/".$shortfile); }}$tmp_fh = $iw_home."/tmp/tempout";open (OUT, ">$tmp_fh") || die "Cannot open $tmp_fh ($!)";print OUT <<"EOF"; COMPANY 1 0 project 7.2.1 Copyright 2010, me <br>1.0 -- Initial revision<br>EOFclose (OUT);$zip->addFile($iw_home."/local/config/lib/content_center/livesite_customer_out/livesite_customer.jar", "toolkit/livesite_customer.jar");$zip->addFile($iw_home."/local/config/lib/content_center/livesite_customer_out/livesite_customer.tk.war", "toolkit/livesite_customer.tk.war");$zip->addFile($iwmount."/iwadmin/main/workflowModels/WORKAREA/iw-wa/Config/Models/Publish LiveSite Content_config.ipm", "workflow/Models/Publish LiveSite Content_config.ipm");$zip->addFile($iwmount."/iwadmin/main/workflowModels/WORKAREA/iw-wa/Config/Publish LiveSite Content_config/default_config.xml", "workflow/Config/Publish LiveSite Content_config/default_config.xml");$zip->addFile($iwmount."/iwadmin/main/workflowModels/WORKAREA/iw-wa/Config/Publish LiveSite Content_config/custom_instantiation.cfg", "workflow/Config/Publish LiveSite Content_config/custom_instantiation.cfg");$zip->addFile($tmp_fh, "meta-inf/manifest.xml");$zip->writeToFileNamed( $zipfile ); unlink ($tmp_fh);sub wanted {-f && push(@files, $File::Find::name);}