Pull product version information from kerberos.ver
authorKevin Koch <kpkoch@mit.edu>
Wed, 28 Mar 2007 18:43:11 +0000 (18:43 +0000)
committerKevin Koch <kpkoch@mit.edu>
Wed, 28 Mar 2007 18:43:11 +0000 (18:43 +0000)
Change site-local.wxi/.nsi to site-local-tagged.wxi/.nsi.  Add tags such as %VERSION-MAJOR% which are substituted by the build script.  NB:  to build the installers directly, the build script must be run at least once to generate site-local.wxi/.nsi.

Write DEBUG, RELEASE, BETA defines to site-local.nsi, based on build setting & values from kerberos.ver.

Add more tag substitutions to file copy and the config file, to provide a way to generate names like kfw-3-2-0-DEBUG.exe programatically.

Target_Version: 1.6.1
Ticket: 5490
Tags: pullup

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

src/windows/build/BKWconfig.xml
src/windows/build/bkw.pl
src/windows/build/copyfiles.pl
src/windows/installer/nsis/site-local-tagged.nsi [new file with mode: 0644]
src/windows/installer/nsis/site-local.nsi [deleted file]
src/windows/installer/wix/site-local-tagged.wxi [moved from src/windows/installer/wix/site-local.wxi with 88% similarity]

index 7c536da0243ad83a84b472ece7826a872e9144e7..28939444d85ef9afb3da7f7e731222a9b711003f 100644 (file)
                <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="plink.exe" /> <!-- Path to a kerberized plink, needed for svn. -->\r
-                                       <!-- NB:  Path separators must be doubled backslashes.  EG:  C:\\WINDOWS\\PLINK.EXE -->\r
+                               <SVNURL name="svn.mit.edu" />   <!-- NB:  No protocol or slashes!! -->\r
+                               <USERNAME name="" />                                    <!-- Needed for svn/plink.  Override from command line -->\r
                                </Config>\r
                </FetchSources>\r
                <Make>\r
                        </CopyList>\r
                </PrePackage>\r
                <Package>\r
+                       <Config>\r
+                               <Paths> \r
+                                       <Versions path="pismere/athena/include/kerberos.ver" />         <!-- Relative to <src>. -->\r
+                                       </Paths>\r
+                               </Config>\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
+                               <FileStem name="kfw-%VERSION_MAJOR%-%VERSION_MINOR%-%VERSION_PATCH%" />         <!--    <FileStem> will be substituted for %filestem%.  -->\r
                                </Config>\r
                        <Zips>\r
                                <Zip dummy="foo" /> <!-- To force desired XML::Simple behavior  -->\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
+                                       <File name="MITKerberosForWindows%-DEBUG%.exe" from="staging\install\nsis" to="" newname="%filestem%%-DEBUG%.exe" />\r
                                        </Files>\r
                                </CopyList>\r
                        </PostPackage>\r
index 5460ffa2725652b05c98cfe79cc5cd36ac0f63c4..8279879a63a6ced54f904512e248b916b9b50da8 100644 (file)
@@ -38,23 +38,23 @@ Usage: $0 (-f --config) config-file [options] NMAKE-options
 \r
   Options:\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
