+sub unpack_tree {
+ my $context = shift;
+
+ die "Cannot see archive file\n" unless ( -f $context->{tmp_archive_file} );
+ my @cmd = ( 'tar', 'xf', $context->{tmp_archive_file} );
+
+ # run command
+ print( "Running: ", join( ' ', @cmd ), "\n" ) if ($verbose);
+ system(@cmd) == 0 || croak "Unpack failed";
+}
+
+# ------------------------------------------------------------------
+
+sub build_html_documentation {
+ my $context = shift;
+
+ my $genpath = $context->{webgen_base} . '/script/gen.pl';
+ my $templates = $context->{webgen_base} . '/templates';
+ my $dir = 'html';
+ mkdir($dir);
+
+ my @cmd = (
+ $genpath, '--spec', 'doc/doc-docbook/spec.xml', '--filter',
+ 'doc/doc-docbook/filter.xml', '--latest', $context->{trelease}, '--tmpl',
+ $templates, '--docroot', $dir
+ );
+
+ print "Executing ", join( ' ', @cmd ), "\n";
+ system(@cmd);
+
+ # move directory into right place
+ rename( sprintf( 'html/exim-html-%s', $context->{trelease} ), sprintf( 'exim-html-%s', $context->{release} ) );
+}
+
+# ------------------------------------------------------------------
+