Index: /trunk/for-distributions/bin/script/create_distributions.pl
===================================================================
--- /trunk/for-distributions/bin/script/create_distributions.pl	(revision 13516)
+++ /trunk/for-distributions/bin/script/create_distributions.pl	(revision 13517)
@@ -8,24 +8,12 @@
 
 
-# create_distributions.pl creates the following distributions from the gsdl
-# directory pointed to by $GSDLHOME (although it uses the main CVS
-# repository to get the latest source code distribution).
-
-# Windows distribution - gsdl-x.xx-win32.exe
-# Creates directory structure for this - use Installshield to create installer
-
-# Unix distribution - gsdl-x.xx-unix.tgz
-
-# Source distribution - gsdl-x.xx.tgz
-
-# cd-rom distribution = gsdl-x.xx-cdrom.tgz
-# Creates directory structure - use Installshield to create media
-# for writing to cd-rom
-
-# all collections in $GSDLHOME/collect (except modelcol and those
-# explicitly ignored by -ignorecol options):
-#  pre-built (collname-prebuilt) .tgz .zip
-#  unbuilt (collname) .tgz .zip
-
+# create_distributions.pl creates the following distribution source directories
+# from the gsdl directory pointed to by $GSDLHOME (although it uses the 
+# main CVS repository to get the latest source code distribution).
+
+# CDROM - main distribution source: gsdl-x.xx-cdrom
+# UNIX - some additional unix specific stuff: gsdl-x.xx-unix
+# These first two rely on InstallShield X installer to create the actual distributions (Windows/LInux/Mac, web and CD-ROM)
+# Source - a source distribution, which just needs to be tarred and gzipped up.
 
 #    creates ChangeLog using `cvs2cl.pl -P -F trunk -r -S -l "-d'date<tomorrow'"
@@ -36,7 +24,4 @@
 #    so ChangeLog contains lots of ancient stuff 
 
-#    sets a cvs tag called gsdl-x_xx-distribution (unless -cvs_tag is set
-#    in which case it uses that)
-
 #    creates a copy of everything in cvs repository in $tmpdir
 
@@ -46,5 +31,5 @@
 
 # temporary working directory
-my $tmpdir = '/tmp';
+my $tmpdir = '/tmp/';
 
 # docs directory - up-to-date copy of everything to go in the docs directory 
@@ -79,17 +64,10 @@
     print STDERR "  usage: $0 [options]\n\n";
     print STDERR "  options:\n";
+    print STDERR "   -tmpdir                temporary directory to use instead of $tmpdir\n";
+    print STDERR "   -output_dir            directory to output distributions to\n";
     print STDERR "   -version_num           version number of distribution (x.xx)\n";
     print STDERR "   -cvs_tag               cvs tag from which to create distributions\n";
-    print STDERR "                          - if not set latest versions will be used and\n";
-    print STDERR "                          a tag will be set\n";
-    print STDERR "   -no_cdrom              don't create cd-rom version\n";
+    print STDERR "                          - if not set latest versions will be used.\n";
     print STDERR "   -unesco                create unesco style release, i.e. only 4 languages enabled\n";
-    print STDERR "   -no_cols               don't attempt to create any collection distributions\n";
-    print STDERR "   -only_cols             create collection distributions only\n";
-    print STDERR "   -includecol            collection to include (by default all collections in\n";
-    print STDERR "                          $ENV{'GSDLHOME'}/collect will be included\n";
-    print STDERR "   -ignorecol             directory in $ENV{'GSDLHOME'}/collect to ignore (i.e.\n";
-    print STDERR "                          don't include as collection in distribution)\n";
-    print STDERR "   -output_dir            directory to output distributions to\n";
     print STDERR "   -NoChangeLog           don't create ChangeLog\n";
     print STDERR "   -UseExistingLog        use $ENV{'GSDLHOME'}/ChangeLog rather than creating one\n";
@@ -101,28 +79,20 @@
 &main ();
 
+my $newtmpdir;
 my $version_num;
 my $cvs_tag;