+    /config /c path    Path to config file.\r
+    /srcdir /r 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
+    /outdir /o 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
-    /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
+    /username /u name  username used to access svn if checking out.\r
+    /cvstag /c tag   \\ If non-empty, the tag is appended to cvs and svn\r
+    /svntag /s tag   / commands to select the rev to fetch.\r
+    /debug /d          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
+    /verbose /v        Debug mode - verbose output.\r
+    /logfile /l 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
@@ -91,9 +91,9 @@ sub main {
               'config|f:s',\r
               'logfile|l:s',\r
               'repository:s',\r
-              'kerberos_id:s',\r
-              'verbose',\r
-              'vverbose',\r
+              'username|u:s',\r
+              'verbose|v',\r
+              'vverbose|vv',\r
               'nomake',\r
               'clean',\r
               'nopackage',\r
@@ -114,7 +114,7 @@ sub main {
       }\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', 'makensis', 'nmake');\r
+    my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', 'hhc', 'candle', 'light', 'makensis', 'nmake', 'plink');\r
     my $requirements_met = 1;\r
     my $first_missing = 0;\r
     my $error_list = "";\r
@@ -167,7 +167,7 @@ sub main {
     $switches[0]->{debug}->{value} = $OPT->{debug}                             if exists $OPT->{debug};\r
     $switches[0]->{clean}->{value} = 1                                                                                 if exists $OPT->{clean};\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
+    $fetch[0]->{USERNAME}->{name} = $OPT->{username}   if exists $OPT->{username};\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
@@ -211,20 +211,28 @@ sub main {
 \r
        my $wd  = $src."\\pismere";\r
 \r
-       if ($rverb =~ /checkout/) {\r
-               if (-d $wd) {\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
+       if (! ($rverb =~ /skip/)) {\r
+               local $len = 0;\r
+               if (exists $fetch[0]->{USERNAME}->{name}) {\r
+                       $len = length $fetch[0]->{USERNAME}->{name};\r
+                       }\r
+           if ($len < 1) {\r
+                       die "Fatal -- you won't get far accessing the repository without specifying a username.";\r
                        }\r
-               if (! -d $src)                          {mkdir $src                             or die "Fatal -- Couldn't create $src.";}\r
-               if (! -d $wd)                           {mkdir $wd                              or die "Fatal -- Couldn't create $wd.";}\r
-               if (! -d "$wd//CVS")    {mkdir "$wd//CVS"       or die "Fatal -- Couldn't create $wd\\CVS.";}\r
+               }\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
@@ -243,8 +251,8 @@ sub main {
 \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
+               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
                my $cvscmdroot  = "cvs $rverb";\r
@@ -261,28 +269,26 @@ sub main {
                                $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
+                               !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
+                       !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
+               # Set up svn environment variable:\r
+               $ENV{SVN_SSH} = "plink.exe";\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
+               if (! -d $krb5dir) {mkdir($krb5dir)             or die "Fatal -- Couldn't  create $krb5dir";}\r
+               chdir($krb5dir)                                                                                 or die "Fatal -- Couldn't chdir to $krb5dir";\r
                print "Info -- chdir to ".`cd`."\n"                     if ($verbose);\r
                my $svncmd = "svn $rverb ";\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
+                       $svncmd .= "svn+ssh://".$fetch[0]->{USERNAME}->{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
@@ -292,6 +298,7 @@ sub main {
                }\r
 ##-- End  repository action.\r
                \r
+##++ Make action:\r
        if (    (!$switches[0]->{nomake}->{value}) ) {\r
                if ($verbose) {print "Info -- *** Begin preparing for build.\n";}\r
 \r
@@ -368,9 +375,65 @@ sub main {
                if ($verbose) {print "Info -- ***   End build".$buildtext."\n";}\r
                }                               ## End make conditional.\r
        else {print "Info -- *** Skipping build.\n"     if ($verbose);}\r
+##-- Make action.\r
                \r
        if (!$switches[0]->{nopackage}->{value}) {              ## If /clean, this switch will have been cleared.\r
                if ($verbose) {print "Info -- *** Begin prepackage.\n";}\r
+\r
+               # We read in the version information to be able to update the site-local files in the install build areas:\r
+               local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path};\r
+               open(DAT, "$src/$version_path")         or die "Could not open $version_path.";\r
+               @raw = <DAT>;\r
+               close DAT;\r
+               foreach $line (@raw) {\r
+                       chomp $line;\r
+                       if ($line =~ /#define/) {                                       # Process #define lines:\r
+                               $line =~ s/#define//;                                   # Remove #define token\r
+                               $line =~ s/^\s+//;                                              #  and leading & trailing whitespace\r
+                               $line =~ s/\s+$//;\r
+                               local @qr = split("\"", $line);         # Try splitting with quotes\r
+                               if (exists $qr[1]) {\r
+                                       $qr[0] =~ s/^\s+//;                             #  Clean up whitespace\r
+                                       $qr[0] =~ s/\s+$//;\r
+                                       $config->{Versions}->{$qr[0]} = $qr[1];         # Save string\r
+                                       }\r
+                               else {                                                                                          # No quotes, so\r
+                                       local @ar = split(" ", $line);          #  split with space\r
+                                       $ar[0] =~ s/^\s+//;                             #  Clean up whitespace\r
+                                       $ar[0] =~ s/\s+$//;\r
+                                       $config->{Versions}->{$ar[0]} = $ar[1];                 # and  save numeric value\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+               # Check that the versions we will need for site-local have been defined:\r
+           my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV', \r
+                                                                                                               'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR', \r
+                                                                                                               'VER_PRODUCTNAME_STR');\r
+           my $requirements_met = 1;\r
+           my $first_missing = 0;\r
+           my $error_list = "";\r
+               foreach my $required (@required_versions) {\r
+               if (! exists $config->{Versions}->{$required}) {\r
+                               $requirements_met = 0;\r
+                               if (!$first_missing) {\r
+                                       $first_missing = 1;\r
+                                       $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n";\r
+                                       }\r
+                               $error_list .= "$required\n";\r
+                               }\r
+                       }\r
+               if (!$requirements_met) {\r
+                       print $error_list;\r
+                       exit(0);\r
+                       }\r
+               # Apply any of these tags to filestem:\r
+               my $filestem            = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};\r
+               $filestem                       =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/;\r
+               $filestem                       =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/;\r
+               $filestem                       =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/;\r
+               $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name}  = $filestem;\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
                my $prepackage  = $config->{Stages}->{PrePackage};\r
@@ -383,24 +446,54 @@ sub main {
                # 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
+               copyFiles($prepackage->{CopyList}, $config);                            ## Copy any files [this step takes a while]\r
 \r
                chdir("staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\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("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
-               $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("mv d.tmp site-local.wxi")                                                                                                                                                                                                                                              or die "Fatal -- Couldn't replace site-local.wxi.";\r
-                               \r
+               # Make sed script to run on the site-local configuration files:\r
+               local $tmpfile  = "site-local.sed" ;\r
+               system("del $tmpfile");\r
+               # Basic substitutions:\r
+               local $dblback_staging  = "$wd\\staging";\r
+               $dblback_staging                        =~ s/\\/\\\\/g;\r
+               !system("echo s/%TARGETDIR%/$dblback_staging/ >> $tmpfile")             or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               local $dblback_sample   = "$wd\\staging\\sample";\r
+               $dblback_sample                 =~ s/\\/\\\\/g;\r
+               !system("echo s/%CONFIGDIR-WIX%/$dblback_sample/ >> $tmpfile")          or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo s/%CONFIGDIR-NSI%/$dblback_staging/ >> $tmpfile")         or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/ >> $tmpfile")              or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/ >> $tmpfile")              or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/ >> $tmpfile")                        or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               # Strip out some defines so they can be replaced:  [used for site-local.nsi]\r
+               !system("echo /\^!define\.\*RELEASE\.\*\$/d >> $tmpfile")                                                               or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo /\^!define\.\*DEBUG\.\*\$/d >> $tmpfile")                                                         or die "Fatal -- Couldn't modify $tmpfile.";    \r
+               !system("echo /\^!define\.\*BETA\.\*\$/d >> $tmpfile")                                                                  or die "Fatal -- Couldn't modify $tmpfile.";    \r
+\r
+               # Run the script on site-local.wxi:\r
+               !system("sed -f $tmpfile site-local-tagged.wxi > site-local.wxi")                                               or die "Fatal -- Couldn't modify site-local.wxi.";\r
+\r
+               # Now update site-local.nsi:\r
+               chdir "..\\nsis";\r
+               print "Info -- chdir to ".`cd`."\n"                                                                             if ($verbose);\r
+               local $tmpfile  = "site-local.sed" ;\r
+               !system("sed -f ..\\wix\\$tmpfile site-local-tagged.nsi > b.tmp")                                       or die "Fatal -- Couldn't modify site-local.wxi.";\r
+               # Add DEBUG or RELEASE:\r
+               if ($switches[0]->{debug}->{value}) {                           ## debug build\r
+                       !system("echo !define DEBUG >> b.tmp")                                                                                                                  or die "Fatal -- Couldn't modify b.tmp.";       \r
+                       }\r
+               else {                                                                                                                                          ## release build\r
+                       !system("echo !define RELEASE >> b.tmp")                                                                                                                        or die "Fatal -- Couldn't modify b.tmp.";       \r
+                       !system("echo !define NO_DEBUG >> b.tmp")                                                                                                       or die "Fatal -- Couldn't modify b.tmp.";       \r
+                       }\r
+               # Add BETA if present:\r
+               if ( exists $config->{Versions}->{'BETA_STR'}) {\r
+                       !system("echo !define BETA $config->{Versions}->{'BETA_STR'} >> b.tmp") or die "Fatal -- Couldn't modify b.tmp.";       \r
+                       }\r
+               !system("mv -f b.tmp site-local.nsi")                                                                                                                                           or die "Fatal -- Couldn't replace site-local.nsi.";\r
+\r
                if ($verbose) {print "Info -- ***   End prepackage.\n";}\r
                \r
                if ($verbose) {print "Info -- *** Begin package.\n";}\r
@@ -428,7 +521,6 @@ sub main {
 \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
@@ -473,7 +565,7 @@ sub main {
 \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
+                                               # 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 = $zip->{Prunes};\r
index a6b4ededb81fdf19280a933d27934717510e19a9..5e4200bb185ad3e580863bc563aaab60a0406553 100644 (file)
@@ -82,6 +82,12 @@ sub copyFiles {
                                        $from   =~ s/%filestem%/$FileStemFragment/g;\r
                                        $to             =~ s/%filestem%/$FileStemFragment/g;\r
                                        }               \r
+                               # %-DEBUG% substitution:\r
+                               local $DebugFragment    = ($switches[0]->{debug}->{value}) ? "-DEBUG" : "";\r
+if ($from =~ /\-DEBUG/) {print "\n$from ... \n";}\r
+                               $from   =~ s/%\-DEBUG%/$DebugFragment/g;\r
+                               $to             =~ s/%\-DEBUG%/$DebugFragment/g;\r
+if ($from =~ /DEBUG/) {print "\n$from ... \n";}\r
                                $to                                                     =~ s/\*.*//;                            ## Truncate to path before any wildcard\r
 \r
                                my $bCopyOK             = 1;\r
diff --git a/src/windows/installer/nsis/site-local-tagged.nsi b/src/windows/installer/nsis/site-local-tagged.nsi
new file mode 100644 (file)
index 0000000..26ad541
--- /dev/null
@@ -0,0 +1,13 @@
+!define KFW_TARGETDIR %TARGETDIR%\r
+!define KFW_CONFIG_DIR %CONFIGDIR-NSI%\r
+!define KFW_MAJORVERSION %VERSION_MAJOR%\r
+!define KFW_MINORVERSION %VERSION_MINOR%\r
+!define KFW_PATCHLEVEL %VERSION_PATCH%\r
+!define CL_1310\r
+\r
+!define RELEASE\r
+!define NOT_DEBUG\r
+!define BETA 1\r
+!define SAMPLE_CONFIG_REALM "ATHENA.MIT.EDU"\r
+!define HTTP_CONFIG_URL     "[Obtain a URL from your Kerberos administrator]"\r
+\r
diff --git a/src/windows/installer/nsis/site-local.nsi b/src/windows/installer/nsis/site-local.nsi
deleted file mode 100644 (file)
index 15c8620..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-!define KFW_TARGETDIR c:\projects\autobuild\pismere\staging
-!define KFW_CONFIG_DIR "c:\projects\autobuild\pismere\staging"
-!define KFW_MAJORVERSION 3
-!define KFW_MINORVERSION 2
-!define KFW_PATCHLEVEL 0
-!define CL_1310
-
-!define RELEASE
-!define NOT_DEBUG
-!define BETA 1
-!define SAMPLE_CONFIG_REALM "ATHENA.MIT.EDU"
-!define HTTP_CONFIG_URL     "[Obtain a URL from your Kerberos administrator]"
-
similarity index 88%
rename from src/windows/installer/wix/site-local.wxi
rename to src/windows/installer/wix/site-local-tagged.wxi
index ce31bd9f0412f8e2f143f5e2263ee97746397db1..2b48e5045d867a76d32a14307ed7364603e3f1f7 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>
-<Include xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
-
-    <!-- User configurable options -->
-    
-    <!-- TargetDir should point to build target directory and must end with 
-         a backslash.  If not specified, assume we are in TargetDir\install -->
-
-    <?define TargetDir="c:\temp\kfw\kfw-3.2.0-alpha\"?>
-
-    <!-- ConfigDir should point to directory containing configuration files 
-         (krb5.ini, krb.con, krbrealm.con) to be bundled with the installer.
-         The directory name should end with a backslash. -->
-
-    <?define ConfigDir="C:\Projects\Autobuild\pismere\staging\sample\"?>
-    
-    <!-- VersionMajor, VersionMinor and VersionPatch must all be specified, or 
-         none should be specified (in which case, the defaults will be
-         selected below. -->
-
-    <!-- version defs go here -->
-
-    <!-- BuildLang is the language code for the installation.  If you are
-         changing this, you should also change the ProductCode below. -->  
-    <?ifndef BuildLang?>
-        <?define BuildLang="1033"?>
-    <?endif?>
-
-    <!-- ProductCode is an uppercase GUID.  Each release should have its
-         own ProductCode.  If one is not defined, we generate a random one. -->
-    <?ifndef ProductCode?>
-           <?define ProductCode="????????-????-????-????-????????????"?>    
-    <?endif?>
-    
-    <!-- DefaultRealm, is your default realm.  Must be uppercase -->
-    <?define DefaultRealm="ATHENA.MIT.EDU"?>
-    
-    <!-- One of the following must be defined and must correspond to the
-         version of compiler used for building Kerberos for Windows -->
-
-    <!-- <?define CL1200?> -->
-    <!-- <?define CL1300?> -->
-    <?define CL1310?>
-    <!-- <?define CL1400?> -->
-
-    <!-- At most one of the following could be defined and must correspond
-         to the type of build performed. -->
-    <!-- <?define Debug?> -->
-    <?define Release?>
-
-    <!-- We are including debug symbols anyway.  Undefine this for a leaner 
-         installer without debug syms. -->
-    <?define DebugSyms?>
-
-    <!-- Optional defines -->
-    <?define Beta="1"?> <!-- Numeric Beta identifier -->
-    <!-- <?define OldHelp?> --> <!-- Specifies the use of the old leash32.hlp file 
-                           instead of the new leash32.chm file -->
-
-
-    <!-- End of user configurable options -->
-    
-    <!-- Assert that required options are defined, or select defaults if
-         they weren't -->
-
-    <?ifndef TargetDir?>
-        <?define TargetDir="$(sys.SOURCEFILEDIR)..\"?>
-    <?endif?>
-    
-    <?ifndef ConfigDir?>
-        <?define ConfigDir="$(env.SystemRoot)\"?>
-    <?endif?>
-
-    <?ifndef VersionMajor?>
-        <?define VersionMajor="3"?>
-        <?define VersionMinor="2"?>
-        <?define VersionPatch="0"?>
-    <?else?>
-        <?if Not ($(var.VersionMinor) And $(var.VersionPatch))?>
-            <?error VersionMajor, VersionMinor and VersionPatch should be specified together?>
-        <?endif?>
-    <?endif?>
-    
-    <?ifndef ProductCode?>
-        <?error Must define ProductCode?>
-    <?endif?>
-    
-    <?ifndef BuildLang?>
-        <?error Must define BuildLang?>
-    <?endif?>
-
-    <!-- DefaultRealm.  Must be uppercase. -->
-    <?ifndef DefaultRealm?>
-        <?error Must define DefaultRealm?>
-    <?endif?>
-    
-    <!-- The build makefile defines 'Date' and 'Time' which are strings that 
-         identify the time at which the build was performed. -->
+<?xml version="1.0" encoding="utf-8"?>\r
+<Include xmlns="http://schemas.microsoft.com/wix/2003/01/wi">\r
+\r
+    <!-- User configurable options -->\r
+\r
+       <!-- Items enclosed in double percent marks will be substituted by \r
+           the build script. -->\r
+    \r
+    <!-- TargetDir should point to build target directory and must end with \r
+         a backslash.  If not specified, assume we are in TargetDir\install -->\r
+\r
+    <?define TargetDir="%TARGETDIR%\"?>\r
+\r
+    <!-- ConfigDir should point to directory containing configuration files \r
+         (krb5.ini, krb.con, krbrealm.con) to be bundled with the installer.\r
+         The directory name should end with a backslash. -->\r
+\r
+    <?define ConfigDir="%CONFIGDIR-WIX%\"?>\r
+    \r
+    <!-- VersionMajor, VersionMinor and VersionPatch must all be specified, or \r
+         none should be specified (in which case, the defaults will be\r
+         selected below. -->\r
+\r
+    <!-- version defs go here -->\r
+        <?define VersionMajor="%VERSION_MAJOR%"?>\r
+        <?define VersionMinor="%VERSION_MINOR%"?>\r
+        <?define VersionPatch="%VERSION_PATCH%"?>\r
+\r
+    <!-- BuildLang is the language code for the installation.  If you are\r
+         changing this, you should also change the ProductCode below. -->  \r
+    <?ifndef BuildLang?>\r
+        <?define BuildLang="1033"?>\r
+    <?endif?>\r
+\r
+    <!-- ProductCode is an uppercase GUID.  Each release should have its\r
+         own ProductCode.  If one is not defined, we generate a random one. -->\r
+    <?ifndef ProductCode?>\r
+           <?define ProductCode="????????-????-????-????-????????????"?>    \r
+    <?endif?>\r
+    \r
+    <!-- DefaultRealm, is your default realm.  Must be uppercase -->\r
+    <?define DefaultRealm="ATHENA.MIT.EDU"?>\r
+    \r
+    <!-- One of the following must be defined and must correspond to the\r
+         version of compiler used for building Kerberos for Windows -->\r
+\r
+    <!-- <?define CL1200?> -->\r
+    <!-- <?define CL1300?> -->\r
+    <?define CL1310?>\r
+    <!-- <?define CL1400?> -->\r
+\r
+    <!-- At most one of the following could be defined and must correspond\r
+         to the type of build performed. -->\r
+    <!-- <?define Debug?> -->\r
+    <?define Release?>\r
+\r
+    <!-- We are including debug symbols anyway.  Undefine this for a leaner \r
+         installer without debug syms. -->\r
+    <?define DebugSyms?>\r
+\r
+    <!-- Optional defines -->\r
+    <?define Beta="1"?> <!-- Numeric Beta identifier -->\r
+    <!-- <?define OldHelp?> --> <!-- Specifies the use of the old leash32.hlp file \r
+                           instead of the new leash32.chm file -->\r
+\r
+\r
+    <!-- End of user configurable options -->\r
+    \r
+    <!-- Assert that required options are defined, or select defaults if\r
+         they weren't -->\r
+\r
+    <?ifndef TargetDir?>\r
+        <?define TargetDir="$(sys.SOURCEFILEDIR)..\"?>\r
+    <?endif?>\r
+    \r
+    <?ifndef ConfigDir?>\r
+        <?define ConfigDir="$(env.SystemRoot)\"?>\r
+    <?endif?>\r
+\r
+    <?ifndef VersionMajor?>\r
+        <?define VersionMajor="3"?>\r
+        <?define VersionMinor="2"?>\r
+        <?define VersionPatch="0"?>\r
+    <?else?>\r
+        <?if Not ($(var.VersionMinor) And $(var.VersionPatch))?>\r
+            <?error VersionMajor, VersionMinor and VersionPatch should be specified together?>\r
+        <?endif?>\r
+    <?endif?>\r
+    \r
+    <?ifndef ProductCode?>\r
+        <?error Must define ProductCode?>\r
+    <?endif?>\r
+    \r
+    <?ifndef BuildLang?>\r
+        <?error Must define BuildLang?>\r
+    <?endif?>\r
+\r
+    <!-- DefaultRealm.  Must be uppercase. -->\r
+    <?ifndef DefaultRealm?>\r
+        <?error Must define DefaultRealm?>\r
+    <?endif?>\r
+    \r
+    <!-- The build makefile defines 'Date' and 'Time' which are strings that \r
+         identify the time at which the build was performed. -->\r
 </Include>
\ No newline at end of file