Automation for building KfW
authorKevin Koch <kpkoch@mit.edu>
Mon, 5 Mar 2007 14:07:07 +0000 (14:07 +0000)
committerKevin Koch <kpkoch@mit.edu>
Mon, 5 Mar 2007 14:07:07 +0000 (14:07 +0000)
Target_Version: 1.6.1
Component: KfW

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

src/windows/build/BKWconfig.xml [new file with mode: 0644]
src/windows/build/bkw.pl [new file with mode: 0644]
src/windows/build/copyfiles.xml [new file with mode: 0644]
src/windows/build/site-local.sed [new file with mode: 0644]
src/windows/build/tee.pl [new file with mode: 0644]
src/windows/build/which.pl [new file with mode: 0644]

diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml
new file mode 100644 (file)
index 0000000..7de3df1
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8" ?>\r
+<!-- 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
+               <Tags>\r
+                       <cvs value="2.6.5 build 1234"/>\r
+<!--                   <svn value="http://anonsvn.mit.edu/foo/bar"/>   -->\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:\MIT-ISDA\KfW\src2" />\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
+               <Options>\r
+                       <debug                  value="0" />\r
+                       <log                            value="1" path="bkw_pl.log" />\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="" />\r
+       </Config>\r
+       <Stages>\r
+               <FetchSources></FetchSources>\r
+               <Make></Make>\r
+               <PrePackage>\r
+                       <CopyList>\r
+                               <Config>\r
+                                       <!--    Debug and Release build results go in different places.\r
+                                                               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
+                                       <!--    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
+                                                               and be copied when doing a debug (or release) build.  Examples:\r
+                                                               Will always be copied, from a build-dependent directory:\r
+                                                               <File name="kfwlogon.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" /> \r
+                                                               Will only be copied in debug build:\r
+                                                               <File name="netidmgr.exe.static.manifest"       from="..\target\bin\i386\%debug%\"      to="\bin\i386" notrequired="true" />\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
+                               <Files>\r
+                                       <Include path="copyfiles.xml" />        <!-- Relative to location of bkw.pl. -->\r
+                               </Files>\r
+                       </CopyList>\r
+               </PrePackage>\r
+               <Package></Package>\r
+               <PostPackage></PostPackage>\r
+       </Stages>\r
+</BKW_Config>
\ No newline at end of file
diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl
new file mode 100644 (file)
index 0000000..a36107f
--- /dev/null
@@ -0,0 +1,409 @@
+#!perl -w\r
+\r
+#use strict;\r
+use FindBin;\r
+use File::Spec;\r
+use File::Basename;\r
+use lib "$FindBin::Bin/build/lib";\r
+#use Logger;\r
+use Getopt::Long;\r
+use Cwd;\r
+use XML::Simple;\r
+use Data::Dumper;\r
+\r
+my $BAIL;\r
+$0 = fileparse($0);\r
+my $OPT = { logfile => 'bkw.pl.log' };\r
+my $MAKE = 'NMAKE';\r
+\r
+sub get_info\r
+    {\r
+       my $cmd = shift || die;\r
+       my $which = $^X.' which.pl';\r
+       my $full = `$which $cmd`;\r
+       return 0 if ($? / 256);\r
+       chomp($full);\r
+       $full = "\"".$full."\"";\r
+       return { cmd => $cmd, full => $full};\r
+    }\r
+\r
+sub usage {\r
+    print <<USAGE;\r
+Usage: $0 (-f --config) config-file [options] NMAKE-options\r
+\r
+  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
+    /cvstag tag   \\ For whichever of these tags is specified,\r
+    /svntag url   / a checkout  will be done into srcdir\r
+    /debug        Do debug make instead of release make\r
+    /outdir dir   Directory to be created where build results will go\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
+  Other:\r
+    NMAKE-options    any options you want to pass to NMAKE, which can be:\r
+                     (note: /nologo is always used)\r
+\r
+USAGE\r
+    system("$MAKE /?");\r
+       }\r
+\r
+sub handler {\r
+    my $sig = shift;\r
+    my $bailmsg = "Bailing out due to SIG$sig!\n";\r
+    my $warnmsg = <<EOH;\r
+*********************************\r
+* FUTURE BUILDS MAY FAIL UNLESS *\r
+* BUILD DIRECTORIES ARE CLEANED *\r
+*********************************\r
+EOH\r
+    $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
+                           'ignore_case', 'pass_through',\r
+                           'prefix_pattern=(--|-|\+|\/)',\r
+                          );\r
+    GetOptions($OPT,\r
+              'help|h|?',\r
+              'cvstag|c:s',\r
+              'svntag|s:s',\r
+              'srcdir|r:s',\r
+              'outdir|o:s',\r
+              'debug|d',\r
+              'config|f:s',\r
+              'logfile|l:s',\r
+              'clean',\r
+              'verbose',\r
+              'vverbose',\r
+              'nomake',\r
+              'nopackage',\r
+              );\r
+\r
+    if ( $OPT->{help} ) {\r
+               usage();\r
+               exit(0);\r
+               }\r
+               \r
+##++ Validate required conditions:\r
+\r
+    if ($OPT->{config}) {}\r
+    else {\r
+      print "Fatal -- Configuration file must be specified.\n";\r
+      usage();\r
+      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 $requirements_met = 1;\r
+    my $first_missing = 0;\r
+    my $error_list = "";\r
+       foreach my $required (@required_list) {\r
+        if (!get_info($required)) {\r
+                       $requirements_met = 0;\r
+                       if (!$first_missing) {\r
+                               $first_missing = 1;\r
+                               $error_list = "Fatal -- Environment problem!  The following program(s) are not in PATH:\n";\r
+                               }\r
+                       $error_list .= "$required\n";\r
+                       }\r
+               }\r
+       if (!$requirements_met) {\r
+               print $error_list;\r
+               print "Info -- Update PATH or install the programs and try again.\n";\r
+               exit(0);\r
+               }\r
+\r
+##-- Validate required conditions.\r
+       \r
+    use Time::gmtime;\r
+    $ENV{DATE} = gmctime()." GMT";\r
+       my $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
+    $configfile = $OPT->{config};\r
+\r
+    print "Info -- Reading configuration from $configfile.\n";\r
+\r
+    # Get configuration file:\r
+       my $xml = new XML::Simple();\r
+       my $config = $xml->XMLin($configfile);\r
+\r
+       # Set up convenience variables:\r
+       my (@switches, @paths, @tags, @prepackage, @files);\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
+\r
+    # Update the config with overrides from the command line:\r
+       $tags[0]->{cvs}->{value} = $OPT->{cvstag}                                       if exists $OPT->{cvstag};\r
+       $tags[0]->{svn}->{value} = $OPT->{svnurl}                                       if exists $OPT->{svnurl};\r
+       $paths[0]->{src}->{path} = $OPT->{srcdir}                                       if exists $OPT->{srcdir};\r
+    $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]->{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
+               }\r
+    my $verbose                        = $config->{CommandLine}->{Options}->{verbose}->{value};\r
+    my $vverbose               = $config->{CommandLine}->{Options}->{vverbose}->{value};\r
+\r
+       if ($switches[0]->{clean}->{value} && !$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
+    \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
+\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
+if (!$switches[0]->{nomake}->{value}) {\r
+       if ($verbose) {print "Info -- *** Begin fetching sources.\n";}\r
+       \r
+       my ($wd, $result);\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 (! -d "pismere")                                    {print "Warning -- can't find pismere in $wd.  It will be created.\n";}\r
+       #if (! -d "pismere\\athena")    {print "Warning -- can't find pismere\\athena in $wd.  It will be created.\n";}\r
+       \r
+       if ($tags[0]->{cvs}->{value})           {\r
+               # Set up cvs environment variables:\r
+               print "Warning -- cvs checkout skipped for now.\n";\r
+       #       system("cvs checkout krb") or die "Fatal -- checkout of cvs source failed; return code $?\n";\r
+               }\r
+       else    {print "Info -- cvs tag not specified; no cvs sources will be checked out.\n";}\r
+       \r
+       if ($tags[0]->{svn}->{value})   {\r
+               # Set up svn environment variables:\r
+               print "Warning -- svn checkout skipped for now.\n";\r
+       #       system("svn checkout krb") or die "Fatal -- checkout of svn source failed; return code $?\n";\r
+               }\r
+       else    {print "Info -- svn tag not specified; no svn sources will be checked out.\n";}\r
+       \r
+       if ($verbose) {print "Info -- ***   End fetching sources.\n";}\r
+       \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
+       \r
+       if ($verbose) {print "Info -- ***   End preparing for build.\n";}\r
+       \r
+       my ($buildtarget, $buildtext);\r
+       if ($switches[0]->{clean}->{value}) {\r
+               $buildtarget = "clean" ;\r
+               $buildtext = " clean."\r
+               }\r
+       else {\r
+               $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
+               if (-d "staging") {\r
+                       !system("rm -rf staging") or die "Fatal -- Couldn't remove pismere/staging.";\r
+                       }\r
+               }\r
+\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
+       \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
+       $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
+       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 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 {$nfiles++;}\r
+                               }\r
+                       }\r
+               $i++;\r
+               }\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
+       \r
+       chdir("staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
+       \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
+               \r
+       # Update paths in site-local.wxi:\r
+       my $dblback_originalDir = $originalDir;\r
+       $dblback_originalDir =~ s/\\/\\\\/g;\r
+       !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
+       # Sam said to leave these files out, but it is faster to copy them now \r
+       #  than to figure out how to modify the wix configs to ignore them:\r
+       !system("echo F | xcopy /D $wd\\staging\\kfw-2.5-extra\\sample-config\\*.con $wd\\staging\\sample") \r
+               or die "Fatal -- Couldn't copy $wd\\staging\\kfw-2.5-extra\\sample-config\\*.con.";\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
+       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
+    return $errorState;\r
+}\r
+\r
+$SIG{'INT'} = \&handler;\r
+$SIG{'QUIT'} = \&handler;\r
+\r
+##exit (0);\r
+exit(main());
\ No newline at end of file
diff --git a/src/windows/build/copyfiles.xml b/src/windows/build/copyfiles.xml
new file mode 100644 (file)
index 0000000..86efd5f
--- /dev/null
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="utf-8" ?>\r
+       <Files>\r
+               <!-- File from  paths are relative to <src>\pismere\athena  -->\r
+               <!-- File to                    paths are relative to <src>\pismere\staging -->\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
+               <!-- Build-dependent files (from release or debug build): -->\r
+               <File name="netidmgr.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="netidmgr_version.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr"/>\r
+               <File name="perfstat.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr"/>\r
+               <File name="utils.h"    from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="sync.h"     from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="mstring.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kplugin.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kmq.h"      from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kmm.h"      from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khuidefs.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khtracker.h"        from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khrescache.h"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khremote.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khprops.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khnewcred.h"        from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khmsgtypes.h"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khlist.h"   from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khhtlink.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kherror.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kherr.h"    from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khdefs.h"   from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khconfigui.h"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khalerts.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khactiondef.h"      from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="khaction.h" from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kcreddb.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="kconfig.h"  from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="hashtable.h"        from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\inc\"   to="\inc\netidmgr" />\r
+               <File name="nidmgr32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="xpprof32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="wshelp32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="loadfuncs.lib"      from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="leashw32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="krbv4w32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="krbcc32.lib"        from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="krb5_32.lib"        from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="krb524.lib" from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="kclnt32.lib"        from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="gssapi32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="getopt.lib" from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="delaydlls.lib"      from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="comerr32.lib"       from="..\target\lib\i386\%bldtype%\"    to="\lib\i386" />\r
+               <File name="netidmgr.pdb"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\w2k\"   to="\bin\i386\w2k" />\r
+               <File name="nidmgr32.pdb"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\w2k\"   to="\bin\i386\w2k" />\r
+               <File name="kfwcpcc.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kfwlogon.pdb"       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.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="krb4cred.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="krb5cred.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="mit2ms.pdb" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kdeltkt.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kcpytkt.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="xpprof32.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="wshelp32.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <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="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="krbcc32s.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="krbcc32.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="k5sprt32.pdb"       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="krb524.pdb" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="klist.pdb"  from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kinit.pdb"  from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kdestroy.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kclnt32.pdb"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="k524init.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="gssapi32.pdb"       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-client.pdb"     from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="gss.pdb"    from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="comerr32.pdb"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="netidmgr.exe"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\w2k\"   to="\bin\i386\w2k" />\r
+               <File name="nidmgr32.dll"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\w2k\"   to="\bin\i386\w2k" />\r
+               <File name="kfwcpcc.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kfwlogon.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="netidmgr.exe.manifest"      from="..\target\bin\i386\%bldtype%\"    to="\bin\i386"  notrequired="true" />\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="netiddev.chm"       from="..\target\bin\i386\%bldtype%\"    to="\doc" />\r
+               <File name="nidmgr32.dll"       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="krb4cred.dll"       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="krb5cred.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="mit2ms.exe" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kdeltkt.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kcpytkt.exe"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="xpprof32.dll"       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="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
+               <File name="krbcc32s.exe"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="krbcc32.dll"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="k5sprt32.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="krb524.dll" from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="klist.exe"  from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kinit.exe"  from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kdestroy.exe"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="kclnt32.dll"        from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="k524init.exe"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="gssapi32.dll"       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-client.exe"     from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="gss.exe"    from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="comerr32.dll"       from="..\target\bin\i386\%bldtype%\"    to="\bin\i386" />\r
+               <File name="NetIddev.chm"       from="auth\krb5\src\windows\identity\obj\i386\%bldtype%\doc\"   to="\doc" newname="netiddev.chm" />\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="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
+\r
+               <!-- Build-INdependent files, always copied: -->\r
+               <File name="relnotes.html"      from="..\doc\kerberos\" to="\doc" />\r
+               <File name="leash_userdoc.pdf"  from="auth\leash\help\" to="\doc" />\r
+               <File name="NetIdMgr.pdf" from="auth\krb5\src\windows\identity\doc\" to="\doc" newname="netidmgr_userdoc.pdf" />\r
+               <File name="*"  from="auth\krb5\src\windows\identity\sample\templates\credprov\"        to="\sample\templates\credprov\" />\r
+               <File name="*"  from="auth\krb5\src\windows\identity\sample\templates\credprov\images\" to="\sample\templates\credprov\images" />\r
+               <File name="*"  from="auth\krb5\src\windows\identity\sample\templates\credprov\lang\"   to="\sample\templates\credprov\lang" />\r
+               <File name="*"  from="auth\krb5\src\windows\identity\sample\templates\credprov\lang\en_us\"     to="\sample\templates\credprov\lang\en_us" />\r
+               <File name="kclient.h"  from="auth\krb4\kclient\include\"       to="\inc\kclient" />\r
+               <File name="kcmacerr.h" from="auth\krb4\kclient\include\"       to="\inc\kclient" />\r
+               <File name="com_err.h"  from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="conf-pc.h"  from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="conf.h"     from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="des.h"      from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="kadm_err.h" from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="krb.h"      from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="krberr.h"   from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="mit_copy.h" from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="osconf.h"   from="auth\krb4\include\"       to="\inc\krb4" />\r
+               <File name="com_err.h"  from="auth\krb5\src\include\"   to="\inc\krb5" />\r
+               <File name="gssapi.h"   from="auth\krb5\src\include\gssapi\"    to="\inc\krb5\gssapi" />\r
+               <File name="gssapi_generic.h"   from="auth\krb5\src\include\gssapi\"    to="\inc\krb5\gssapi" />\r
+               <File name="gssapi_krb5.h"      from="auth\krb5\src\include\gssapi\"    to="\inc\krb5\gssapi" />\r
+               <File name="des.h"      from="auth\krb5\src\include\KerberosIV\"        to="\inc\krb5\KerberosIV" />\r
+               <File name="kadm_err.h" from="auth\krb5\src\include\KerberosIV\"        to="\inc\krb5\KerberosIV" />\r
+               <File name="krb_err.h"  from="auth\krb5\src\include\KerberosIV\"        to="\inc\krb5\KerberosIV" />\r
+               <File name="krb.h"      from="auth\krb5\src\include\KerberosIV\"        to="\inc\krb5\KerberosIV" />\r
+               <File name="mit-copyright.h"    from="auth\krb5\src\include\KerberosIV\"        to="\inc\krb5\KerberosIV" />\r
+               <File name="krb5.h"     from="auth\krb5\src\include\"   to="\inc\krb5" />\r
+               <File name="profile.h"  from="auth\krb5\src\include\"   to="\inc\krb5" />\r
+               <File name="win-mac.h"  from="auth\krb5\src\include\"   to="\inc\krb5" />\r
+               <File name="krb5.h"     from="auth\krb5\src\include\krb5\"      to="\inc\krb5\krb5" notrequired="true" />\r
+               <File name="cacheapi.h" from="auth\krbcc\include\"      to="\inc\krbcc" />\r
+               <File name="leasherr.h" from="auth\leash\include\"      to="\inc\leash" />\r
+               <File name="leashinfo.h"        from="auth\leash\include\"      to="\inc\leash" />\r
+               <File name="leashwin.h" from="auth\leash\include\"      to="\inc\leash" />\r
+               <File name="loadfuncs-afs.h"    from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-afs36.h"  from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-com_err.h"        from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-krb.h"    from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-krb5.h"   from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-krb524.h" from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-leash.h"  from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-lsa.h"    from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-profile.h"        from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs-wshelper.h"       from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs.c"        from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="loadfuncs.h"        from="util\loadfuncs\"  to="\inc\loadfuncs" />\r
+               <File name="nameser.h"  from="wshelper\include\arpa\"   to="\inc\wshelper\arpa" />\r
+               <File name="hesiod.h"   from="wshelper\include\"        to="\inc\wshelper" />\r
+               <File name="mitwhich.h" from="wshelper\include\"        to="\inc\wshelper" />\r
+               <File name="resolv.h"   from="wshelper\include\"        to="\inc\wshelper" />\r
+               <File name="wshelper.h" from="wshelper\include\"        to="\inc\wshelper" />\r
+               <File name="kfw-fixed.nsi"      from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="kfw.ico"    from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="kfw.nsi"    from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="KfWConfigPage.ini"  from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="KfWConfigPage2.ini" from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="killer.cpp" from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="licenses.rtf"       from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="site-local.nsi"     from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="utils.nsi"  from="auth\krb5\src\windows\installer\nsis\"    to="\install\nsis" />\r
+               <File name="msi-deployment-guide.txt"   from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="config.wxi" from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="features.wxi"       from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="files.wxi"  from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="kfw.wxs"    from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="Makefile"   from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="property.wxi"       from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="site-local.wxi"     from="auth\krb5\src\windows\installer\wix\"     to="\install\wix" />\r
+               <File name="bannrbmp.bmp"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="completi.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="custicon.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="dlgbmp.bmp" from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="exclamic.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="info.bmp"   from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="insticon.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="new.bmp"    from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="removico.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="repairic.ico"       from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="up.bmp"     from="auth\krb5\src\windows\installer\wix\Binary\"      to="\install\wix\Binary" />\r
+               <File name="custom.cpp" from="auth\krb5\src\windows\installer\wix\custom\"      to="\install\wix\custom" />\r
+               <File name="custom.h"   from="auth\krb5\src\windows\installer\wix\custom\"      to="\install\wix\custom" />\r
+               <File name="config_1033.wxi"    from="auth\krb5\src\windows\installer\wix\lang\"        to="\install\wix\lang" />\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
+       </Files>
\ No newline at end of file
diff --git a/src/windows/build/site-local.sed b/src/windows/build/site-local.sed
new file mode 100644 (file)
index 0000000..34d68ff
--- /dev/null
@@ -0,0 +1,2 @@
+s/<?define TargetDir="c:.temp.*"?>/<?define TargetDir="%%TARGETDIR%%"?>/\r
+s/<?define ConfigDir="c:.temp.*"?>/<?define ConfigDir="%%CONFIGDIR%%"?>/
\ No newline at end of file
diff --git a/src/windows/build/tee.pl b/src/windows/build/tee.pl
new file mode 100644 (file)
index 0000000..a9c30fb
--- /dev/null
@@ -0,0 +1,79 @@
+# Usage 'tee filename'\r
+# Make sure that when using this as a perl pipe you\r
+# print a EOF char!\r
+#  (This may be a bug in perl 4 for NT)\r
+#\r
+# Use it like:\r
+#      open(PIPE, "|$^X tee.pl foo.log") || die "Can't pipe";\r
+#      open(STDOUT, ">&PIPE") || die "Can't dup pipe to stdout";\r
+#      open(STDERR, ">&PIPE") || die "Can't dup pipe to stderr";\r
+\r
+use IO::File;\r
+\r
+#$SIG{'INT'} = \&handler;\r
+#$SIG{'QUIT'} = \&handler;\r
+\r
+$SIG{'INT'} = 'IGNORE';\r
+$SIG{'QUIT'} = \&handler;\r
+\r
+my $fh = new IO::File;\r
+\r
+my $arg = shift;\r
+my $file;\r
+my $access = ">";\r
+\r
+while ($arg) {\r
+    if ($arg =~ /-a/) {\r
+       $access = ">>";\r
+    } elsif ($arg =~ /-i/) {\r
+       $SIG{'INT'} = 'IGNORE';\r
+       $SIG{'QUIT'} = 'IGNORE';\r
+    } else {\r
+       $file = $arg;\r
+       last;\r
+    }\r
+    $arg = shift;\r
+}\r
+\r
+STDOUT->autoflush(1);\r
+\r
+if ($file) {\r
+    $fh->open($access.$file) || die "Could not open $file\n";\r
+    $fh->autoflush(1);\r
+}\r
+\r
+while (<>) {\r
+    $_ = &logtime.$_;\r
+    print $_;\r
+    print $fh $_ if $file;\r
+}\r
+\r
+sub logtime {\r
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);\r
+    $mon = $mon + 1;\r
+    $year %= 100;\r
+    sprintf ("[%02d/%02d/%02d %02d:%02d:%02d] ",\r
+            $year, $mon, $mday,\r
+            $hour, $min, $sec);\r
+}\r
+\r
+sub handler {\r
+    my $sig = shift;\r
+    my $bailmsg = &logtime."Bailing out due to SIG$sig!\n";\r
+    my $warnmsg = <<EOH;\r
+*********************************\r
+* FUTURE BUILDS MAY FAIL UNLESS *\r
+* BUILD DIRECTORIES ARE CLEANED *\r
+*********************************\r
+EOH\r
+    print $bailmsg, $warnmsg;\r
+    print $fh $bailmsg, $warnmsg;\r
+    print "Closing log...";\r
+    undef $fh if $fh;\r
+    print "closed!\n";\r
+    exit(2);\r
+}\r
+\r
+END {\r
+    undef $fh if $fh;\r
+}\r
diff --git a/src/windows/build/which.pl b/src/windows/build/which.pl
new file mode 100644 (file)
index 0000000..1cf89ce
--- /dev/null
@@ -0,0 +1,69 @@
+#!perl -w\r
+\r
+use strict;\r
+use Config;\r
+use File::Basename;\r
+use Getopt::Long;\r
+\r
+$0 = fileparse($0);\r
+\r
+sub main\r
+{\r
+    Getopt::Long::Configure('bundling', 'no_auto_abbrev',\r
+                           'no_getopt_compat', 'require_order',\r
+                           'ignore_case', 'pass_through',\r
+                           'prefix_pattern=(--|-|\+|\/)',\r
+                          );\r
+    my $OPT = {};\r
+    GetOptions($OPT,\r
+              'help|h|?',\r
+              'all|a',\r
+              'quiet|q',\r
+              'debug|d',\r
+              'path:s',\r
+              );\r
+\r
+    my $f = shift @ARGV;\r
+    if ($OPT->{help} || !$f) {\r
+       usage();\r
+       exit(0) if $OPT->{help};\r
+       exit(1);\r
+    }\r
+\r
+    my $p = $OPT->{path} || $ENV{PATH};\r
+    my $s = $Config{path_sep};\r
+    my @d = split(/$s/, $p);\r
+    my @e = split(/$s/, lc($ENV{PATHEXT} || '.bat;.exe;.com'));\r
+    my @f = ($f, map { $f.$_; } @e);\r
+    my $found = 0;\r
+    foreach my $d (@d) {\r
+       print "(Searching $d)\n" if $OPT->{debug};\r
+       foreach my $f (@f) {\r
+           my $df = $d.'\\'.$f; # cannot use $File::Spec->catfile due to UNC.\r
+           print "(Checking for $df)\n" if $OPT->{debug};\r
+           if (-f $df) {\r
+               exit(0) if $OPT->{quiet};\r
+               print "$df\n";\r
+               exit(0) if !$OPT->{all};\r
+               $found = 1;\r
+           }\r
+       }\r
+    }\r
+    print "Could not find $f\n" if !$found && !$OPT->{quiet};\r
+    exit($found?0:1);\r
+}\r
+\r
+sub usage\r
+{\r
+    print <<USAGE;\r
+Usage: $0 [options] command\r
+    command         find file executed by this command by looking at PATH\r
+    -d, --debug     debug output\r
+    -a, --all       find all such commands in PATH\r
+    -q, --quiet     no output, exit with non-zero errorcode if not found\r
+    --path PATHARG  search PATHARG instead of the PATH environment variable\r
+    -?, -H, --help  help\r
+USAGE\r
+}\r
+\r
+main();\r