-my $no_cdrom;
 my $unesco;
-my $no_cols;
-my $only_cols;
 my $nochangelog;
 my $useexistinglog;
 my $changelogdate;
 my $output_dir;
-my @includecols;
-my @ignorecols;
 
 sub main
 {
     if (!parsargv::parse(\@ARGV, 
+			 'tmpdir/.*/', \$newtmpdir,
 			 'version_num/\d\.\d\d[a-z]?', \$version_num,
 			 'cvs_tag/.*/', \$cvs_tag,
-			 'no_cdrom', \$no_cdrom,
 			 'unesco', \$unesco,
-			 'no_cols', \$no_cols,
-			 'only_cols', \$only_cols,
-			 'includecol/.*', \@includecols,
-			 'ignorecol/.*', \@ignorecols,
 			 'NoChangeLog', \$nochangelog,
 			 'UseExistingLog', \$useexistinglog,
@@ -133,79 +103,93 @@
     }
 
+    $tmpdir = $newtmpdir if (defined $newtmpdir && -d $newtmpdir);
     $output_dir = "." unless $output_dir =~ /\w/;
     mkdir ($output_dir, 0777) unless -d $output_dir;
 
-    my $have_tag = 0;
     if ($cvs_tag !~ /\w/) {
 	$cvs_tag = $version_num;
 	$cvs_tag =~ s/\./\_/g;
 	$cvs_tag = "gsdl-" . $cvs_tag . "-distribution";
-	$have_tag = 1;
     }
 
     &create_changelog() unless ($nochangelog || $useexistinglog);
-
-    if (!$only_cols) {
-
-	if ($have_tag) {
-	    # Tag gsdl repository
-	    #chdir ($ENV{'GSDLHOME'});
-	    #print STDERR "\ntagging gsdl with $cvs_tag\n";
-	    # `cvs tag -F $cvs_tag`;
-
-	    # Tag gli repository
-	    #chdir (&util::filename_cat($ENV{'GSDLHOME'}, "gli"));
-	    #print STDERR "\ntagging gli with $cvs_tag\n";
-	    # `cvs tag -F $cvs_tag`;
-	}
-
-	# Export gsdl to $tmpdir
-	print STDERR "\nexporting gsdl ($cvs_tag) to $tmpdir\n\n";
-	chdir($tmpdir);
-	# `cvs -d $cvsanon export -r $cvs_tag gsdl`;
-	`cvs -d $cvsanon export -D "1 second ago" gsdl`;
-	#`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gsdl`; 
-
-	# Export gli to $tmpdir/gli
-	print STDERR "\nexporting gli ($cvs_tag) to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n";
-	chdir(&util::filename_cat($tmpdir, "gsdl"));
-	# `cvs -d $cvsanon export -r $cvs_tag gli`;
-	`cvs -d $cvsanon export -D "1 second ago" gli`;
-        #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gli`;
-
-	# Compile gli
-	print STDERR "\ncompiling gli...\n";
-	chdir(&util::filename_cat($tmpdir, "gsdl", "gli"));
-	`./makegli.sh`;
-
-	# JAR up the gli, then delete the class files
-	print STDERR "jarring gli...\n";
-	`./makejar.sh`;
-	&util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "jar"));
-	&util::rm(&util::filename_cat($tmpdir, "gsdl", "gli", "metadata.zip"));
-	&util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "classes", "org"));
-
-	# Move the GLIServer.jar file created by makejar.sh into bin/java
-	&util::mv(&util::filename_cat($tmpdir, "gsdl", "gli", "GLIServer.jar"), 
-		  &util::filename_cat($tmpdir, "gsdl", "bin", "java"));
-
-	# Remove bits used by none of the distributions
-	&util::rm(&util::filename_cat($tmpdir, "gsdl", "packages", "cpan", "XML-Parser-2.27.tar.gz"));
-
-	# copy ChangeLog into $tmpdir/gsdl
-	&util::cp(&util::filename_cat($ENV{'GSDLHOME'}, "ChangeLog"), 
-		  &util::filename_cat($tmpdir, "gsdl")) unless $nochangelog;
-
-	# edit the VERSION and fnord.cpp files
-	&edit_files();
-
-	&create_unix_distribution();
-	&create_source_distribution();
-	&create_cdrom_distribution() unless $no_cdrom;
-    }
-
-    # &create_collection_distributions() unless $no_cols;
-}
-
+    
+    # Export gsdl to $tmpdir
+    print STDERR "\nexporting gsdl to $tmpdir\n\n";
+    chdir($tmpdir);
+    `cvs -d $cvsanon export -D "1 second ago" gsdl`;
+    # use something like the following if you want a previous version
+    #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gsdl`; 
+    
+    # Export gli to $tmpdir/gli
+    print STDERR "\nexporting gli to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n";
+    chdir(&util::filename_cat($tmpdir, "gsdl"));
+    `cvs -d $cvsanon export -D "1 second ago" gli`;
+    # use something like the following if you want a previous version
+    #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gli`;
+    
+    # Compile gli
+    &compile_gli();
+    
+    # Remove bits used by none of the distributions
+    &util::rm(&util::filename_cat($tmpdir, "gsdl", "packages", "cpan", "XML-Parser-2.27.tar.gz"));
+    
+    # copy ChangeLog into $tmpdir/gsdl
+    &util::cp(&util::filename_cat($ENV{'GSDLHOME'}, "ChangeLog"), 
+	      &util::filename_cat($tmpdir, "gsdl")) unless $nochangelog;
+    
+    # edit the VERSION and fnord.cpp files
+    &edit_files();
+    
+    &create_unix_distribution();
+    &create_source_distribution();
+    &create_cdrom_distribution();
+}
+
+
+sub compile_gli
+{
+    print STDERR "\ncompiling gli...\n";
+    chdir(&util::filename_cat($tmpdir, "gsdl", "gli"));
+    `./makegli.sh`;
+    
+    # JAR up the gli, then delete the class files
+    print STDERR "jarring gli...\n";
+    `./makejar.sh`;
+    &util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "jar"));
+    &util::rm(&util::filename_cat($tmpdir, "gsdl", "gli", "metadata.zip"));
+    &util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "classes", "org"));
+    
+    # Move the GLIServer.jar file created by makejar.sh into bin/java
+    &util::mv(&util::filename_cat($tmpdir, "gsdl", "gli", "GLIServer.jar"), 
+	      &util::filename_cat($tmpdir, "gsdl", "bin", "java"));
+
+    # Make the gli-client.zip file
+    chdir($tmpdir);
+    
+    # take a copy of GLI directory
+    &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "gli"), $tmpdir);
+    
+    my $client_dirname = "gli-client-" . $version_num;
+    rename ("gli", $client_dirname);
+    chdir(&util::filename_cat($tmpdir, $client_dirname));
+
+    
+    # delete unnecessary stuff
+    `rm -rf clean.* document.* gems.* gli*.sh gli*.bat make*.sh make*.bat lib src`;
+    # make sure permissions are ok
+    `chmod a+x client-gli.sh client-gli.bat`;
+    chdir($tmpdir);
+    
+    # zip up the client
+    &zip($client_dirname, $client_dirname, $tmpdir, 1);
+    
+    # Move the zip file to the destination directory
+    
+    &util::cp(&util::filename_cat($tmpdir, "$client_dirname.zip"), $output_dir);
+    &util::rm_r(&util::filename_cat($tmpdir, $client_dirname));
+    &util::rm(&util::filename_cat($tmpdir, "$client_dirname.zip"));
+
+}
 
 sub create_unix_distribution
