KfW automated build scripts & supporting files
authorKevin Koch <kpkoch@mit.edu>
Fri, 16 Mar 2007 18:38:28 +0000 (18:38 +0000)
committerKevin Koch <kpkoch@mit.edu>
Fri, 16 Mar 2007 18:38:28 +0000 (18:38 +0000)
Updated scripts & additional configuration files.

Ticket: new
Target_Version: 1.6.1
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19234 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/build/BKWconfig.xml
src/windows/build/Logger.pm [new file with mode: 0644]
src/windows/build/bkw-automation.html
src/windows/build/bkw.pl
src/windows/build/copyfiles.pl [new file with mode: 0644]
src/windows/build/copyfiles.xml
src/windows/build/corebinaryfiles.xml [new file with mode: 0644]
src/windows/build/sdkfiles.xml [new file with mode: 0644]
src/windows/build/srcfiles.xml [new file with mode: 0644]

index 61e5ee59d29c38f687b3336e012e6d19a71531ba..c7296ece4fe90b9eab3514456068133158ded08f 100644 (file)
@@ -2,40 +2,46 @@
 <!-- BKW: Build Kerberos for Windows -->\r
 <BKW_Config>\r
        <CommandLine>\r
-         <!-- The most changeable parameters can be specified on the command line.\r
-              Less changeable params are in section Config, below. -->\r
+               <!-- The most changeable parameters can be specified on the command line.       -->\r
                <Tags>\r
-                       <cvs value=""/>\r
-<!--                   <svn value=""/> -->\r
-               </Tags>\r
+                       <cvs value="" />\r
+                       <svn value=""/>\r
+                       </Tags>\r
                <Directories>\r
                        <!--    Sources will be checked out of repositories into <src>.  The structure\r
                                                of the repositories will cause pismere/athena to be created under <src>.        -->\r
-                       <src            path="C:\projects\" />\r
-                       \r
-                       <!--    The sample config distributed as a zip must be unzipped into this directory before running the build: -->\r
-                       <extras path="\auth\krb5\package-extras" />     <!-- Relative to <src>\pismere\athena -->\r
-                       \r
-                       <out            path="path4" />\r
-               </Directories>\r
+                       <src                    path    ="C:\projects\Autobuild" />\r
+                       <out                    path    ="public" /> <!-- Relative to src. -->\r
+                       <unixfind       path    ="c:\cygwin\bin" />\r
+                       </Directories>\r
                <Options>\r
-                       <debug                  value="0" />\r
-                       <logfile                        value="1" path="bkw.pl.log" />\r
-                       <repository     value="skip" />\r
-                       <clean                  value="0" />\r
-                       <nomake         value="0" />\r
-                       <nopackage      value="0" />\r
-                       <verbose                value="0" />\r
-                       <vverbose               value="0" />\r
-               </Options>\r
-       </CommandLine>\r
-       <Config>\r
-               <CVSROOT        name=":kserver:cvs.mit.edu:/cvs/pismere" />\r
-               <SVNURL         name="svn+ssh://svn.mit.edu/" />\r
-       </Config>\r
+                       <debug value="0" />\r
+                       <logfile value="1" path="bkw.pl.log" />\r
+                       <repository value="skip" />\r
+                       <clean value="0" />\r
+                       <nomake value="0" />\r
+                       <nopackage value="0" />\r
+                       <verbose value="0" />\r
+                       <vverbose value="0" />\r
+                       </Options>\r
+               </CommandLine>\r
        <Stages>\r
-               <FetchSources></FetchSources>\r
-               <Make></Make>\r
+               <FetchSources>\r
+                       <Config>\r
+                               <CVSROOT name=":kserver:cvs.mit.edu:/cvs/pismere" />\r
+                               <SVNURL name="svn.mit.edu" /> <!-- NB:  No protocol or slashes!! -->\r
+                               <KERBEROS_ID name="kpkoch" />\r
+                               <KRB_PLINK name="c:\downloads\plink.exe" /> <!-- Path to a kerberized plink, needed for svn. -->\r
+                               </Config>\r
+               </FetchSources>\r
+               <Make>\r
+                       <Prunes> <!-- Files to be removed from current build to match what is in the 3.1 distribution:  -->\r
+                               <Prune dummy="foo" />\r
+                               <Prune name="afsauth" />\r
+                               <Prune name="aklog" />\r
+                               <Prune name="vs" />\r
+                               </Prunes>\r
+                       </Make>\r
                <PrePackage>\r
                        <CopyList>\r
                                <Config>\r
@@ -43,8 +49,8 @@
                                                                The otherwise identical paths differ in one section.  For example:\r
                                                                .../target/bin/i386/bin/rel/filename and .../target/bin/i386/dbg/filename.\r
                                                                Here we define the two differing sections:      -->\r
-                                       <DebugArea              value="dbg" />\r
-                                       <ReleaseArea    value="rel" />\r
+                                       <DebugArea value="dbg" />\r
+                                       <ReleaseArea value="rel" />\r
                                        <!--    Paths in the file list that include <AlwaysTag> will always have the tag replaced \r
                                                                with <DebugArea> or <ReleaseArea>, depending on the type of build.\r
                                                                Paths that include <DebugTag> (or <ReleaseTag>) will only have the tag substituted \r
                                                                Will always be copied, from a build-independent directory:\r
                                                                <File name="des.h"      from="auth\krb4\include\"       to="\inc\krb4" newname="foo.h"/>\r
                                                                -->\r
-                                       <AlwaysTag      value="%bldtype%" />    <!-- Pick a string that won't appear in a path. -->\r
-                                       <DebugTag       value="%debug%" />      <!-- Pick a string that won't appear in a path. -->\r
-                                       <ReleaseTag     value="%release%" />    <!-- Pick a string that won't appear in a path. -->\r
-                               </Config>\r
+                                       <AlwaysTag value="%bldtype%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                       <DebugTag value="%debug%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                       <ReleaseTag value="%release%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                       </Config>\r
                                <Files>\r
-                                       <Include path="copyfiles.xml" />        <!-- Relative to location of bkw.pl. -->\r
-                               </Files>\r
+                                       <Include path="copyfiles.xml" />\r
+                                       </Files> <!-- Relative to location of bkw.pl. -->\r
                        </CopyList>\r
                </PrePackage>\r
-               <Package></Package>\r
-               <PostPackage></PostPackage>\r
+               <Package>\r
+                       <MSI></MSI>\r
+                       <NSIS></NSIS> <!-- NB:  Most config is done in site-local.nsi.  -->\r
+                       <!-- Theoretically, writing site-local.nsi from xml settings could be done, but isn't.  -->\r
+               </Package>\r
+               <PostPackage>\r
+                       <Config>                                                                                                        <!-- This config info will be copied into each CopyList in PostPackage. -->\r
+                               <FileStem name="kfw-3-2-0" />           <!--    <FileStem> will be substituted for %filestem%.  -->\r
+                               </Config>\r
+                       <Zips>\r
+                               <Zip dummy="foo" /> <!-- To force desired XML::Simple behavior  -->\r
+                               <!--    Files will be copied into directory <topdir>; <topdir> will appear in the paths of the files.   -->\r
+                               <!-- File from  paths are relative to <src>/pismere.    -->\r
+                               <!-- File to                    paths are relative to <out>.                                    -->\r
+                               <Zip name="Core Binaries" filename="%filestem%.zip" topdir="%filestem%-final">\r
+                                       <CopyList>\r
+                                               <Config>\r
+                                                       <DebugArea value="dbg" />\r
+                                                       <ReleaseArea value="rel" />\r
+                                                       <AlwaysTag value="%bldtype%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                                       <DebugTag value="%debug%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                                       <ReleaseTag value="%release%" /> <!-- Pick a string that won't appear in a path. -->\r
+                                                       </Config>\r
+                                               <Files>\r
+                                                       <Include path="corebinaryfiles.xml" />\r
+                                                       </Files> <!-- Relative to location of bkw.pl. -->\r
+                                               </CopyList>\r
+                               </Zip>\r
+                               <Zip name="SDK" filename="%filestem%-sdk.zip" topdir="%filestem%-final">\r
+                                       <CopyList>\r
+                                               <Files>\r
+                                                       <Include path="sdkfiles.xml" />\r
+                                                       </Files> <!-- Relative to location of bkw.pl. -->\r
+                                               </CopyList>\r
+                               </Zip>\r
+                               <Zip name="SRC" filename="%filestem%-src.zip" topdir="%filestem%-final">\r
+                                       <CopyList>\r
+                                               <Files>\r
+                                                       <!-- File from  paths are relative to <src>/pismere.    -->\r
+                                                       <!-- File to                    paths are relative to <out>.                                    -->\r
+                                                       <File dummy="foo" /> <!-- Forces XML::Simple behavior -->\r
+                                                       <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->\r
+                                                       <File name="*.*" from="athena" to="src\athena" />\r
+                                                       <File name="*.*" from="doc" to="src\doc" />\r
+                                                       <File name="*.*" from="scripts" to="src\scripts" />\r
+                                                       </Files>\r
+                                       </CopyList>\r
+                                       <Prunes> <!-- Files to be removed from current build to match what is in the 3.1 distribution:  -->\r
+                                               <Prune dummy="foo" />\r
+                                               <Prune name="CVS" />\r
+                                               <Prune name=".cvsignore" flags="i" />\r
+                                               <Prune name="Changelog" flags="i" />\r
+                                               <Prune name="obj" />\r
+                                               <Prune name="site" />\r
+                                               </Prunes>\r
+                                       <Requires>\r
+                                               <Switch dummy="foo" />\r
+                                               <Switch name="REPOSITORY" value="CHECKOUT"/>\r
+                                               <ErrorMsg text="Can't build source zip unless both /REPOSITORY CHECKOUT is specified." />\r
+                                               </Requires>\r
+                                       </Zip>\r
+                               </Zips>                 \r
+                       <CopyList>                      <!-- Copied at end of post-package step.        -->\r
+                               <Files>\r
+                                       <File dummy="foo" />\r
+                                       <!-- File from  paths are relative to <src>/pismere.    -->\r
+                                       <!-- File to                    paths are relative to <out>.                                    -->\r
+                                       <File name="msi-deployment-guide.txt" from="staging\install\wix\" to="" />\r
+                                       <File name="netidmgr_userdoc.pdf" from="staging\doc" to="." />\r
+                                       <File name="kfw.msi" from="staging\install\wix\" to="" newname="%filestem%.msi" />\r
+                                       <File name="MITKerberosForWindows.exe" from="staging\install\nsis" to="" newname="%filestem%.exe" />\r
+                                       </Files>\r
+                               </CopyList>\r
+                       </PostPackage>\r
        </Stages>\r
 </BKW_Config>
