summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Koch <kpkoch@mit.edu>2007-04-02 16:13:58 +0000
committerKevin Koch <kpkoch@mit.edu>2007-04-02 16:13:58 +0000
commitbda1c2f72144e81b8aab7db5282cfe323dddf775 (patch)
tree0c9b8bc53a4b9f6094949697dc0a0d5be744ab12 /src
parent2f49a4ffe53292a6ce3c46a12e730ad2b6799665 (diff)
downloadkrb5-bda1c2f72144e81b8aab7db5282cfe323dddf775.tar.gz
krb5-bda1c2f72144e81b8aab7db5282cfe323dddf775.tar.xz
krb5-bda1c2f72144e81b8aab7db5282cfe323dddf775.zip
Uncomment w2k files in corebinaries.xml
Factor processing of <Prunes> xml into pruneFiles.pl. Factor processing of <Zips> xml into zipXML.pl. Move SRC zip XML to <FetchSources> section of config file. Call zipXML in /REPOSITORY CHECKOUT section of script. Keep track of cleaning of OUTDIR so SRC zip isn't removed during packaging. Remove UNIXFIND from config file. If UNIXFIND isn't present in the config file, set the in-memory UNIXFIND to c:\tools\cygwin\bin. UNIXFIND is now an implementation detail stored in the in-memory config XML, like the versions read from kerberos.ver. Prune more temporary files before making SDK zip. Remove redundant custom files from sdkfiles.xml. Copy *.* from staging/inc instead of *.h -- one .c file is also required. Target_Version: 1.6.1 Ticket: 5490 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19375 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/windows/build/BKWconfig.xml66
-rw-r--r--src/windows/build/bkw.pl218
-rw-r--r--src/windows/build/corebinaryfiles.xml11
-rw-r--r--src/windows/build/makeZip.pl41
-rw-r--r--src/windows/build/pruneFiles.pl34
-rw-r--r--src/windows/build/sdkfiles.xml8
-rw-r--r--src/windows/build/zipXML.pl21
7 files changed, 217 insertions, 182 deletions
diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml
index 37c1a5c43b..a7a34ee2a3 100644
--- a/src/windows/build/BKWconfig.xml
+++ b/src/windows/build/BKWconfig.xml
@@ -12,7 +12,6 @@
of the repositories will cause pismere/athena to be created under <src>. -->
<src path ="C:\projects\Autobuild" />
<out path ="C:\projects\Autobuild\public" /> <!-- Must be absolute path. -->
- <unixfind path ="c:\cygwin\bin" />
</Directories>
<Options>
<debug value="0" />
@@ -33,8 +32,38 @@
<SVNURL name="svn.mit.edu" /> <!-- NB: No protocol or slashes!! -->
<USERNAME name="" /> <!-- Needed for svn/plink. Override from command line -->
</Config>
- </FetchSources>
- <Make></Make>
+ <Zips>
+ <Zip dummy="foo" /> <!-- To force desired XML::Simple behavior -->
+ <Zip name="SRC" filename="%filestem%-src.zip" topdir="%filestem%-final">
+ <CopyList>
+ <Files>
+ <!-- File from paths are relative to <src>/pismere. -->
+ <!-- File to paths are relative to <out>. -->
+ <File dummy="foo" /> <!-- Forces XML::Simple behavior -->
+ <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->
+ <File name="*.*" from="athena" to="src\athena" />
+ <File name="*.*" from="doc" to="src\doc" />
+ <File name="*.*" from="scripts" to="src\scripts" />
+ </Files>
+ </CopyList>
+ <Prunes> <!-- Files to be removed from current build to match what is in the 3.1 distribution: -->
+ <Prune dummy="foo" />
+ <Prune name="CVS" />
+ <Prune name=".cvsignore" flags="i" />
+ <Prune name="Changelog" flags="i" />
+ <Prune name="site" />
+ </Prunes>
+ <Requires>
+ <Switch dummy="foo" />
+ <Switch name="REPOSITORY" value="CHECKOUT"/>
+ <ErrorMsg text="Can't build source zip unless /REPOSITORY CHECKOUT is specified." />
+ </Requires>
+ </Zip>
+ </Zips>
+ </FetchSources>
+ <Make>
+ <!-- Script checks for prunes. -->
+ </Make>
<PrePackage>
<CopyList>
<Config>
@@ -110,33 +139,12 @@
<Prune dummy="foo" />
<Prune name="*.exe" />
<Prune name="*.msi" />
+ <Prune name="*.dll" />
+ <Prune name="*.obj" />
+ <Prune name="*.wixobj" />
+ <Prune name="custom.lib" />
+ <Prune name="custom.exp" />
</Prunes>
- </Zip>
- <Zip name="SRC" filename="%filestem%-src.zip" topdir="%filestem%-final">
- <CopyList>
- <Files>
- <!-- File from paths are relative to <src>/pismere. -->
- <!-- File to paths are relative to <out>. -->
- <File dummy="foo" /> <!-- Forces XML::Simple behavior -->
- <!-- Without this, XML::Simple does not make an anonymous array and I can't figure out how to iterate over it. -->
- <File name="*.*" from="athena" to="src\athena" />
- <File name="*.*" from="doc" to="src\doc" />
- <File name="*.*" from="scripts" to="src\scripts" />
- </Files>
- </CopyList>
- <Prunes> <!-- Files to be removed from current build to match what is in the 3.1 distribution: -->
- <Prune dummy="foo" />
- <Prune name="CVS" />
- <Prune name=".cvsignore" flags="i" />
- <Prune name="Changelog" flags="i" />
- <Prune name="obj" />
- <Prune name="site" />
- </Prunes>
- <Requires>
- <Switch dummy="foo" />
- <Switch name="REPOSITORY" value="CHECKOUT"/>
- <ErrorMsg text="Can't build source zip unless /REPOSITORY CHECKOUT is specified." />
- </Requires>
</Zip>
</Zips>
<CopyList> <!-- Copied at end of post-package step. -->
diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl
index a5d0142335..6c9fad1f5b 100644
--- a/src/windows/build/bkw.pl
+++ b/src/windows/build/bkw.pl
@@ -12,8 +12,9 @@ use Data::Dumper;
use Archive::Zip;
use Logger;
require "copyfiles.pl";
+require "prunefiles.pl";
require "signfiles.pl";
-require "makeZip.pl";
+require "zipXML.pl";
my $BAIL;
$0 = fileparse($0);
@@ -122,9 +123,9 @@ sub main {
# List of programs which must be in PATH:
my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', 'hhc', 'candle', 'light', 'makensis', 'nmake', 'plink');
- my $requirements_met = 1;
- my $first_missing = 0;
- my $error_list = "";
+ my $requirements_met = 1;
+ my $first_missing = 0;
+ my $error_list = "";
foreach my $required (@required_list) {
if (!get_info($required)) {
$requirements_met = 0;
@@ -150,8 +151,8 @@ sub main {
##++ Assemble configuration from config file and command line:
- my $configfile;
- $configfile = $OPT->{config};
+ my $configfile = $OPT->{config};
+ my $bOutputCleaned = 0;
print "Info -- Reading configuration from $configfile.\n";
@@ -212,6 +213,78 @@ sub main {
#print "cvs tag: $tags[0]->{cvs}->{value}\n";
#print "CVSROOT: $fetch[0]->{CVSROOT}->{name}\n";
+ # We read in the version information to be able to update the site-local files in the install build areas:
+ local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path};
+ open(DAT, "$src/$version_path") or die "Could not open $version_path.";
+ @raw = <DAT>;
+ close DAT;
+ foreach $line (@raw) {
+ chomp $line;
+ if ($line =~ /#define/) { # Process #define lines:
+ $line =~ s/#define//; # Remove #define token
+ $line =~ s/^\s+//; # and leading & trailing whitespace
+ $line =~ s/\s+$//;
+ local @qr = split("\"", $line); # Try splitting with quotes
+ if (exists $qr[1]) {
+ $qr[0] =~ s/^\s+//; # Clean up whitespace
+ $qr[0] =~ s/\s+$//;
+ $config->{Versions}->{$qr[0]} = $qr[1]; # Save string
+ }
+ else { # No quotes, so
+ local @ar = split(" ", $line); # split with space
+ $ar[0] =~ s/^\s+//; # Clean up whitespace
+ $ar[0] =~ s/\s+$//;
+ $config->{Versions}->{$ar[0]} = $ar[1]; # and save numeric value
+ }
+ }
+ }
+
+ # Check that the versions we will need for site-local have been defined:
+ my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV',
+ 'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR',
+ 'VER_PRODUCTNAME_STR');
+ $requirements_met = 1;
+ $first_missing = 0;
+ $error_list = "";
+ foreach my $required (@required_versions) {
+ if (! exists $config->{Versions}->{$required}) {
+ $requirements_met = 0;
+ if (!$first_missing) {
+ $first_missing = 1;
+ $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n";
+ }
+ $error_list .= "$required\n";
+ }
+ }
+ if (!$requirements_met) {
+ print $error_list;
+ exit(0);
+ }
+ # Apply any of these tags to filestem:
+ my $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};
+ $filestem =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/;
+ $filestem =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/;
+ $filestem =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/;
+ $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name} = $filestem;
+
+ # Test the unix find command:
+ if (! exists $config->{CommandLine}->{Directories}->{unixfind}->{path}) {
+ $config->{CommandLine}->{Directories}->{unixfind}->{path} = "C:\\tools\\cygwin\\bin";
+ }
+ local $unixfind = $config->{CommandLine}->{Directories}->{unixfind}->{path};
+
+ local $savedPATH = $ENV{PATH};
+ $ENV{PATH} = $unixfind.";".$savedPATH;
+print "PATH now $ENV{PATH}\n";
+ print "Info -- chdir to ".`cd`."\n" if ($verbose);
+ if (-e "a.tmp") {!system("rm a.tmp") or die "Fatal -- Couldn't clean temporary file a.tmp.";}
+ !system("find . -name a.tmp > b.tmp 2>&1") or die "Fatal -- find test failed.";
+ local $filesize = -s "b.tmp";
+ $ENV{PATH} = $savedPATH;
+ if ($filesize > 0) {
+ die "Fatal -- $unixfind does not appear to be a path to a UNIX find command.";
+ }
+
##-- Assemble configuration from config file and command line.
my $sw = $switches[0]->{repository}->{value};
@@ -228,6 +301,11 @@ sub main {
}
$switches[0]->{repository}->{value} = $rverb; ## Save canonicalized repository verb.
+ if ( ($rverb =~ /checkout/) && $clean) {
+ print "Warning -- Because sources afe being checked out, make clean will not be run.\n";
+ $clean = $switches[0]->{clean}->{value} = 0;
+ }
+
my $wd = $src."\\pismere";
if (! ($rverb =~ /skip/)) {
@@ -316,6 +394,15 @@ sub main {
if ($verbose) {print "Info -- svn command: $svncmd\n";}
!system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n";
+ if ($rverb =~ /checkout/) {
+ if (! $bOutputCleaned) { ## In case somebody cleaned $out before us.
+ if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory.
+ else {mkdir($out);}
+ $bOutputCleaned = 1;
+ }
+ zipXML($config->{Stages}->{FetchSources}, $config); ## Make zips.
+ }
+
if ($verbose) {print "Info -- *** End fetching sources.\n";}
}
##-- End repository action.
@@ -345,31 +432,7 @@ sub main {
}
# Prune any unwanted directories before the build:
- if (exists $config->{Stages}->{Make}->{Prunes}) {
- # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done:
- my $savedPATH = $ENV{PATH};
- $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;
- my $prunes = $config->{Stages}->{Make}->{Prunes};
- my $j=0;
- print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);
-print Dumper($prunes);
- while ($prunes->{Prune}->[$j]) {
- if (exists $prunes->{Prune}->[$j]->{name}) { ## Don't process dummy entry!
- my $prune = $prunes->{Prune}->[$j]->{name};
- my $flags = $prunes->{Prune}->[$j]->{flags};
- $flags = "" if (!$flags);
- my $cmd = "find . -".$flags."name $prune";
- print "Info -- Looking for filenames containing $prune\n";
- my $list = `$cmd`;
- foreach $target (split("\n", $list)) {
- print "Info -- Pruning $target\n" if ($verbose);
- ! system("rm -rf $target") or die "Unable to prune $target";
- }
- }
- $j++;
- }
- $ENV{PATH} = $savedPATH;
- }
+ pruneFiles($config->{Stages}->{Make}, $config);
if ($verbose) {print "Info -- *** End preparing for build.\n";}
@@ -385,7 +448,7 @@ print Dumper($prunes);
chdir("$wd\\athena") or die "Fatal -- couldn't chdir to source directory $wd\\athena\n";
print "Info -- chdir to ".`cd`."\n" if ($verbose);
- my $dbgswitch = ($switches[0]->{debug}->{value}) ? " " : "NODEBUG=1";
+ local $dbgswitch = ($switches[0]->{debug}->{value}) ? " " : "NODEBUG=1";
!system("perl ../scripts/build.pl --softdirs --nolog $buildtarget $dbgswitch") or die "Fatal -- build $buildtarget failed.";
chdir("$wd") or die "Fatal -- couldn't chdir to $wd.";
@@ -401,76 +464,21 @@ print Dumper($prunes);
##-- Make action.
##++ Package action:
- if ($switches[0]->{nopackage}->{value}) { ## If /clean, this switch will have been cleared.
- print "Info -- *** Skipping packaging.";
- if (-d $out) {
+ if ($switches[0]->{nopackage}->{value}) { ## If /clean, nopackage will be set.
+ print "Info -- *** Skipping packaging.\n";
+ if ((-d $out) && ! $bOutputCleaned) {
print "Warning -- *** Output directory $out will not be cleaned.\n";
}
}
else {
if ($verbose) {print "Info -- *** Begin prepackage.\n";}
- if (-d $out) {
- !system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out.";
- }
- else {
- mkdir($out) or die "Fatal -- Couldn't create $out.";
- }
-
- # We read in the version information to be able to update the site-local files in the install build areas:
- local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path};
- open(DAT, "$src/$version_path") or die "Could not open $version_path.";
- @raw = <DAT>;
- close DAT;
- foreach $line (@raw) {
- chomp $line;
- if ($line =~ /#define/) { # Process #define lines:
- $line =~ s/#define//; # Remove #define token
- $line =~ s/^\s+//; # and leading & trailing whitespace
- $line =~ s/\s+$//;
- local @qr = split("\"", $line); # Try splitting with quotes
- if (exists $qr[1]) {
- $qr[0] =~ s/^\s+//; # Clean up whitespace
- $qr[0] =~ s/\s+$//;
- $config->{Versions}->{$qr[0]} = $qr[1]; # Save string
- }
- else { # No quotes, so
- local @ar = split(" ", $line); # split with space
- $ar[0] =~ s/^\s+//; # Clean up whitespace
- $ar[0] =~ s/\s+$//;
- $config->{Versions}->{$ar[0]} = $ar[1]; # and save numeric value
- }
- }
+ if (! $bOutputCleaned) { ## In case somebody cleaned $out before us.
+ if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory.
+ else {mkdir($out);}
+ $bOutputCleaned = 1;
}
- # Check that the versions we will need for site-local have been defined:
- my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV',
- 'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR',
- 'VER_PRODUCTNAME_STR');
- my $requirements_met = 1;
- my $first_missing = 0;
- my $error_list = "";
- foreach my $required (@required_versions) {
- if (! exists $config->{Versions}->{$required}) {
- $requirements_met = 0;
- if (!$first_missing) {
- $first_missing = 1;
- $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n";
- }
- $error_list .= "$required\n";
- }
- }
- if (!$requirements_met) {
- print $error_list;
- exit(0);
- }
- # Apply any of these tags to filestem:
- my $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};
- $filestem =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/;
- $filestem =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/;
- $filestem =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/;
- $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name} = $filestem;
-
# The build results are copied to a staging area, where the packager expects to find them.
# We put the staging area in the fixed area .../pismere/staging.
my $prepackage = $config->{Stages}->{PrePackage};
@@ -525,11 +533,13 @@ print Dumper($prunes);
# Run the script on site-local.wxi:
!system("sed -f $tmpfile site-local-tagged.wxi > site-local.wxi") or die "Fatal -- Couldn't modify site-local.wxi.";
+ !system("rm site-local-tagged.wxi") or die "Fatal -- Couldn't remove site-local-tagged.wsi.";
# Now update site-local.nsi:
chdir "..\\nsis";
print "Info -- chdir to ".`cd`."\n" if ($verbose);
!system("sed -f ..\\wix\\$tmpfile site-local-tagged.nsi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi.";
+ !system("rm site-local-tagged.nsi") or die "Fatal -- Couldn't remove site-local-tagged.nsi.";
# Add DEBUG or RELEASE:
if ($switches[0]->{debug}->{value}) { ## debug build
!system("echo !define DEBUG >> b.tmp") or die "Fatal -- Couldn't modify b.tmp.";
@@ -546,6 +556,8 @@ print Dumper($prunes);
# Run the script on nsi-includes-tagged.nsi:
!system("sed -f ..\\wix\\$tmpfile nsi-includes-tagged.nsi > nsi-includes.nsi") or die "Fatal -- Couldn't modify nsi-includes.nsi.";
+ !system("rm nsi-includes-tagged.nsi") or die "Fatal -- Couldn't remove nsi-includes-tagged.nsi.";
+ !system("rm ..\\wix\\$tmpfile") or die "Fatal -- Couldn't remove $tmpfile.";
if ($verbose) {print "Info -- *** End prepackage.\n";}
@@ -563,22 +575,8 @@ print Dumper($prunes);
!system("makensis kfw.nsi") or die "Error -- executable installer build failed.";
# Begin packaging extra items:
- chdir($src); # Now in <src>.
- print "Info -- chdir to ".`cd`."\n" if ($verbose);
- if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory.
- else {mkdir($out);}
- my $zipsXML = $config->{Stages}->{PostPackage}->{Zips};
-
- local $i = 0;
- while ($zipsXML->{Zip}[$i]) {
- local $zip = $zipsXML->{Zip}[$i];
- makeZip($zip, $config) if (exists $zip->{name}); ## Ignore dummy entry.
- chdir("$out");
- print "Info -- chdir to ".`cd`."\n" if ($verbose);
- system("rm -rf ziptemp") if (-d "ziptemp"); ## Clean up any temp directory.
- $i++;
- } ## End zip in xml.
-
+ zipXML($config->{Stages}->{PostPackage}, $config); ## Make zips.
+
$config->{Stages}->{PostPackage}->{CopyList}->{Config} = $config->{Stages}->{PostPackage}->{Config}; ## Use the post package config.
$config->{Stages}->{PostPackage}->{CopyList}->{Config}->{From}->{root} = "$src\\pismere";
$config->{Stages}->{PostPackage}->{CopyList}->{Config}->{To}->{root} = "$out";
diff --git a/src/windows/build/corebinaryfiles.xml b/src/windows/build/corebinaryfiles.xml
index 41c569e6c1..c3b35f5c1a 100644
--- a/src/windows/build/corebinaryfiles.xml
+++ b/src/windows/build/corebinaryfiles.xml
@@ -77,11 +77,8 @@
<File name="xpprof32.dll" from="staging\bin\i386" to="\bin\i386\" />
<File name="xpprof32.pdb" from="staging\bin\i386" to="\bin\i386\" />
-<!--
-target\bin\i386\%bldtype%\ w2k\netidmgr.exe
-target\bin\i386\%bldtype%\ w2k\netidmgr.pdb
-target\bin\i386\%bldtype%\ w2k\nidmgr32.dll
-target\bin\i386\%bldtype%\ w2k\nidmgr32.pdb
--->
-
+ <File name="netidmgr.exe" from="staging\bin\i386\w2k" to="\bin\i386\w2k" />
+ <File name="netidmgr.pdb" from="staging\bin\i386\w2k" to="\bin\i386\w2k" />
+ <File name="nidmgr32.dll" from="staging\bin\i386\w2k" to="\bin\i386\w2k" />
+ <File name="nidmgr32.pdb" from="staging\bin\i386\w2k" to="\bin\i386\w2k" />
</Files> \ No newline at end of file
diff --git a/src/windows/build/makeZip.pl b/src/windows/build/makeZip.pl
index 4162386df4..12215ddcd6 100644
--- a/src/windows/build/makeZip.pl
+++ b/src/windows/build/makeZip.pl
@@ -1,9 +1,10 @@
#!perl -w
#use strict;
-use Data::Dumper;
-require "signfiles.pl";
+require "prunefiles.pl";
+
+use Data::Dumper;
sub makeZip {
local ($zip, $config) = @_;
@@ -64,40 +65,20 @@ sub makeZip {
print "Info -- chdir to ".`cd`."\n" if ($verbose);
# Prune any unwanted files or directories from the directory we're about to zip:
- if (exists $zip->{Prunes}) {
- # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done:
- local $savedPATH = $ENV{PATH};
- $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;
- local $prunes = $zip->{Prunes};
- local $j = 0;
- print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);
- while ($prunes->{Prune}->[$j]) {
- if (exists $prunes->{Prune}->[$j]->{name}) { ## Don't process dummy entry!
- local $prune = $prunes->{Prune}->[$j]->{name};
- local $flags = $prunes->{Prune}->[$j]->{flags};
- $flags = "" if (!$flags);
- local $cmd = "find . -".$flags."name $prune";
- print "Info -- Looking for filenames containing $prune\n";
- local $list = `$cmd`;
- foreach $target (split("\n", $list)) {
- print "Info -- Pruning $target\n" if ($verbose);
- !system("rm -rf $target") or die "Error -- Couldn't remove $target.";;
- }
- }
- $j++;
- }
- $ENV{PATH} = $savedPATH;
- }
+ pruneFiles($zip, $config);
local $zipfile = Archive::Zip->new();
local $topdir = $zip->{topdir};
$topdir =~ s/%filestem%/$filestem/g;
$zipfile->addTree('.', $topdir);
- if (-e $zipname) {!system("rm -f $zipname") or die "Error -- Couldn't remove $zipname.";}
+ if (-e $zipname) {!system("rm -f $zipname") or die "Error -- Couldn't remove $zipname.";}
$zipfile->writeToFileNamed($zipname);
- print "Info -- created $out\\$zipname.\n" if ($verbose);
- # move .zip from <out>/ziptemp to <out>.
- !system("mv -f $zipname ..") or die "Error -- Couldn't move $zipname to ..";
+ chdir("$out");
+ print "Info -- chdir to ".`cd`."\n" if ($verbose);
+ # move .zip from <out>/ziptemp to <out>.
+ !system("mv -f ziptemp/$zipname .") or die "Error -- Couldn't move $zipname to ..";
+ system("rm -rf ziptemp") if (-d "ziptemp"); ## Clean up any temp directory.
+ print "Info -- created $out\\$zipname.\n" if ($verbose);
}
return 1; \ No newline at end of file
diff --git a/src/windows/build/pruneFiles.pl b/src/windows/build/pruneFiles.pl
new file mode 100644
index 0000000000..2406c770ec
--- /dev/null
+++ b/src/windows/build/pruneFiles.pl
@@ -0,0 +1,34 @@
+#!perl -w
+
+#use strict;
+require "makeZip.pl";
+
+sub pruneFiles {
+ local ($xml, $config) = @_;
+ local $prunes = $xml->{Prunes};
+ if (! $prunes) {return 0;}
+
+ # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done:
+ local $savedPATH = $ENV{PATH};
+ $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;
+ local $j=0;
+ print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);
+ while ($prunes->{Prune}->[$j]) {
+ if (exists $prunes->{Prune}->[$j]->{name}) { ## Don't process dummy entry!
+ local $prune = $prunes->{Prune}->[$j]->{name};
+ local $flags = $prunes->{Prune}->[$j]->{flags};
+ $flags = "" if (!$flags);
+ local $cmd = "find . -".$flags."name $prune";
+ print "Info -- Looking for filenames containing $prune\n";
+ local $list = `$cmd`;
+ foreach $target (split("\n", $list)) {
+ print "Info -- Pruning $target\n" if ($verbose);
+ ! system("rm -rf $target") or die "Unable to prune $target";
+ }
+ }
+ $j++;
+ }
+ $ENV{PATH} = $savedPATH;
+ }
+
+return 1;
diff --git a/src/windows/build/sdkfiles.xml b/src/windows/build/sdkfiles.xml
index d62b962b2d..5ef7f48fb0 100644
--- a/src/windows/build/sdkfiles.xml
+++ b/src/windows/build/sdkfiles.xml
@@ -8,7 +8,8 @@
<File name="relnotes.html" from="doc\kerberos" to="doc" />
<File name="kclient.rtf" from="athena\auth\krb4\kclient\doc" to="doc" />
- <File name="*.h" from="staging\inc" to="inc" />
+ <File name="*.*" from="staging\inc" to="inc" />
+ <!-- loadfuncs.c is deliberately here. Otherwise, *.h would work. -->
<File name="*.*" from="staging\install\nsis" to="install\nsis\" />
<!-- We'll clean up the exes in the target directory in a later step. -->
@@ -16,11 +17,6 @@
<File name="*.*" from="staging\install\wix" to="install\wix\" />
<!-- We'll clean up the msi in the target directory in a later step. -->
- <File name="custom.cpp" from="staging\install\wix\custom" to="install\wix\custom\" />
- <File name="custom.h" from="staging\install\wix\custom" to="install\wix\custom\" />
-
- <!-- Why not license.rtf? -->
-
<File name="*.lib" from="staging\lib\i386" to="lib\i386\" />
</Files> \ No newline at end of file
diff --git a/src/windows/build/zipXML.pl b/src/windows/build/zipXML.pl
new file mode 100644
index 0000000000..0c50e96aed
--- /dev/null
+++ b/src/windows/build/zipXML.pl
@@ -0,0 +1,21 @@
+#!perl -w
+
+#use strict;
+require "makeZip.pl";
+
+use Data::Dumper;
+
+sub zipXML {
+ local ($xml, $config) = @_;
+ my $zipsXML = $xml->{Zips};
+ if (! $zipsXML) {return 0;}
+
+ local $i = 0;
+ while ($zipsXML->{Zip}[$i]) {
+ local $zip = $zipsXML->{Zip}[$i];
+ makeZip($zip, $config) if (exists $zip->{name}); ## Ignore dummy entry.
+ $i++;
+ } ## End zip in xml.
+ }
+
+return 1;