@@ -261,12 +245,4 @@
     }
 
-    # Don't need the "images/garish" directory for web releases
-    #&util::rm_r(&util::filename_cat($gsdldir, "images", "garish"));
-
-    # Remove the copied "macros" folder and copy over just the core language macros
-    #my $gsdlmacrosdir = &util::filename_cat($source_dist_dir, "gsdl", "macros");
-    #&util::rm_r($gsdlmacrosdir);
-    #&install_only_core_language_macros(&util::filename_cat($tmpdir, "gsdl", "macros"), $gsdlmacrosdir);
-
     # We don't want the compiled GLI classes in the source distribution (or the GS3 scripts)
     &util::rm(&util::filename_cat($source_dist_dir, "gsdl", "gli", ".greenstonestore"));
@@ -275,5 +251,4 @@
     &util::rm(&util::filename_cat($source_dist_dir, "gsdl", "gli", "gli4gs3.sh"));
 
-    # (We don't include the built demo collection in the source distribution)
 }
 
@@ -305,13 +280,12 @@
 
     # for the cd-rom we want to include the unbuilt bits of the demo collection too
-    my $demodir = &util::filename_cat($cdrom_dist_dir, "gsdl", "collect", "demo");
-    my $tmpdemo = &util::filename_cat($tmpdir, "gsdl", "collect", "demo");
-    die "oops, no demo dir\n" unless -d $demodir;
-    &util::cp (&util::filename_cat ($tmpdemo, "demo.col"), $demodir);
-    &util::cp_r (&util::filename_cat ($tmpdemo, "import"), $demodir);
-    &util::cp_r (&util::filename_cat ($tmpdemo, "metadata"), $demodir);
-
-    # collect directory, with documented example collections and customised home.dm file
-    # no longer use customised home.dm
+    #my $demodir = &util::filename_cat($cdrom_dist_dir, "gsdl", "collect", "demo");
+    #my $tmpdemo = &util::filename_cat($tmpdir, "gsdl", "collect", "demo");
+    #die "oops, no demo dir\n" unless -d $demodir;
+    #&util::cp (&util::filename_cat ($tmpdemo, "demo.col"), $demodir);
+    #&util::cp_r (&util::filename_cat ($tmpdemo, "import"), $demodir);
+    #&util::cp_r (&util::filename_cat ($tmpdemo, "metadata"), $demodir);
+
+    # collect directory, with documented example collections 
     my $cdrom_collect_dir = &util::filename_cat ($cdrom_dist_dir, "collect");
     mkdir($cdrom_collect_dir, 0777);