\ No newline at end of file
diff --git a/src/windows/build/Logger.pm b/src/windows/build/Logger.pm
new file mode 100644 (file)
index 0000000..f74c218
--- /dev/null
@@ -0,0 +1,87 @@
+package Logger;\r
+\r
+use strict;\r
+use IO::File;\r
+use FindBin;\r
+\r
+my $bStarted = 0;\r
+\r
+sub new {\r
+    my $class = shift;\r
+    my $file = shift;\r
+    my $append = shift;\r
+    $file || die "Usage: \$foo = new Logger filename [append]\n";\r
+    my $self = {};\r
+    bless  $self, $class;\r
+    $self->{FILE} = $file;\r
+    $self->{APPEND} = $append?'-a':'';\r
+    return $self;\r
+}\r
+\r
+sub start {\r
+    my $self = shift;\r
+\r
+    return 1 if $self->{PIPE};\r
+\r
+    STDOUT->flush;\r
+    STDERR->flush;\r
+\r
+    my $fh_out = new IO::File;\r
+    my $fh_err = new IO::File;\r
+    my $fh_pipe = new IO::File;\r
+\r
+    $self->{OUT} = $fh_out;\r
+    $self->{ERR} = $fh_err;\r
+    $self->{PIPE} = $fh_pipe;\r
+\r
+    $fh_out->open(">&STDOUT") || die;\r
+    $fh_err->open(">&STDERR") || die;\r
+    $fh_pipe->open("|$^X $FindBin::Bin/tee.pl $self->{APPEND} $self->{FILE}") || die;\r
+\r
+    STDOUT->fdopen(fileno $fh_pipe, "w") || die;\r
+    STDERR->fdopen(fileno $fh_pipe, "w") || die;\r
+\r
+    STDOUT->autoflush(1);\r
+    STDERR->autoflush(1);\r
+\r
+    $SIG{__DIE__} = sub {\r
+       print STDERR $_[0];\r
+       $self->stop;\r
+       die "\n";\r
+    };\r
+\r
+       $bStarted = 1;\r
+    return 1;\r
+}\r
+\r
+# 20070314 kpkoch:     \r
+#  There appears to be a bug in ActivePerl where Logger's games with streams\r
+#  and the SIG DIE handler cause eval to throw exceptions.  By deleting the DIE handler,\r
+#  subsequent evals do not fail.\r
+sub no_die_handler {\r
+       delete $SIG{__DIE__};\r
+       }\r
+\r
+sub stop {\r
+    my $self = shift;\r
+\r
+    return 0 if !$self->{PIPE};\r
+\r
+    STDOUT->close;\r
+    STDERR->close;\r
+    $self->{PIPE}->close;\r
+    STDOUT->fdopen(fileno $self->{OUT}, "w");\r
+    STDERR->fdopen(fileno $self->{ERR}, "w");\r
+    delete $self->{OUT};\r
+    delete $self->{ERR};\r
+    delete $self->{PIPE};\r
+       $bStarted = 0;\r
+    return 1;\r
+}\r
+\r
+sub DESTROY {\r
+    my $self = shift;\r
+       $self->stop     if ($bStarted);\r
+       }\r
+\r
+1;\r
index d7ca7a0c3abc28b343427cee443ff1df60cf8d8a..f018b348bdb97b00f67d040f9490bbb282469f96 100644 (file)
                                                                                                        <H2><FONT face="Verdana">Remaining work / bug list</FONT></H2>\r
                                                                                                        <P>This is a work in progress. What's left:</P>\r
                                                                                                        <UL>\r
-                                                                                                               <LI>\r
-                                                                                                                       <FONT face="Verdana">Add subversion for checking out krb5. </FONT>\r
-                                                                                                               <LI>\r
-                                                                                                                       <FONT face="Verdana">Allow empty cvs/svn tags to refer to the trunk. </FONT>\r
-                                                                                                               <LI>\r
-                                                                                                                       <FONT face="Verdana">Implement ways to skip full checkouts - doing updates or \r
-                                                                                                                               skipping the repository step completely. </FONT>\r
-                                                                                                               <LI>\r
-                                                                                                                       <FONT face="Verdana">Figure out which logging package to use and restore original \r
-                                                                                                                               build.pl logging functionality. </FONT>\r
-                                                                                                               <LI>\r
-                                                                                                                       <FONT face="Verdana">Pick an unzip package and add the unzip step for the sample \r
-                                                                                                                               config. Eliminate manual step. </FONT>\r
                                                                                                                <LI>\r
                                                                                                                        <FONT face="Verdana">Produce the remainder of the distribution components. [Listed \r
                                                                                                                                above.] </FONT>\r
index 900d4ca44c13afd52ef459c52c9cc4ea90b230d2..3785cd438efc9592ef34e8e6acfa3fb6b8ea7786 100644 (file)
@@ -5,17 +5,19 @@ use FindBin;
 use File::Spec;\r
 use File::Basename;\r
 use lib "$FindBin::Bin/build/lib";\r
-use ActivePerl::PPM::Logger;\r
 use Getopt::Long;\r
 use Cwd;\r
 use XML::Simple;\r
 use Data::Dumper;\r
+use Archive::Zip;\r
+use Logger;\r
+require "copyfiles.pl";\r
 \r
 my $BAIL;\r
 $0 = fileparse($0);\r
 my $OPT = {foo => 'bar'};\r
-\r
 my $MAKE = 'NMAKE';\r
+our $config;\r
 \r
 sub get_info\r
     {\r
@@ -35,23 +37,24 @@ Usage: $0 (-f --config) config-file [options] NMAKE-options
   Options are case insensitive.\r
 \r
   Options:\r
-    /help /?      usage information (what you now see)\r
-    /srcdir dir   Source directory to use.  Should contain \r
-                  pismere/athena.  If cvstag or svntag is null, \r
-                  the directory should be prepopulated.\r
-    /outdir dir   Directory to be created where build results will go\r
+    /help /?        usage information (what you now see).\r
+    /config path    Path to config file.\r
+    /srcdir dir     Source directory to use.  Should contain \r
+                    pismere/athena.  If cvstag or svntag is null, \r
+                    the directory should be prepopulated.\r
+    /outdir dir     Directory to be created where build results will go\r
     /repository checkout | co \\  What repository action to take.\r
                update   | up  ) Options are to checkout, update or \r
                skip          /  take no action [skip].\r
-    /cvstag tag \\ For whichever of these tags is specified,\r
-    /svntag tag / the repository action will be done into srcdir\r
-    /debug        Do debug make instead of release make\r
-    /nomake       Skip make step\r
-    /nopackage    Skip packaging step\r
-    /clean        Build clean target\r
-    /verbose      Debug mode - verbose output\r
-    /config path  Path to config file\r
-    /logfile path Where to write output.  If omitted, ...\r
+    /kerberos_id id kerberos id used to access svn if checking out.\r
+    /cvstag tag   \\ If non-empty, the tag is appended to cvs and svn\r
+    /svntag tag   / commands to select the rev to fetch.\r
+    /debug          Do debug make instead of release make.\r
+    /nomake         Skip make step.\r
+    /clean          Build clean target.\r
+    /nopackage      Skip packaging step.\r
+    /verbose        Debug mode - verbose output.\r
+    /logfile path   Where to write output.  If omitted, ...\r
   Other:\r
     NMAKE-options    any options you want to pass to NMAKE, which can be:\r
                      (note: /nologo is always used)\r
@@ -72,15 +75,6 @@ EOH
     $BAIL = $bailmsg.$warnmsg;\r
 }\r
 \r