@@ -320,5 +294,4 @@
     my $target_collect_dir = &util::filename_cat($cdrom_dist_dir, "collect");
 
-# *****
     &util::cp_r(&util::filename_cat($source_collect_dir, "MARC-e"), $target_collect_dir);
     &util::cp_r(&util::filename_cat($source_collect_dir, "authen-e"), $target_collect_dir);
@@ -335,7 +308,4 @@
     &util::cp_r(&util::filename_cat($source_collect_dir, "style-e"), $target_collect_dir);
     &util::cp_r(&util::filename_cat($source_collect_dir, "pagedimg-e"), $target_collect_dir);
-    # The customised home.dm file must have a modified date after the gsdl/macros/home.dm file
-    # no longer use customised home.dm
-    #&util::cp(&util::filename_cat($for_distributions_dir, "macros", "home.dm"), $cdrom_collect_dir);
 
     # Make sure the whole thing is user-writeable
@@ -437,10 +407,5 @@
     }
 
-    # Install all images (non-core languages are now not included)
     &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "images"), $gsdldir);
-
-    #my $gsdlmacrosdir = &util::filename_cat ($gsdldir, "macros");
-    #&install_only_core_language_macros(&util::filename_cat($tmpdir, "gsdl", "macros"), $gsdlmacrosdir);
-    # Install all macrofiles now
     &util::cp_r(&util::filename_cat ($tmpdir, "gsdl", "macros"), $gsdldir);
     &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "mappings"), $gsdldir);
@@ -493,29 +458,4 @@
 }
 
-# no longer used!
-sub install_only_core_language_macros
-{
-    my ($source_dir, $target_dir) = @_;
-    mkdir($target_dir, 0777);
-
-    # Language independent (theoretically) macrofiles
-    my @basicmacrofiles = ("about.dm", "authen.dm", "base.dm", "browse.dm", "bsummary.dm",
-			   "collect.dm", "dateqry.dm", "docs.dm", "document.dm",
-			   "exported_home.dm", "extlink.dm", "extra.dm",
-			   "garish.dm", "gli.dm", "gsdl.dm", "gti.dm", "help.dm", "home.dm", "html.dm", "nav_css.dm",
-			   "nzdlhome.dm", "pref.dm", "query.dm", "status.dm", "style.dm",
-			   "tip.dm", "users.dm", "yourhome.dm");
-
-    # Core language (English, French, Spanish, Russian) macrofiles 
-    my @corelanguagemacrofiles = ("english.dm", "english2.dm", "french.dm", "french2.dm",
-				  "spanish.dm", "spanish2.dm", "russian.dm", "russian2.dm",
-				  "yourhome-es.dm", "yourhome-fr.dm");
-
-    # Copy the macrofiles
-    foreach my $file ((@basicmacrofiles, @corelanguagemacrofiles)) {
-	&util::cp(&util::filename_cat($source_dir, $file), $target_dir);
-    }
-}
-
 
 sub install_gli
@@ -632,8 +572,4 @@
 }
 
-# if $cd_rom is not true then we don't want to include the net16, net32,
-# Win32s or netscape directories in the bin/windows directory (note that
-# this currently means exportcol.pl will fail for all but cd-rom installed
-# distributions)
 sub install_windows_specific {
     my ($install_dir, $cd_rom) = @_;
@@ -645,9 +581,4 @@
     &util::cp_r ($winbin, $winbindir);
 
-    if (!$cd_rom) {
-	&util::rm_r (&util::filename_cat ($winbindir, "windows", "Win32s"));
-	&util::rm_r (&util::filename_cat ($winbindir, "windows", "netscape"));
-    }
-
     # make sure there aren't any CVS directories laying around
     &remove_cvs_dirs ($windir);
@@ -684,51 +615,4 @@
 }
 
-sub create_collection_distributions {
-    
-    # work out which collections we want
-    my @cols = ();
-    if (scalar @includecols) {
-	@cols = @includecols;
-    } else {
-	my $collectdir = &util::filename_cat($ENV{'GSDLHOME'}, "collect");
-
-	opendir (COLLECTDIR, $collectdir) || die;
-	my @cdirs = readdir COLLECTDIR;
-	closedir COLLECTDIR;
-	my %ignore = ();
-	map { $ignore{$_} = ""; } @ignorecols;
-	foreach my $d (@cdirs) {
-	    if ((-d &util::filename_cat($collectdir, $d)) && ($d ne ".") && ($d ne "..") && 
-		($d ne "modelcol") && ($d ne "CVS") && (!defined $ignore{$d})) {
-		push (@cols, $d);
-	    }
-	}
-    }
-    
-    return unless scalar @cols;
-
-    # create distributions
-    foreach my $collection (@cols) {
-	if (&get_built_collection ($collection, $tmpdir)) {
-	    &zip ("$collection-prebuilt", $collection, $tmpdir, 0);
-	    &util::cp (&util::filename_cat($tmpdir, "$collection-prebuilt.tgz"), $output_dir);
-	    &util::cp (&util::filename_cat($tmpdir, "$collection-prebuilt.zip"), $output_dir);
-	} else {
-	    print STDERR "ERROR: Couldn't create pre-built $collection collection\n";
-	}
-	&util::rm_r (&util::filename_cat ($tmpdir, $collection)) 
-	    if -d &util::filename_cat ($tmpdir, $collection);
-
-	if (&get_unbuilt_collection ($collection, $tmpdir)) {
-	    &zip ($collection, $collection, $tmpdir, 0);
-	    &util::cp (&util::filename_cat($tmpdir, "$collection.tgz"), $output_dir);
-	    &util::cp (&util::filename_cat($tmpdir, "$collection.zip"), $output_dir);
-	} else {
-	    print STDERR "ERROR: Couldn't create unbuilt $collection collection\n";
-	}
-	&util::rm_r (&util::filename_cat ($tmpdir, $collection)) 
-	    if -d &util::filename_cat ($tmpdir, $collection);
-    }
-}
 
 # gets all the right bits of a built collection from 