-sub makeDir {\r
-       my ($path) = @_;\r
-       if (! -d $path) {\r
-               mkdir($path) or die "Fatal -- couldn't create $path";\r
-               print "Debug -- makeDir($path)\n";\r
-               }\r
-       else {print "Debug -- makeDir($path) -- directory already exists.\n";}\r
-       }\r
-\r
 sub main {\r
     Getopt::Long::Configure('no_bundling', 'no_auto_abbrev',\r
                            'no_getopt_compat', 'require_order',\r
@@ -97,10 +91,11 @@ sub main {
               'config|f:s',\r
               'logfile|l:s',\r
               'repository:s',\r
-              'clean',\r
+              'kerberos_id:s',\r
               'verbose',\r
               'vverbose',\r
               'nomake',\r
+              'clean',\r
               'nopackage',\r
               );\r
 \r
@@ -118,10 +113,8 @@ sub main {
       exit(0);\r
       }\r
 \r
-# #print Dumper($OPT);\r
-    \r
     # List of programs which must be in PATH:\r
-    my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', 'hhc', 'candle', 'light');\r
+    my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', 'hhc', 'candle', 'light', 'makensis', 'nmake');\r
     my $requirements_met = 1;\r
     my $first_missing = 0;\r
     my $error_list = "";\r
@@ -145,11 +138,9 @@ sub main {
        \r
     use Time::gmtime;\r
     $ENV{DATE} = gmctime()." GMT";\r
-       my $originalDir =`cd`;\r
+       our $originalDir = `cd`;\r
        $originalDir =~ s/\n//g;\r
 \r
-    my $errorState = 0;                ## Cumulative return code.  0 is success.\r
-\r
 ##++ Assemble configuration from config file and command line:\r
 \r
     my $configfile;\r
@@ -159,15 +150,14 @@ sub main {
 \r
     # Get configuration file:\r
        my $xml = new XML::Simple();\r
-       my $config = $xml->XMLin($configfile);\r
+       $config = $xml->XMLin($configfile);\r
 \r
        # Set up convenience variables:\r
-       my (@switches, @paths, @tags, @prepackage, @files);\r
+       my (@switches, @paths, @tags, @fetch);\r
        @switches               = $config->{CommandLine}->{Options};\r
        @paths                  = $config->{CommandLine}->{Directories};\r
        @tags                           = $config->{CommandLine}->{Tags};\r
-       @prepackage     = $config->{Stages}->{PrePackage};\r
-       @files                          = $config->{Stages}->{PrePackage}->{CopyList}->{Files};\r
+       @fetch                  = $config->{Stages}->{FetchSources}->{Config};\r
 \r
     # Update the configuration with overrides from the command line:\r
        $tags[0]->{cvs}->{value} = $OPT->{cvstag}                                                               if exists $OPT->{cvstag};\r
@@ -176,129 +166,186 @@ sub main {
     $paths[0]->{out}->{path} = $OPT->{outdir}                                                  if exists $OPT->{outdir};\r
     $switches[0]->{debug}->{value} = $OPT->{debug}                             if exists $OPT->{debug};\r
     $switches[0]->{clean}->{value} = 1                                                                                 if exists $OPT->{clean};\r
-    $switches[0]->{logfile}->{value} = 1                                                                                       if exists $OPT->{logfile};\r
     $switches[0]->{repository}->{value} = $OPT->{repository}   if exists $OPT->{repository};\r
+    $fetch[0]->{KERBEROS_ID}->{name} = $OPT->{kerberos_id}     if exists $OPT->{kerberos_id};\r
     $switches[0]->{nomake}->{value} = 1                                                                                if exists $OPT->{nomake};\r
     $switches[0]->{nopackage}->{value} = 1                                                                     if exists $OPT->{nopackage};\r
     $switches[0]->{verbose}->{value} = $OPT->{verbose}                 if exists $OPT->{verbose};\r
     $switches[0]->{vverbose}->{value} = $OPT->{verbose}                if exists $OPT->{vverbose};\r
        if (exists $OPT->{logfile}) {\r
-               $switches[0]->{log}->{path} = $OPT->{logfile};\r
-               $switches[0]->{log}->{value} = 1;\r
+               $switches[0]->{logfile}->{path} = $OPT->{logfile};\r
+               $switches[0]->{logfile}->{value} = 1;\r
                }\r
-    my $verbose                        = $config->{CommandLine}->{Options}->{verbose}->{value};\r
-    my $vverbose               = $config->{CommandLine}->{Options}->{vverbose}->{value};\r
+    our $verbose               = $config->{CommandLine}->{Options}->{verbose}->{value};\r
+    our $vverbose              = $config->{CommandLine}->{Options}->{vverbose}->{value};\r
+    our $clean                         = $switches[0]->{clean}->{value};\r
+       my $src                                 = $paths[0]->{src}->{path};\r
 \r
-       if ($switches[0]->{clean}->{value} && !$switches[0]->{nopackage}->{value}) {\r
+       if ($clean && !$switches[0]->{nopackage}->{value}) {\r
                print "Info -- /clean forces /nopackage.\n";\r
                $switches[0]->{nopackage}->{value} = 1;\r
                }\r
 \r
-       my $i = 0;\r
-       # See if there is an included file list:\r
-       if (exists $files[0]->{Include}->{path}) {\r
-               my $configfile2 = $files[0]->{Include}->{path};\r
-               print "Info -- Including files to be copied from $configfile2.\n";\r
-               my $config2 = $xml->XMLin($configfile2);\r
-               while ($config2->{File}[$i]) {\r
-                       $files[0]->{File}[++$#{$files[0]->{File}}] = $config2->{File}[$i];\r
-                       $i++;\r
-                       }\r
-               }\r
-               \r
-    if ($vverbose) {print Dumper($config);}\r
+    if ($vverbose) {print "Debug -- Config: ".Dumper($config);}\r
     \r
        # Examples of use:\r
        #print "Logfile path: $switches[0]->{log}->{path}\n";\r
        #print "src path: $paths[0]->{src}->{path}\n";\r
        #print "cvs tag: $tags[0]->{cvs}->{value}\n";\r
-       #print "CVSROOT:   $config->{Config}->{CVSROOT}->{name}\n";\r
+       #print "CVSROOT:   $fetch[0]->{CVSROOT}->{name}\n";\r
 \r
 ##-- Assemble configuration from config file and command line.\r
 \r
-# Begin logging:\r
-    my $l;\r
-    if ($OPT->{logfile}) {\r
-#              $l = new Logger $OPT->{logfile} or die "Fatal -- Can't create Logger.";\r
-#              $l->start;\r
-               }\r
-\r
-##++ Begin repository action:\r
        my $sw = $switches[0]->{repository}->{value};\r
        my $rverb;\r
-       if ($sw =~ /skip/i)                             {print "Info -- Skipping repository access.\n";}\r
-       elsif ($sw =~ /update/i)                {$rverb = "update";}\r
-       elsif ($sw =~ /up/i)                            {$rverb = "update";}\r
-       elsif ($sw =~ /checkout/i)      {$rverb = "checkout";}\r
-       elsif ($sw =~ /co/i)                            {$rverb = "checkout";}\r
+       if              ($sw =~ /skip/i)                        {$rverb = "skip";}\r
+       elsif   ($sw =~ /update/i)              {$rverb = "update";}\r
+       elsif   ($sw =~ /up/i)                          {$rverb = "update";}\r
+       elsif   ($sw =~ /checkout/i)    {$rverb = "checkout";}\r
+       elsif   ($sw =~ /co/i)                          {$rverb = "checkout";}\r
        else {\r
                        print "Fatal -- invalid /repository value.\n";\r
                        usage();\r
                        die;\r
                        }\r
 \r
-       my $wd  = $paths[0]->{src}->{path}."\\pismere";\r
-       \r
-       if ($rverb) {\r
+       my $wd  = $src."\\pismere";\r
+\r
+       if ($rverb =~ /checkout/) {\r
+               print "\n\nHEADS UP!!\n\n";\r
+               print "/REPOSITORY CHECKOUT will cause everything under $wd to be deleted.\n";\r
+               print "If this is not what you intended, here's your chance to bail out!\n\n\n";\r
+               print "Are you sure you want to remove everything under $wd? ";\r
+               my $char = getc;\r
+               if (! ($char =~ /y/i)) {die "Info -- operation aborted by user."}\r
+               !system("rm -rf $wd/*")                                         or die "Fatal -- Couldn't clean $wd.";\r
+               !system("rmdir $wd")                                                    or die "Fatal -- Couldn't remove $wd.";\r
+#              !system("attrib -h -r $wd\\* /s /d")    or die "Fatal -- Couldn't clear read-only attributes.";\r
+#              !system("del /s /q $wd\\*.*")                           or die "Fatal -- Couldn't clean files from $wd."; \r
+#              !system("rm -rf $wd\\*.*")                                      or die "Fatal -- Couldn't clean directories from $wd.";\r
+               }\r
+\r
+# Begin logging:\r
+    my $l;\r
+    if ($switches[0]->{logfile}->{value}) {\r
+               print "Info -- logging to $switches[0]->{logfile}->{path}.\n";\r
+               $l = new Logger $switches[0]->{logfile}->{path};\r
+               $l->start;\r
+               $l->no_die_handler;             ## Needed so XML::Simple won't throw exceptions.\r
+               }\r
+\r
+##++ Begin repository action:\r
+       if ($rverb =~ /skip/) {print "Info -- *** Skipping repository access.\n"        if ($verbose);}\r
+       else {\r
                if ($verbose) {print "Info -- *** Begin fetching sources.\n";}\r
 \r
+               # Set up cvs environment variables:\r
+               $ENV{CVSROOT} = $fetch[0]->{CVSROOT}->{name};\r
+               chdir($src)                                                                                     or die "Fatal -- couldn't chdir to $src\n";\r
+               print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
                my $krb5dir     = $wd."\\athena\\auth\\krb5";\r
 \r
-               # If we are fetching into a new directory, the directory structure won't exist and many cd commands will fail.\r
-               # Use an xcopy to create the directory paths we will need:\r
-               !system("echo tempfile > kpk.tmp") or die "Fatal -- Couldn't creqte a simple temp file.\n";\r
-               !system("echo F | xcopy /y kpk.tmp $krb5dir") or die "Fatal -- Couldn't create path $krb5dir\n";\r
-               !system("del kpk.tmp") or die "Fatal -- Couldn't clean up temporary file.\n";\r
-               \r
-               chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";\r
-               if ($verbose) {print "Info -- chdir to $wd\n";}\r
-               \r
-               #if (! -d "pismere")                                    {print "Warning -- can't find pismere in $wd.  It will be created.\n";}\r
-               if (! -d "athena")      {print "Warning -- can't find pismere\\athena in $wd.  It will be created.\n";}\r
-               \r
-               # [TODO] Set up cvs environment variables:\r
-               my $cvscmd = "cvs $rverb ";\r
-               if ($tags[0]->{cvs}->{value}) {$cvscmd .= $tags[0]->{cvs}->{value};}\r
-               !system($cvscmd) or die "Fatal -- command \"$cvscmd\" failed; return code $?\n";\r
-               \r
-               # [TODO] Set up svn environment variables:\r
-               chdir("$krb5dir") or die "Fatal -- couldn't chdir to $krb5dir\n";\r
-               if ($verbose) {print "Info -- chdir to $krb5dir\n";}\r
+               my $cvscmdroot  = "cvs $rverb";\r
+               my $cvscmd                      = $cvscmdroot;\r
+               if ($rverb =~ /checkout/) {             \r
+                       my @cvsmodules  = (     \r
+                               'krb',  \r
+                               'pismere/athena/util/lib/afscompat', \r
+                               'pismere/athena/util/lib/delaydlls', \r
+                               'pismere/athena/util/lib/getopt', \r
+                               'pismere/athena/util/guiwrap'\r
+                               );\r
+#                              'pismere/athena/util/lib', \r
+\r
+                       foreach my $module (@cvsmodules) {\r
+                               $cvscmd = $cvscmdroot." ".$module;\r
+                               $cvscmd .= " ".$tags[0]->{cvs}->{value} if ($tags[0]->{cvs}->{value});\r
+                               if ($verbose) {print "Info -- cvs command: $cvscmd\n";}\r
+                               !system($cvscmd)                                                                or die "Fatal -- command \"$cvscmd\" failed; return code $?\n";\r
+                               }\r
+                       }\r
+               else {                          ## Update.\r
+                       $cvscmd = $cvscmdroot;\r
+                       $cvscmd .= " ".$tags[0]->{cvs}->{value} if ($tags[0]->{cvs}->{value});\r
+                       if ($verbose) {print "Info -- cvs command: $cvscmd\n";}\r
+                       !system($cvscmd)                                                                        or die "Fatal -- command \"$cvscmd\" failed; return code $?\n";\r
+                       }\r
+                                       \r
+               # Set up svn environment variables:\r
+               my $dblback_plink       = $fetch[0]->{KRB_PLINK}->{name};\r
+               $dblback_plink =~ s/\\/\\\\/g;\r
+               $ENV{SVN_SSH} = $dblback_plink;\r
+               # If  the directory structure doesn't exist, many cd commands will fail.\r
+               mkdir($krb5dir);\r
+               chdir($krb5dir)                                                                                 or die "Fatal -- couldn't chdir to $krb5dir\n";\r
+               print "Info -- chdir to ".`cd`."\n"                     if ($verbose);\r
                my $svncmd = "svn $rverb ";\r
-               if ($tags[0]->{svn}->{value}) {$svncmd .= $tags[0]->{svn}->{value};}\r
-               !system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n";\r
-               \r
+               if ($rverb =~ /checkout/) {             # Append the rest of the checkout command:\r
+                       chdir("..");\r
+                       $svncmd .= "svn+ssh://".$fetch[0]->{KERBEROS_ID}->{name}."@".$fetch[0]->{SVNURL}->{name}."/krb5/trunk krb5";\r
+                       }\r
+               if ($tags[0]->{svn}->{value}) {$svncmd .= " ".$tags[0]->{svn}->{value};}        # Add any specific tag\r
+               if ($verbose) {print "Info -- svn command: $svncmd\n";}\r
+               !system($svncmd)                        or die "Fatal -- command \"$svncmd\" failed; return code $?\n";\r
+\r
                if ($verbose) {print "Info -- ***   End fetching sources.\n";}\r
                }\r
 ##-- End  repository action.\r
-       \r
-       if ($verbose) {print "Info -- *** Begin preparing for build.\n";}\r
-       $wd = $paths[0]->{src}->{path};\r
-       chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";\r
-       if ($verbose) {print "Info -- chdir to $wd\n";}\r
+               \r
+       if (    (!$switches[0]->{nomake}->{value}) ) {\r
+               if ($verbose) {print "Info -- *** Begin preparing for build.\n";}\r
 \r
-       my ($path, $destpath);\r
-       \r
-       # Copy athena\scripts\site\graft\krb5\Makefile.src to athena\auth\krb5:\r
-       $path = "pismere\\scripts\\site\\graft\\krb5\\Makefile.src";\r
-       if (!-e  $path) {die "Fatal -- Expected file $wd\\$path not found.";}\r
-       $destpath = "pismere\\athena\\auth\\krb5\\Makefile.src";\r
-       !system("echo F | xcopy /D $wd\\$path $wd\\$destpath /Y > NUL") or die "Fatal -- Copy of $wd\\$path to $wd\\$destpath failed.";\r
-       print "Info -- copied $wd\\$path to $wd\\$destpath\n";\r
-       \r
-       # Add DEBUG_SYMBOL to .../wshelper/Makefile.src:\r
-       $path = "pismere\\athena\\wshelper\\wshelper\\Makefile.src";\r
-       if (!-e  $path) {die "Fatal -- Expected file $wd\\$path not found.";}\r
-       if (system("grep DEBUG_SYMBOL $path > NUL") != 0) {\r
-               !system ("echo DEBUG_SYMBOL=1 >> $wd\\$path") or die "Fatal -- Append line to file failed.\n";\r
-               print "Info -- Added DEBUG_SYMBOL to $wd\\$path\n";\r
-               }\r
+               $wd = $paths[0]->{src}->{path};\r
+               chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";\r
+               print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
        \r
-       if ($verbose) {print "Info -- ***   End preparing for build.\n";}\r
+               my ($path, $destpath);\r
+               \r
+               # Copy athena\scripts\site\graft\krb5\Makefile.src to athena\auth\krb5:\r
+               $path = "pismere\\scripts\\site\\graft\\krb5\\Makefile.src";\r
+               if (!-e  $path) {die "Fatal -- Expected file $wd\\$path not found.";}\r
+               $destpath = "pismere\\athena\\auth\\krb5\\Makefile.src";\r
+               !system("echo F | xcopy /D $wd\\$path $wd\\$destpath /Y > NUL") or die "Fatal -- Copy of $wd\\$path to $wd\\$destpath failed.";\r
+               print "Info -- copied $wd\\$path to $wd\\$destpath\n"           if ($verbose);;\r
+               \r
+               # Add DEBUG_SYMBOL to .../wshelper/Makefile.src:\r
+               $path = "pismere\\athena\\wshelper\\wshelper\\Makefile.src";\r
+               if (!-e  $path) {die "Fatal -- Expected file $wd\\$path not found.";}\r
+               if (system("grep DEBUG_SYMBOL $path > NUL") != 0) {\r
+                       !system ("echo DEBUG_SYMBOL=1 >> $wd\\$path") or die "Fatal -- Append line to file failed.\n";\r
+                       print "Info -- Added DEBUG_SYMBOL to $wd\\$path\n"      if ($verbose);\r
+                       }\r
+               \r
+               # Prune any unwanted directories before the build:\r
+               if (exists $config->{Stages}->{Make}->{Prunes}) {\r
+                       # Use Unix find instead of Windows find.  Save PATH so we can restore it when we're done:\r
+                       my $savedPATH   = $ENV{PATH};\r
+                       $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;\r
+                       my $prunes = $config->{Stages}->{Make}->{Prunes};\r
+                       my $j=0;\r
+                       print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);\r
+                       while ($prunes->{Prune}->[$j]) {\r
+                               if (exists $prunes->{Prune}->[$j]->{name}) {                                            ## Don't process dummy entry!\r
+                                       my $prune       = $prunes->{Prune}->[$j]->{name};\r
+                                       my $flags       = $prunes->{Prune}->[$j]->{flags};\r
+                                       $flags = "" if (!$flags);\r
+                                       my $cmd = "find . -".$flags."name $prune";\r
+                                       print "Info -- Looking for filenames containing $prune\n";\r
+                                       my $list = `$cmd`;\r
+                                       foreach $target (split("\n", $list)) {\r
+                                               print "Info -- Pruning $target\n" if ($verbose);\r
+                                               ! system("rm -rf $target")                              or die "Unable to prune $target";\r
+                                               }\r
+                                       }\r
+                               $j++;\r
+                               }\r
+                       $ENV{PATH} = $savedPATH;\r
+                       }\r
+\r
+               if ($verbose) {print "Info -- ***   End preparing for build.\n";}\r
        \r
-       if (!$switches[0]->{nomake}->{value}) {\r
                my ($buildtarget, $buildtext);\r
-               if ($switches[0]->{clean}->{value}) {\r
+               if ($clean) {\r
                        $buildtarget = "clean" ;\r
                        $buildtext = " clean."\r
                        }\r
@@ -306,14 +353,13 @@ sub main {
                        $buildtarget = "" ;\r
                        $buildtext = "."\r
                        }\r
-               if ($verbose) {print "Info -- *** Begin build".$buildtext."\n";}\r
                \r
                chdir("pismere/athena") or die "Fatal -- couldn't chdir to source directory $wd\\pismere\\athena\n";\r
                if ($verbose) {print "Info -- chdir to $wd\\pismere\\athena\n";}\r
                        !system("perl ../scripts/build.pl --softdirs $buildtarget")     or die "Fatal -- build $buildtarget failed.";\r
                        \r
-               chdir("..") or die "Fatal -- couldn't chdir to $wd\\pismere.";\r
-               if ($switches[0]->{clean}->{value}) {\r
+               chdir("$wd\\pismere") or die "Fatal -- couldn't chdir to $wd\\pismere.";\r
+               if ($clean) {\r
                        if (-d "staging") {\r
                                !system("rm -rf staging") or die "Fatal -- Couldn't remove pismere/staging.";\r
                                }\r
@@ -321,97 +367,29 @@ sub main {
        \r
                if ($verbose) {print "Info -- ***   End build".$buildtext."\n";}\r
                }                               ## End make conditional.\r
-       \r
-       if (!$switches[0]->{nopackage}->{value}) {\r
-               if ($verbose) {print "Info -- *** Begin prepackage.\n";}\r
+       else {print "Info -- *** Skipping build.\n"     if ($verbose);}\r
                \r
+       if (!$switches[0]->{nopackage}->{value}) {              ## If /clean, this switch will have been cleared.\r
+               if ($verbose) {print "Info -- *** Begin prepackage.\n";}\r
                # The build results are copied to a staging area, where the packager expects to find them.\r
                #  We put the staging area in the fixed area .../pismere/staging.\r
+               my $prepackage  = $config->{Stages}->{PrePackage};\r
                $wd = $paths[0]->{src}->{path}."\\pismere";\r
                my $staging_area = "$wd\\staging";\r
                chdir($wd) or die "Fatal -- couldn't chdir to $wd\n";\r
                if ($verbose) {print "Info -- chdir to $wd\n";}\r
-               (-e $staging_area) or makeDir($staging_area);\r
-               \r
-               my $src = $paths[0]->{src}->{path};\r
-               my $CopyList                    = $prepackage[0]->{CopyList};\r
-               \r
-               # A path can contain a variable part, which will be handled here.  If the variable part is \r
-               # the Always or BuildDependent tag, then the variable will be changed to the \r
-               # build-type-dependent PathFragment.\r
-               # If the variable part is the IgnoreTag, then the file will not be copied.\r
-               my ($PathFragment, $BuildDependentTag, $IgnoreTag); \r
-       \r
-               my $AlwaysTag                           = $CopyList->{Config}->{AlwaysTag}->{value};\r
-               if ($switches[0]->{debug}->{value}) {           ## Debug build tags:\r
-                       $PathFragment                           = $CopyList->{Config}->{DebugArea}->{value};\r
-                       $BuildDependentTag      = $CopyList->{Config}->{DebugTag}->{value};\r
-                       $IgnoreTag                                      = $CopyList->{Config}->{ReleaseTag}->{value};\r
-                       }\r
-               else {                                                                                                                          ## Release build tags:\r
-                       $PathFragment                           = $CopyList->{Config}->{ReleaseArea}->{value};\r
-                       $BuildDependentTag      = $CopyList->{Config}->{ReleaseTag}->{value};\r
-                       $IgnoreTag                                      = $CopyList->{Config}->{DebugTag}->{value};\r
-                       }                       \r
-       \r
-               # Copy all the files in the CopyList:\r
-               $i = 0;\r
-               my $nfiles                      = 0;\r
-               my $bOldDot     = 1;\r
-               my $bDot                        = 0;\r
-               while ($files[0]->{File}[$i]) {\r
-                       my ($name, $newname, $from, $to, $ignore);\r
-                       $name           = $files[0]->{File}->[$i]->{name};\r
-                       if (exists $files[0]->{File}->[$i]->{newname})  {$newname = $files[0]->{File}->[$i]->{newname};}\r
-                       else                                                                                                                                                            {$newname = $name;}\r
-                       if ($name) {\r
-                               $ignore = 0;\r
-                               $from   = "$src\\pismere\\athena\\$files[0]->{File}->[$i]->{from}\\$name";\r
-                               $to             = "$src\\pismere\\staging\\$files[0]->{File}->[$i]->{to}\\$newname";\r
-                               if (index($from.$to, $IgnoreTag) <0) {                                  ## Test for IgnoreTag\r
-                                       # Apply PathTag substitutions:\r
-                                       $from   =~ s/$AlwaysTag/$PathFragment/g;\r
-                                       $to             =~ s/$AlwaysTag/$PathFragment/g;\r
-                                       $from   =~ s/$BuildDependentTag/$PathFragment/g;\r
-                                       $to             =~ s/$BuildDependentTag/$PathFragment/g;\r
-                                       # We use xcopy instead of copy because it will create directories for us:\r
-                                       if (system("echo F | xcopy /D /F /Y $from $to > a.tmp 2>NUL") != 0) {\r
-                                               # xcopy failed.  \r
-                                               if (!exists $files[0]->{File}->[$i]->{notrequired}) {\r
-                                                       ( -e $from) or die "Fatal -- can't find $from";\r
-                                                       die "Fatal -- Copy of $from to $to failed";\r
-                                                       }\r
-                                               }\r
-                                       else {          ## To show progress when files aren't copied, print a string of dots.\r
-                                               open(MYINPUTFILE, "<a.tmp");\r
-                                               my(@lines) = <MYINPUTFILE>;\r
-                                               foreach $line (@lines) { \r
-                                                       $bDot = ($line =~ /^0/);\r
-                                                       }\r
-                                               close(MYINPUTFILE);\r
-                                               if (!$bDot && $bOldDot) {print "\n";}\r
-                                               if ($bDot) {print ".";}\r
-                                               else {print "$from copied to $to\n";}\r
-                                               $bOldDot = $bDot;\r
-                                               }\r
-                                       }\r
-                               }\r
-                       $i++;\r
-                       }\r
-               if ($bDot) {print "\n";}\r
-                       \r
-#              # Copy the extras:\r
-#              print "Info -- Absent a way of scripting unzip, the instructions require manually unzipping into\n";\r
-#              print "        the target area $src\\pismere\\staging.\n";\r
-#              # my $extradir = $paths[0]->{extras}->{path};\r
-#              # !system("xcopy /d/f/y/s $src\\pismere\\athena\\$extradir\\* $src\\pismere\\staging") or die "Fatal -- Couldn't copy extras from $src\\pismere\\athena\\$extradir";\r
+               (-e $staging_area) or mkdir($staging_area);\r
                \r
+               # Force Where From and To are relative to:\r
+               $prepackage->{CopyList}->{Config}->{From}->{root}               = "$src\\pismere\\athena";\r
+               $prepackage->{CopyList}->{Config}->{To}->{root}                 = "$src\\pismere\\staging";\r
+               copyFiles($prepackage->{CopyList}, $config);            ## Copy any files\r
+\r
                chdir("staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
-               \r
+               print "Info -- chdir to ".`cd`."\n"                                                                             if ($verbose);\r
                # Correct errors in files.wxi:\r
                !system("sed 's/WorkingDirectory=\"\\[dirbin\\]\"/WorkingDirectory=\"dirbin\"/g' files.wxi > a.tmp") or die "Fatal -- Couldn't modify files.wxi.";\r
-               !system("copy /y a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi.";\r
-               !system("del a.tmp") or print "Warning -- Couldn't clean up temporary file $wd\\staging\\installer\\wix\\a.tmp.\n";\r
+               !system("mv a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi.";\r
                        \r
                # Update paths in site-local.wxi:\r
                my $dblback_originalDir = $originalDir;\r
@@ -419,29 +397,141 @@ sub main {
                !system("sed -f $dblback_originalDir\\site-local.sed site-local.wxi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi.";\r
                my $hexback_wd = $wd;\r
                $hexback_wd =~ s/\\/\\\\\\\\\\\\/g;\r
-               !system("sed 's/%%TARGETDIR%%/$hexback_wd\\\\\\staging\\\\\\/' b.tmp > c.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";        \r
-               !system("sed 's/%%CONFIGDIR%%/$hexback_wd\\\\\\staging\\\\\\sample\\\\\\/' c.tmp > d.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";    \r
-               !system("copy /y d.tmp site-local.wxi") or die "Fatal -- Couldn't replace site-local.wxi.";\r
-       \r
-               # Copy krb.conf from ...\athena\auth\krb5\src\config-files      to pismere\staging\samples\krb5.ini:\r
-               !system("echo F | xcopy /D $wd\\athena\\auth\\krb5\\src\\config-files\\krb5.conf $wd\\staging\\sample\\krb5.ini") \r
-                       or die "Fatal -- Couldn't update $wd\\staging\\sample\\krb5.ini.";\r
-       \r
+               !system("sed 's/%%TARGETDIR%%/$hexback_wd\\\\\\staging\\\\\\/' b.tmp > c.tmp")                                                  or die "Fatal -- Couldn't modify site-local.wxi temporary file.";       \r
+               !system("sed 's/%%CONFIGDIR%%/$hexback_wd\\\\\\staging\\\\\\sample\\\\\\/' c.tmp > d.tmp")      or die "Fatal -- Couldn't modify site-local.wxi temporary file.";       \r
+               !system("mv d.tmp site-local.wxi")                                                                                                                                                                                                                                              or die "Fatal -- Couldn't replace site-local.wxi.";\r
+                               \r
                if ($verbose) {print "Info -- ***   End prepackage.\n";}\r
                \r
-               # Make the msi:\r
-               !system("nmake") or die "Fatal -- Couldn't make kfw.msi.";\r
-       \r
                if ($verbose) {print "Info -- *** Begin package.\n";}\r
+               # Make the msi:\r
+               chdir("$wd\\staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
+               print "Info -- *** Make .msi:\n"                                                        if ($verbose);\r
+               !system("$MAKE")                                                                                                        or die "Error -- msi installer build failed.";\r
+                               \r
+               chdir("$wd\\staging\\install\\nsis") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\nsis";\r
+               print "Info -- chdir to ".`cd`."\n"                                             if ($verbose);\r
+               print "Info -- *** Make NSIS:\n"                                                        if ($verbose);\r
+               !system("cl.exe killer.cpp advapi32.lib")                       or die "Error -- nsis killer.exe not built.";\r
+               !system("rename killer.exe Killer.exe")                         or die "Error -- Couldn't rename killer.exe";\r
+               !system("makensis kfw.nsi")                                                             or die "Error -- executable installer build failed.";\r
+\r
+# Begin packaging extra items:\r
+               my $fromRoot    = $paths[0]->{src}->{path};\r
+               my $toRoot              = $paths[0]->{out}->{path};\r
+               chdir($fromRoot);               # Now in <src>.\r
+               print "Info -- chdir to ".`cd`."\n"                                                                             if ($verbose);\r
+               system("rm -rf $toRoot")                                                                                                        if (-d $toRoot);\r
+               die "Fatal -- Couldn't remove $fromRoot\\$toRoot."      if (-d $toRoot);\r
+               mkdir($toRoot);\r
+               my $zipsXML = $config->{Stages}->{PostPackage}->{Zips};\r
+\r
+               $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{From}->{root}          = "$src\\pismere";              ## Used after zips are made.\r
+               $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{To}->{root}                    = "$src\\$toRoot\\ziptemp";\r
+               my $filestem            = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};\r
+\r
+               local $i = 0;\r
+               while ($zipsXML->{Zip}[$i]) {\r
+                       my $zip = $zipsXML->{Zip}[$i];\r
+                       if (exists $zip->{name}) {                                                                                              ## Ignore dummy entry.\r
+                               my $zipname     = $zip->{filename};\r
+                               $zipname                        =~ s/%filestem%/$filestem/g;\r
+                               my $bMakeIt             = 1;\r
+                               if (exists $zip->{Requires}) {\r
+                                       local $j = 0;\r
+                                       while ($zip->{Requires}->{Switch}[$j]) {                                ## Check Require switches\r
+                                               local $switch   = $zip->{Requires}->{Switch}[$j];\r
+                                               if (exists $switch->{name}) {                                                           ## Ignore dummy entry\r
+                                                       # We handle REPOSITORY and CLEAN switches:\r
+                                                       if ($switch->{name} =~ /REPOSITORY/i) {\r
+                                                               $bMakeIt &&= ($switch->{value} =~ /$rverb/i);   ## Repository verb must match requirement\r
+                                                               }\r
+                                                       elsif ($switch->{name} =~ /CLEAN/i) {           ## Clean must be specified\r
+                                                               $bMakeIt &&= $clean;\r
+                                                               }\r
+                                                       else {print "Error -- Unsupported switch $switch->{name} in Requires in ".Dumper($zip);}\r
+                                                       }\r
+                                               $j++;\r
+                                               }\r
+                                       if ( !$bMakeIt && (exists $zip->{Requires}->{ErrorMsg}) ) {\r
+                                               print "Error -- $zip->{Requires}->{ErrorMsg}->{text}\n";\r
+                                               }\r
+                                       }\r
+                               if ($bMakeIt) {\r
+                                       my $todir                       = "$src\\$toRoot\\ziptemp";\r
+                                       system("rm -rf $todir")                                                         if (-d $todir);\r
+                                       die "Fatal -- Couldn't remove $todir"           if (-d $todir);\r
+                                       mkdir($todir);\r
+#      Add to the zip's config section.  Don't copy Postpackage->Config, because the Zip's Config might contain substitution tags.\r
+                                       $zip->{CopyList}->{Config}->{FileStem}                          = $config->{Stages}->{PostPackage}->{Config}->{FileStem};               ## Each zip uses the post package config.\r
+                                       $zip->{CopyList}->{Config}->{From}->{root}              = "$src\\pismere";                                                              ## Used by zips\r
+                                       $zip->{CopyList}->{Config}->{To}->{root}                        = "$src\\$toRoot\\ziptemp\\$zip->{topdir}";\r
+                                       copyFiles($zip->{CopyList}, $config);\r
+                                       # Drop down into <out>/ziptemp so the path to the added file won't include <out>:\r
+                                       chdir $todir;\r
+                                       print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
+\r
+                                       # Prune any unwanted files or directories from the directory we're about to zip:\r
+                                       if (exists $zip->{Prunes}) {\r
+                                               # Use Unix find instead of Windows find.  Save PATH so we can restore it when we're3 done:\r
+                                               my $savedPATH   = $ENV{PATH};\r
+                                               $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;\r
+                                               my $prunes = $zip->{Prunes};\r
+                                               my $j=0;\r
+                                               print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);\r
+                                               while ($prunes->{Prune}->[$j]) {\r
+                                                       if (exists $prunes->{Prune}->[$j]->{name}) {                                            ## Don't process dummy entry!\r
+                                                               my $prune       = $prunes->{Prune}->[$j]->{name};\r
+                                                               my $flags       = $prunes->{Prune}->[$j]->{flags};\r
+                                                               $flags = "" if (!$flags);\r
+                                                               my $cmd = "find . -".$flags."name $prune";\r
+                                                               print "Info -- Looking for filenames containing $prune\n";\r
+                                                               my $list = `$cmd`;\r
+                                                               foreach $target (split("\n", $list)) {\r
+                                                                       print "Info -- Pruning $target\n" if ($verbose);\r
+                                                                       !system("rm -rf $target")                       or die "Error -- Couldn't remove $target.";;\r
+                                                                       }\r
+                                                               }\r
+                                                       $j++;\r
+                                                       }\r
+                                               $ENV{PATH} = $savedPATH;\r
+                                               }\r
+\r
+                                       my $zipfile                     = Archive::Zip->new();\r
+                                       my $topdir              = $zip->{topdir};\r
+                                       $topdir                         =~ s/%filestem%/$filestem/g;\r
+                                       $zipfile->addTree('.', $topdir);\r
+                                       if (-e $zipname)        {!system("rm -f $zipname")      or die "Error -- Couldn't remove $zipname.";}\r
+                                       $zipfile->writeToFileNamed($zipname);\r
+                                       print "Info -- created $src\\$toRoot\\$zipname.\n"      if ($verbose);\r
+                                       !system("mv -f $zipname  ..")                                   or die "Error -- Couldn't move $zipname to ..";\r
+                                       chdir "..";                                             ## Back to <out>\r
+                                       print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
+                                       }                                               ## End else OK to process zip\r
+                               }                                                       ## End not the dummy entry\r
+                               $i++;                                   \r
+                       }                                                               ## End zip in xml.\r
+                               \r
+               $todir  = "$src\\$toRoot\\ziptemp";                                     ## Clean up any temp directory.\r
+               system("rm -rf $todir")                                                                                 if (-d $todir);\r
+                               \r
+               my $out         = $config->{CommandLine}->{Directories}->{out}->{path};\r
+               $config->{Stages}->{PostPackage}->{CopyList}->{Config} = $config->{Stages}->{PostPackage}->{Config};            ## Use the post package config.\r
+               $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{From}->{root}          = "$src\\pismere";\r
+               $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{To}->{root}                    = "$src\\$out";\r
+               copyFiles($config->{Stages}->{PostPackage}->{CopyList}, $config);                       ## Copy any files\r
                if ($verbose) {print "Info -- ***   End package.\n";}\r
-               }                                               ## End package conditional.\r
-       \r
-#End logging:\r
-#    if (!$OPT->{nolog}) {\r
-#              $l->stop;\r
-#              }\r
+               }\r
+       else {\r
+               print "Info -- Package step skipped.";\r
+               }\r
+\r
+       system("rm -rf $src/a.tmp");                                                                    ## Clean up junk.\r
+                               \r
+# End logging:\r
+    if ($switches[0]->{logfile}->{value})      {$l->stop;}\r
 \r
-    return $errorState;\r
+    return 0;\r
        }                                                       ## End subroutine main.\r
 \r
 $SIG{'INT'} = \&handler;\r
diff --git a/src/windows/build/copyfiles.pl b/src/windows/build/copyfiles.pl
new file mode 100644 (file)
index 0000000..a6b4ede
--- /dev/null
@@ -0,0 +1,132 @@
+#!perl -w\r
+\r
+#use strict;\r
+use XML::Simple;\r
+use Data::Dumper;\r
+\r
+sub copyFiles {\r
+       local ($xml, $config)   = @_;\r
+       local @switches                         = $config->{CommandLine}->{Options};\r
+       local @files                                            = $xml->{Files};\r
+       # Check for includes:\r
+       if (exists $xml->{Files}->{Include}->{path}) {\r
+               my $includepath = $xml->{Files}->{Include}->{path};\r
+               print "Info -- Including files from $includepath\n";\r
+               my $savedDir = `cd`;\r
+               $savedDir =~ s/\n//g;\r
+               chdir $originalDir;                                                                             ## Includes are relative to where we were invoked.\r
+               print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
+               my $tmp = new XML::Simple;\r
+               my $includeXML = $tmp->XMLin($includepath);\r
+               chdir $savedDir;\r
+               print "Info -- chdir to ".`cd`."\n"                             if ($verbose);\r
+\r
+               local $i = 0;\r
+               while ($includeXML->{File}[$i]) {                               ## Copy File entries from includeXML.\r
+                       $files[0]->{File}[++$#{$files[0]->{File}}] = $includeXML->{File}[$i];           \r
+                       $i++;\r
+                       }\r
+               delete $files->{Include};\r
+               }\r
+       ##++ Set up path substitution variables for use inside the copy loop:\r
+       # A path can contain a variable part, which will be handled here.  If the variable part is \r
+       # the Always or BuildDependent tag, then the variable will be changed to the \r
+       # build-type-dependent PathFragment.\r
+       # If the variable part is the IgnoreTag, then the file will not be copied.\r
+       # If the variable part is %filestem%, it will be replaced with Config->FileStem->name.\r
+       my ($PathFragment, $BuildDependentTag, $IgnoreTag, $FileStemFragment, $fromRoot, $toRoot); \r
+       my $bPathTags   = (exists $xml->{Config}->{DebugArea}) && (exists $xml->{Config}->{ReleaseArea});\r
+       my $bFileStem   = (exists $xml->{Config}->{FileStem});\r
+       \r
+       if ($switches[0]->{debug}->{value}) {           ## Debug build tags:\r
+               $PathFragment                           = $xml->{Config}->{DebugArea}->{value};\r
+               $BuildDependentTag      = $xml->{Config}->{DebugTag}->{value};\r
+               $IgnoreTag                                      = $xml->{Config}->{ReleaseTag}->{value};\r
+               }\r
+       else {                                                                                                                          ## Release build tags:\r
+               $PathFragment                           = $xml->{Config}->{ReleaseArea}->{value};\r
+               $BuildDependentTag      = $xml->{Config}->{ReleaseTag}->{value};\r
+               $IgnoreTag                                      = $xml->{Config}->{DebugTag}->{value};\r
+               }                       \r
+       my $AlwaysTag                           = $xml->{Config}->{AlwaysTag}->{value};\r
+       $FileStemFragment                       = $xml->{Config}->{FileStem}->{name};   \r
+       $fromRoot                                                       = $xml->{Config}->{From}->{root};       \r
+       $toRoot                                                         = $xml->{Config}->{To}->{root}; \r
+       ##-- Set up path substitution variables for use inside the copy loop.\r
+       # For each file in the file list:\r
+       #  Substitute any variable parts of the path name.\r
+       #  Handle wildcards\r
+       #  Copy\r
+\r
+       local $i = 0;\r
+       my $bOldDot     = 1;\r
+       my $bDot                        = 0;\r
+       while ($files[0]->{File}[$i]) {\r
+\r
+               my ($name, $newname, $from, $to, $file);\r
+               $file                   = $files[0]->{File}->[$i];\r
+               $name   = $file->{name};\r
+               if (exists $file->{newname})    {$newname = $file->{newname};}\r
+               else                                                                                            {$newname = $name;}\r
+               if ($name && (! exists $file->{ignore})) {              ## Ignore or process this entry?\r
+                       $from   = "$fromRoot\\$file->{from}\\$name";\r
+                       $to             = "$toRoot\\$file->{to}\\$newname";\r
+                       if ( $bPathTags || $bFileStem || (index($from.$to, $IgnoreTag) <0) ) {          ## Copy this file?\r
+                               if ($bPathTags) {                                                                               ## Apply PathTag substitutions:\r
+                                       $from   =~ s/$AlwaysTag/$PathFragment/g;\r
+                                       $to             =~ s/$AlwaysTag/$PathFragment/g;\r
+                                       $from   =~ s/$BuildDependentTag/$PathFragment/g;\r
+                                       $to             =~ s/$BuildDependentTag/$PathFragment/g;\r
+                                       }\r
+                               if ($bFileStem) {                                                                               ## FileStem substitution?\r
+                                       $from   =~ s/%filestem%/$FileStemFragment/g;\r
+                                       $to             =~ s/%filestem%/$FileStemFragment/g;\r
+                                       }               \r
+                               $to                                                     =~ s/\*.*//;                            ## Truncate to path before any wildcard\r
+\r
+                               my $bCopyOK             = 1;\r
+                               my $fromcheck   = $from;\r
+                               my $bRequired           = ! (exists $file->{notrequired});\r
+                               if ($name =~ /\*/) {                                                                    ## Wildcard case\r
+                                       $fromcheck =~ s/\*.*//;\r
+                                       if ($bRequired && (! -d $fromcheck)) {\r
+                                               if ($bDot) {print "\n";}\r
+                                               die "Fatal -- Can't find $fromcheck";\r
+                                               }\r
+                                       $bCopyOK = !system("echo D | xcopy /D /F /Y /S  $from $to > a.tmp 2>NUL");\r
+                                       }\r
+                               else {                                                                                                                  ## Specific file case\r
+                                       if ($bRequired && (! -e $fromcheck)) {\r
+                                               if ($bDot) {print "\n";}\r
+                                               die "Fatal -- Can't find $fromcheck";\r
+                                               }\r
+                                       $bCopyOK        = !system("echo F | xcopy /D /F /Y $from $to > a.tmp 2>NUL");\r
+                                       }\r
+\r
+                               if ($bCopyOK) {                                                                                 ## xcopy OK - show progress\r
+                                       # To show progress when files aren't copied, print a string of dots.\r
+                                       open(MYINPUTFILE, "<a.tmp");\r
+                                       my(@lines) = <MYINPUTFILE>;\r
+                                       foreach $line (@lines) { \r
+                                               $bDot = ($line =~ /^0/);\r
+                                               }\r
+                                       close(MYINPUTFILE);\r
+                                       if (!$bDot && $bOldDot) {print "\n";}\r
+                                       if ($bDot) {print "."; STDOUT->flush;}\r
+                                       else {print "$from copied to $to\n";}\r
+                                       $bOldDot = $bDot;\r
+                                       }\r
+                               else {                                                                                                                  ## xcopy failed\r
+                                       if (!exists $file->{notrequired}) {\r
+                                               if ($bDot) {print "\n";}\r
+                                               die "Fatal -- Copy of $from to $to failed";\r
+                                               }\r
+                                       }                                                                                                                               ## End xcopy succeed or fail\r
+                               }                                                                                                                                       ## End not dummy entry nor ignored\r
+                       }\r
+               $i++;\r
+               }\r
+       if ($bDot) {print "\n";}\r
+       }\r
+\r
+return 1;\r
index 86efd5fbd1f0d9d5eaaa24c7390eb35dbebb56aa..8187d535266beb4572430f4eb05d3ff75e0781d2 100644 (file)
@@ -64,7 +64,7 @@
                <File name="ms2mit.pdb" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="leashw32.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="leash32.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
-<!--           <File name="leash32.chm"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" /> -->\r
+               <File name="leash32.chm"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="kpasswd.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="kvno.pdb"   from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="krbv4w32.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="wshelp32.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="ms2mit.exe" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="leashw32.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
-<!--           <File name="leash32.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" /> -->\r
-<!--           <File name="leash32.chm"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" /> -->\r
+               <File name="leash32.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="kpasswd.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="kvno.exe"   from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
                <File name="krbv4w32.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
 \r
                <!-- Debug build only: -->\r
                <File name="khhelp.h"   from="auth\krb5\src\windows\identity\obj\i386\%debug%\inc\"     to="\inc\netidmgr" />\r
-               <File name="aklog.pdb"  from="..\target\bin\i386\%debug%\"      to="\bin\i386" />\r
+<!--           <File name="aklog.pdb"  from="..\target\bin\i386\%debug%\"      to="\bin\i386" />       -->\r
                <File name="netidmgr.exe.static.manifest"       from="..\target\bin\i386\%debug%\"      to="\bin\i386" notrequired="true" />\r
-               <File name="aklog.exe"  from="..\target\bin\i386\%debug%\"      to="\bin\i386" />\r
+<!--           <File name="aklog.exe"  from="..\target\bin\i386\%debug%\"      to="\bin\i386" />       -->\r
 \r
                <!-- Build-INdependent files, always copied: -->\r
                <File name="relnotes.html"      from="..\doc\kerberos\" to="\doc" />\r
                <File name="strings_1033.wxl"   from="auth\krb5\src\windows\installer\wix\lang\"        to="\install\wix\lang" />\r
                <File name="ui_1033.wxi"        from="auth\krb5\src\windows\installer\wix\lang\"        to="\install\wix\lang" />\r
                <File name="license.rtf"        from="auth\krb5\src\windows\installer\wix\lang\"        to="\install\wix\lang" />\r
+               <File name="krb5.conf"  from="auth\krb5\src\config-files\"      to="\sample" newname="krb5.ini" />\r
+               <File name="krb.con"    from="auth\krb4\sample-config\" to="\sample" />\r
+               <File name="krbrealm.con"       from="auth\krb4\sample-config\" to="\sample" />\r
        </Files>
\ No newline at end of file
diff --git a/src/windows/build/corebinaryfiles.xml b/src/windows/build/corebinaryfiles.xml
new file mode 100644 (file)
index 0000000..672bca0
--- /dev/null
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8" ?>\r
+       <Files>\r
+               <!-- File from  paths are relative to <src>/pismere.    -->\r
+               <!-- File to                    paths are relative to <out>.                                    -->\r
+               <File dummy="foo" /> <!-- Forces XML::Simple behavior -->\r
+                       <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->\r
+\r
+               <File name="leash_userdoc.pdf" from="staging\doc" to="doc" />\r
+               <File name="relnotes.html" from="doc\kerberos" to="doc" />\r
+\r
+               <File name="comerr32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="comerr32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss-client.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss-client.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss-server.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss-server.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gss.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gssapi32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="gssapi32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="k524init.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="k524init.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="k5sprt32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="k5sprt32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kclnt32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kclnt32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kcpytkt.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kcpytkt.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kdeltkt.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kdeltkt.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kdestroy.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kdestroy.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kfwcpcc.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kfwcpcc.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kfwlogon.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kfwlogon.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kinit.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kinit.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="klist.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="klist.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kpasswd.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kpasswd.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb4cred.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb4cred.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb4cred_en_us.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb524.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb524.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb5cred.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb5cred.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb5cred_en_us.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb5_32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krb5_32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbcc32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbcc32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbcc32s.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbcc32s.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbv4w32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="krbv4w32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kvno.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="kvno.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="leash32.chm" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="leash32.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="leash32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="leashw32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="leashw32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="mit2ms.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="mit2ms.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="ms2mit.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="ms2mit.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="netidmgr.chm" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="netidmgr.exe" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="netidmgr.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="nidmgr32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="nidmgr32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="wshelp32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="wshelp32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="xpprof32.dll" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+               <File name="xpprof32.pdb" from="target\bin\i386\%bldtype%\" to="\bin\i386\" />\r
+\r
+<!--           \r
+target\bin\i386\%bldtype%\ w2k\netidmgr.exe\r
+target\bin\i386\%bldtype%\ w2k\netidmgr.pdb\r
+target\bin\i386\%bldtype%\ w2k\nidmgr32.dll\r
+target\bin\i386\%bldtype%\ w2k\nidmgr32.pdb\r
+-->\r
+\r
+       </Files>
\ No newline at end of file
diff --git a/src/windows/build/sdkfiles.xml b/src/windows/build/sdkfiles.xml
new file mode 100644 (file)
index 0000000..d80a681
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8" ?>\r
+       <Files>\r
+               <!-- File from  paths are relative to <src>/pismere.    -->\r
+               <!-- File to                    paths are relative to <out>.                                    -->\r
+               <File dummy="foo" /> <!-- Forces XML::Simple behavior -->\r
+                       <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->\r
+\r
+               <File name="relnotes.html" from="doc\kerberos" to="doc" />\r
+               <File name="kclient.rtf" from="athena\auth\krb4\kclient\doc" to="doc" />\r
+\r
+               <File  name="*.h" from="staging\inc" to="inc" />\r
+<!--   \r
+               <File  name="*.h" from="staging\inc\kclient" to="inc\kclient\" />\r
+               <File  name="*.h" from="staging\inc\krb4" to="inc\krb4\" />\r
+               <File  name="*.h" from="staging\inc\krb5" to="inc\krb5\" />\r
+\r
+               <File  name="gssapi.h" from="" to="" inc\krb5\gssapi\\r
+               <File  name="gssapi_generic.h" from="" to="" inc\krb5\gssapi\\r
+               <File  name="gssapi_krb5.h" from="" to="" inc\krb5\gssapi\\r
+\r
+               <File  name="des.h" from="" to="" inc\krb5\KerberosIV\\r
+               <File  name="kadm_err.h" from="" to="" inc\krb5\KerberosIV\\r
+               <File  name="krb.h" from="" to="" inc\krb5\KerberosIV\\r
+               <File  name="krb_err.h" from="" to="" inc\krb5\KerberosIV\\r
+               <File  name="mit-copyright.h" from="" to="" inc\krb5\KerberosIV\\r
+\r
+               <File  name="krb5.h" from="" to="" inc\krb5\krb5\\r
+\r
+               <File  name="cacheapi.h" from="" to="" inc\krbcc\\r
+\r
+               <File  name="leasherr.h" from="" to="" inc\leash\\r
+               <File  name="leashinfo.h" from="" to="" inc\leash\\r
+               <File  name="leashwin.h" from="" to="" inc\leash\\r
+\r
+               <File  name="loadfuncs.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-afs.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-afs36.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-com_err.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-krb.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-krb5.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-krb524.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-leash.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-lsa.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-profile.h" from="" to="" inc\loadfuncs\\r
+               <File  name="loadfuncs-wshelper.h" from="" to="" inc\loadfuncs\\r
+\r
+               <File  name="loadfuncs.c" from="" to="" inc\loadfuncs\\r
+\r
+               <File  name="hashtable.h" from="" to="" inc\netidmgr\\r
+               <File  name="kconfig.h" from="" to="" inc\netidmgr\\r
+               <File  name="kcreddb.h" from="" to="" inc\netidmgr\\r
+               <File  name="khaction.h" from="" to="" inc\netidmgr\\r
+               <File  name="khactiondef.h" from="" to="" inc\netidmgr\\r
+               <File  name="khalerts.h" from="" to="" inc\netidmgr\\r
+               <File  name="khconfigui.h" from="" to="" inc\netidmgr\\r
+               <File  name="khdefs.h" from="" to="" inc\netidmgr\\r
+               <File  name="kherr.h" from="" to="" inc\netidmgr\\r
+               <File  name="kherror.h" from="" to="" inc\netidmgr\\r
+               <File  name="khhtlink.h" from="" to="" inc\netidmgr\\r
+               <File  name="khlist.h" from="" to="" inc\netidmgr\\r
+               <File  name="khmsgtypes.h" from="" to="" inc\netidmgr\\r
+               <File  name="khnewcred.h" from="" to="" inc\netidmgr\\r
+               <File  name="khprops.h" from="" to="" inc\netidmgr\\r
+               <File  name="khremote.h" from="" to="" inc\netidmgr\\r
+               <File  name="khrescache.h" from="" to="" inc\netidmgr\\r
+               <File  name="khtracker.h" from="" to="" inc\netidmgr\\r
+               <File  name="khuidefs.h" from="" to="" inc\netidmgr\\r
+               <File  name="kmm.h" from="" to="" inc\netidmgr\\r
+               <File  name="kmq.h" from="" to="" inc\netidmgr\\r
+               <File  name="kplugin.h" from="" to="" inc\netidmgr\\r
+               <File  name="mstring.h" from="" to="" inc\netidmgr\\r
+               <File  name="netidmgr.h" from="" to="" inc\netidmgr\\r
+               <File  name="netidmgr_version.h" from="" to="" inc\netidmgr\\r
+               <File  name="perfstat.h" from="" to="" inc\netidmgr\\r
+               <File  name="sync.h" from="" to="" inc\netidmgr\\r
+               <File  name="utils.h" from="" to="" inc\netidmgr\\r
+\r
+               <File  name="nameser.h" from="" to="" inc\wshelper\arpa\\r
+\r
+               <File  name="hesiod.h" from="" to="" inc\wshelper\\r
+               <File  name="mitwhich.h" from="" to="" inc\wshelper\\r
+               <File  name="resolv.h" from="" to="" inc\wshelper\\r
+               <File  name="wshelper.h" from="" to="" inc\wshelper\\r
+-->\r
+\r
+               <File  name="*.*" from="staging\install\nsis" to="install\nsis\" />\r
+<!--           <File  name="kfw-fixed.nsi" from="" to="" install\nsis\\r
+               <File  name="kfw.ico" from="" to="" install\nsis\\r
+               <File  name="kfw.nsi" from="" to="" install\nsis\\r
+               <File  name="KfWConfigPage.ini" from="" to="" install\nsis\\r
+               <File  name="KfWConfigPage2.ini" from="" to="" install\nsis\\r
+               <File  name="killer.cpp" from="" to="" install\nsis\\r
+               <File  name="licenses.rtf" from="" to="" install\nsis\\r
+               <File  name="site-local.nsi" from="" to="" install\nsis\\r
+               <File  name="utils.nsi" from="" to="" install\nsis\\r
+-->\r
+\r
+               <File  name="config.wxi" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="features.wxi" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="files.wxi" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="kfw.wxs" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="Makefile" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="msi-deployment-guide.txt" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="property.wxi" from="staging\install\wix" to="install\wix\" />\r
+               <File  name="site-local.wxi" from="staging\install\wix" to="install\wix\" />\r
+\r
+               <File  name="*.*" from="staging\install\wix\Binary" to="install\wix\Binary\" />\r
+<!--           <File  name="bannrbmp.bmp" from="" to="" install\wix\Binary\\r
+               <File  name="completi.ico" from="" to="" install\wix\Binary\\r
+               <File  name="custicon.ico" from="" to="" install\wix\Binary\\r
+               <File  name="dlgbmp.bmp" from="" to="" install\wix\Binary\\r
+               <File  name="exclamic.ico" from="" to="" install\wix\Binary\\r
+               <File  name="info.bmp" from="" to="" install\wix\Binary\\r
+               <File  name="insticon.ico" from="" to="" install\wix\Binary\\r
+               <File  name="new.bmp" from="" to="" install\wix\Binary\\r
+               <File  name="removico.ico" from="" to="" install\wix\Binary\\r
+               <File  name="repairic.ico" from="" to="" install\wix\Binary\\r
+               <File  name="up.bmp" from="" to="" install\wix\Binary\\r
+-->            \r
+\r
+               <File  name="custom.cpp" from="staging\install\wix\custom" to="install\wix\custom\" />\r
+               <File  name="custom.h" from="staging\install\wix\custom" to="install\wix\custom\" />\r
+\r
+               <File  name="config_1033.wxi" from="staging\install\wix\lang" to="install\wix\lang\" />\r
+               <File  name="strings_1033.wxl" from="staging\install\wix\lang" to="install\wix\lang\" />\r
+               <File  name="ui_1033.wxi" from="staging\install\wix\lang" to="install\wix\lang\" />\r
+               <!-- Why not license.rtf? -->\r
+\r
+               <File  name="*.lib" from="staging\lib\i386" to="lib\i386\" />\r
+<!--           \r
+               <File  name="comerr32.lib" from="" to="" lib\i386\\r
+               <File  name="delaydlls.lib" from="" to="" lib\i386\\r
+               <File  name="getopt.lib" from="" to="" lib\i386\\r
+               <File  name="gssapi32.lib" from="" to="" lib\i386\\r
+               <File  name="kclnt32.lib" from="" to="" lib\i386\\r
+               <File  name="krb524.lib" from="" to="" lib\i386\\r
+               <File  name="krb5_32.lib" from="" to="" lib\i386\\r
+               <File  name="krbcc32.lib" from="" to="" lib\i386\\r
+               <File  name="krbv4w32.lib" from="" to="" lib\i386\\r
+               <File  name="leashw32.lib" from="" to="" lib\i386\\r
+               <File  name="loadfuncs.lib" from="" to="" lib\i386\\r
+               <File  name="nidmgr32.lib" from="" to="" lib\i386\\r
+               <File  name="wshelp32.lib" from="" to="" lib\i386\\r
+               <File  name="xpprof32.lib" from="" to="" lib\i386\\r
+-->    \r
+       \r
+       </Files>
\ No newline at end of file
diff --git a/src/windows/build/srcfiles.xml b/src/windows/build/srcfiles.xml
new file mode 100644 (file)
index 0000000..58b58af
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" ?>\r
+       <Files>\r
+               <!-- File from  paths are relative to <src>/pismere.    -->\r
+               <!-- File to                    paths are relative to <out>.                                    -->\r
+               <File dummy="foo" /> <!-- Forces XML::Simple behavior -->\r
+                       <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->\r
+\r
+               <File name="config_1033.wxi"    from="athena\auth\krb5\src\windows\installer\wix\lang\" to="\install\wix\lang" />\r
+               <File name="strings_1033.wxl"   from="athena\auth\krb5\src\windows\installer\wix\lang\" to="\install\wix\lang" />\r
+               <File name="ui_1033.wxi"        from="athena\auth\krb5\src\windows\installer\wix\lang\" to="\install\wix\lang" />\r
+               <File name="license.rtf"        from="athena\auth\krb5\src\windows\installer\wix\lang\" to="\install\wix\lang" />\r
+               <File name="krb5.conf"  from="athena\auth\krb5\src\config-files\"       to="\sample" newname="krb5.ini"/>\r
+       </Files>
\ No newline at end of file