@@ -769,81 +653,24 @@
 	       &util::filename_cat($to_dir, "etc"));
 
-    # get the images directory
+    # get the .col file
+    &util::cp (&util::filename_cat($from_dir, "$colname.col"),
+	       $to_dir);
+    # get any other directories - import, metadata, images, macros, perllib
+    my $from_import = &util::filename_cat ($from_dir, "import");
+    &util::cp_r ($from_import, $to_dir) if -d $from_import;
+    my $from_metadata = &util::filename_cat ($from_dir, "metadata");
+    &util::cp_r ($from_metadata, $to_dir) if -d $from_metadata;
     my $from_images = &util::filename_cat ($from_dir, "images");
     &util::cp_r ($from_images, $to_dir) if -d $from_images;
-    
+    my $from_macros = &util::filename_cat ($from_dir, "macros");
+    &util::cp_r ($from_macros, $to_dir) if -d $from_macros;
+    my $from_perllib = &util::filename_cat ($from_dir, "perllib");
+    &util::cp_r ($from_perllib, $to_dir) if -d $from_perllib;
+
     # make sure there aren't any CVS directories laying around
     &remove_cvs_dirs ($to_dir);
 
-    &edit_collect_cfg (&util::filename_cat($to_dir, "etc", "collect.cfg"), $colname);
-    &create_version_file (&util::filename_cat($to_dir, "etc", "VERSION"), 0);
-
     return 1;
 }
-
-# gets all the right bits of an unbuilt collection from 
-# $GSDLHOME/collect and copies them to $collect_dir
-# returns 1 if successful, 0 if not
-sub get_unbuilt_collection {
-    my ($colname, $collect_dir) = @_;
-
-    my $from_dir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $colname);
-    if (!-d $from_dir) {
-	print STDERR "\nERROR: No collection at $from_dir\n";
-	return 0;
-    }
-    
-    my $to_dir = &util::filename_cat ($collect_dir, $colname);
-    mkdir ($to_dir, 0777) unless -d $to_dir;
-
-    # get the unbuilt data (either import or archives)
-    my $have_import = 0;
-    my $import_dir = &util::filename_cat ($from_dir, "import");
-    if (-d $import_dir && opendir (IMPORTDIR, $import_dir)) {
-	my @importfiles = readdir IMPORTDIR;
-	closedir IMPORTDIR;
-	# if the import directory isn't empty we'll assume everything's ok
-	if (scalar @importfiles) {
-	    $have_import = 1;
-	    &util::cp_r ($import_dir, $to_dir);
-	    mkdir (&util::filename_cat ($to_dir, "archives"), 0777);
-	}
-    }
-    if (!$have_import) {
-	# see if we've got archives then (check for archives.inf)
-	if (-e &util::filename_cat ($from_dir, "archives", "archives.inf")) {
-	    &util::cp_r (&util::filename_cat($from_dir, "archives"), $to_dir);
-	} else {
-
-	    print STDERR "$colname collection appears to have no valid\n";
-	    print STDERR "import or archives data\n";
-	    &util::rm_r ($to_dir);
-	    return 0;
-	}
-    }
-    
-    # get the etc directory
-    &util::cp_r (&util::filename_cat ($from_dir, "etc"), $to_dir);
-
-    # get the perllib directory
-    &util::cp_r (&util::filename_cat ($from_dir, "perllib"), $to_dir);
-
-    # get the images
-    &util::cp_r (&util::filename_cat ($from_dir, "images"), $to_dir);
-    
-    mkdir (&util::filename_cat ($to_dir, "building"), 0777);
-    mkdir (&util::filename_cat ($to_dir, "index"), 0777);
-
-    # make sure there aren't any CVS directories laying around
-    &remove_cvs_dirs ($to_dir);
-
-    &edit_collect_cfg (&util::filename_cat($to_dir, "etc", "collect.cfg"), $colname);
-    my $preimported = 0;
-    $preimported = 1 unless $have_import;
-    &create_version_file (&util::filename_cat($to_dir, "etc", "VERSION"), $preimported);
-
-    return 1;
-}
-
 
 sub force_windows_line_endings
@@ -897,83 +724,4 @@
 }
 
-# edits the gsdlsite.cfg file to set GSDLHOME
-# makes a copy of the initial version of gsdlsite.cfg in
-# /tmp (if it doesn't exist already).
-# sub edit_gsdlsite {
-#     my ($gsdlhome) = @_;
-
-#     my $gsdlsite_file = &util::filename_cat ($tmpdir, "gsdl", "cgi-bin", "gsdlsite.cfg");
-#     my $tmp_gsdlsite_file = &util::filename_cat ($tmpdir, "gsdlsite.cfg");
-
-#     if (-e $tmp_gsdlsite_file) {
-# 	&util::cp ($tmp_gsdlsite_file, $gsdlsite_file);
-#     } else {
-# 	&util::cp ($gsdlsite_file, $tmp_gsdlsite_file);
-#     }
-
-#     open (GSDLSITE, $gsdlsite_file) || die;
-#     my $line = ""; my $file = ""; my $found = 0;
-#     while (defined ($line = <GSDLSITE>)) {
-# 	if ($line =~ s/\*\*GSDLHOME\*\*/$gsdlhome/g) {
-# 	    $found = 1;
-# 	}
-# 	$file .= $line;
-#     }
-#     close GSDLSITE;
-
-#     if (!$found) {
-# 	die "ERROR: $gsdlsite_file contains no **GSDLHOME** string\n";
-#     }
-
-#     open (GSDLSITE, ">$gsdlsite_file") || die;
-#     print GSDLSITE $file;
-#     close GSDLSITE;
-# }
-
-# currently just checks that iconcollection fields are correct and that
-# creator and maintainer fields are set to greenstone@cs.waikato.ac.nz
-sub edit_collect_cfg {
-    my ($collect_cfg_file, $collname) = @_;
-
-    open (FILE, $collect_cfg_file) || die "couldn't open $collect_cfg_file\n";
-    my $line = ""; my $file = "";
-    while (defined ($line = <FILE>)) {
-	$line =~ s/^((?:creator|maintainer)\s+\"?)[\w\.]+@[\w\.]+(\"?)/$1greenstone\@cs.waikato.ac.nz$2/ix;
-	# !! This will stuff up if there are handle language qualifiers eg. [l=en] !!
-	# $line =~ s/^(collectionmeta\s+\"?iconcollection(?:small)?\"?\s+\"?).*?($collname\/images\/)/$1_httpprefix_\/collect\/$2/ix;
-	$file .= $line;
-    }
-    close FILE;
-
-    open (FILE, ">$collect_cfg_file") || die;
-    print FILE $file;
-    close FILE;
-}
-
-# the "collection release" is the version of the content - it should only change if the 
-# collections content is changed in some way
-# the "build version" is the build version of Greenstone when the collection distribution
-# was created
-
-# recent build version changes were:
-# 2.0 - 2.1: plugins were altered to take input_encoding (and other) options. GB plugins
-#            were removed. numwords and numsections statistics were added.
-#            All build version 2.0 collections other than those that suddenly required
-#            the input_encoding option (i.e. Arabic and Chinese) may still be built and
-#            viewed using build verion 2.1 software (numwords and numsections won't be
-#            available though).
-
-sub create_version_file {
-    my ($version_file, $preimported) = @_;
-    
-    open (FILE, ">$version_file") || die;
-    
-    print FILE "collection release: 1.1\n";
-    print FILE "build version: 2.1\n";
-    print FILE "pre-imported\n" if $preimported;
-
-    close FILE;
-}
-
 # simply recurses directory structure beginning at $dir
 # and deletes any CVS administrative directories it comes 
