Provide for client-only installs with MSVC.
authorAndrew Dunstan
Sun, 26 Jan 2014 22:03:13 +0000 (17:03 -0500)
committerAndrew Dunstan
Sun, 26 Jan 2014 22:03:13 +0000 (17:03 -0500)
MauMau.

doc/src/sgml/install-windows.sgml
src/tools/msvc/Install.pm
src/tools/msvc/install.bat
src/tools/msvc/install.pl
src/tools/msvc/vcregress.pl

index 28933b6cf55a65400a2ce34ef344fb348fde220f..71a5c2e96307a9b1ca856babe701d7a00705bd12 100644 (file)
@@ -408,6 +408,14 @@ $ENV{CONFIG}="Debug";
    required to initialize and use the database, run the command:
 
 install c:\destination\directory
+
+  
+
+  
+   If you want to install only the client applications and
+   interface libraries, then you can use these commands:
+
+install c:\destination\directory client
 
   
  
index a11c59b89de226be43b5fbc3d0072cd8ac5d9f95..55de9e55e6b9e8b6476ada4d5c7622af9c7e0039 100644 (file)
@@ -17,6 +17,16 @@ our (@ISA, @EXPORT_OK);
 @ISA       = qw(Exporter);
 @EXPORT_OK = qw(Install);
 
+my $insttype;
+my @client_contribs = ('oid2name', 'pgbench', 'vacuumlo');
+my @client_program_files = (
+   'clusterdb',     'createdb',       'createlang', 'createuser',
+   'dropdb',        'droplang',       'dropuser',   'ecpg',
+   'libecpg',       'libecpg_compat', 'libpgtypes', 'libpq',
+   'pg_basebackup', 'pg_config',      'pg_dump',    'pg_dumpall',
+   'pg_isready',    'pg_receivexlog', 'pg_restore', 'psql',
+   'reindexdb',     'vacuumdb',       @client_contribs);
+
 sub lcopy
 {
    my $src    = shift;
@@ -37,6 +47,8 @@ sub Install
    $| = 1;
 
    my $target = shift;
+   $insttype = shift;
+   $insttype = "all" unless ($insttype);
 
    # if called from vcregress, the config will be passed to us
    # so no need to re-include these
@@ -65,24 +77,31 @@ sub Install
    my $majorver = DetermineMajorVersion();
    print "Installing version $majorver for $conf in $target\n";
 
-   EnsureDirectories(
-       $target,              'bin',
-       'lib',                'share',
-       'share/timezonesets', 'share/extension',
-       'share/contrib',      'doc',
-       'doc/extension',      'doc/contrib',
-       'symbols',            'share/tsearch_data');
+   my @client_dirs = ('bin', 'lib', 'share', 'symbols');
+   my @all_dirs = (
+       @client_dirs, 'doc', 'doc/contrib', 'doc/extension', 'share/contrib',
+       'share/extension', 'share/timezonesets', 'share/tsearch_data');
+   if ($insttype eq "client")
+   {
+       EnsureDirectories($target, @client_dirs);
+   }
+   else
+   {
+       EnsureDirectories($target, @all_dirs);
+   }
 
    CopySolutionOutput($conf, $target);
    lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
    my $sample_files = [];
+   my @top_dir      = ("src");
+   @top_dir = ("src\\bin", "src\\interfaces") if ($insttype eq "client");
    File::Find::find(
        {   wanted => sub {
                /^.*\.sample\z/s
                  && push(@$sample_files, $File::Find::name);
              }
        },
-       "src");
+       @top_dir);
    CopySetOfFiles('config files', $sample_files, $target . '/share/');
    CopyFiles(
        'Import libraries',
@@ -95,53 +114,57 @@ sub Install
        "libpgport\\libpgport.lib",
        "libpgtypes\\libpgtypes.lib",
        "libecpg_compat\\libecpg_compat.lib");
-   CopySetOfFiles(
-       'timezone names',
-       [ glob('src\timezone\tznames\*.txt') ],
-       $target . '/share/timezonesets/');
-   CopyFiles(
-       'timezone sets',
-       $target . '/share/timezonesets/',
-       'src/timezone/tznames/', 'Default', 'Australia', 'India');
-   CopySetOfFiles(
-       'BKI files',
-       [ glob("src\\backend\\catalog\\postgres.*") ],
-       $target . '/share/');
-   CopySetOfFiles(
-       'SQL files',
-       [ glob("src\\backend\\catalog\\*.sql") ],
-       $target . '/share/');
-   CopyFiles(
-       'Information schema data', $target . '/share/',
-       'src/backend/catalog/',    'sql_features.txt');
-   GenerateConversionScript($target);
-   GenerateTimezoneFiles($target, $conf);
-   GenerateTsearchFiles($target);
-   CopySetOfFiles(
-       'Stopword files',
-       [ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
-       $target . '/share/tsearch_data/');
-   CopySetOfFiles(
-       'Dictionaries sample files',
-       [ glob("src\\backend\\tsearch\\*_sample.*") ],
-       $target . '/share/tsearch_data/');
    CopyContribFiles($config, $target);
    CopyIncludeFiles($target);
 
-   my $pl_extension_files = [];
-   my @pldirs             = ('src/pl/plpgsql/src');
-   push @pldirs, "src/pl/plperl"   if $config->{perl};
-   push @pldirs, "src/pl/plpython" if $config->{python};
-   push @pldirs, "src/pl/tcl"      if $config->{tcl};
-   File::Find::find(
-       {   wanted => sub {
-               /^(.*--.*\.sql|.*\.control)\z/s
-                 && push(@$pl_extension_files, $File::Find::name);
-             }
-       },
-       @pldirs);
-   CopySetOfFiles('PL Extension files',
-       $pl_extension_files, $target . '/share/extension/');
+   if ($insttype ne "client")
+   {
+       CopySetOfFiles(
+           'timezone names',
+           [ glob('src\timezone\tznames\*.txt') ],
+           $target . '/share/timezonesets/');
+       CopyFiles(
+           'timezone sets',
+           $target . '/share/timezonesets/',
+           'src/timezone/tznames/', 'Default', 'Australia', 'India');
+       CopySetOfFiles(
+           'BKI files',
+           [ glob("src\\backend\\catalog\\postgres.*") ],
+           $target . '/share/');
+       CopySetOfFiles(
+           'SQL files',
+           [ glob("src\\backend\\catalog\\*.sql") ],
+           $target . '/share/');
+       CopyFiles(
+           'Information schema data', $target . '/share/',
+           'src/backend/catalog/',    'sql_features.txt');
+       GenerateConversionScript($target);
+       GenerateTimezoneFiles($target, $conf);
+       GenerateTsearchFiles($target);
+       CopySetOfFiles(
+           'Stopword files',
+           [ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
+           $target . '/share/tsearch_data/');
+       CopySetOfFiles(
+           'Dictionaries sample files',
+           [ glob("src\\backend\\tsearch\\*_sample.*") ],
+           $target . '/share/tsearch_data/');
+
+       my $pl_extension_files = [];
+       my @pldirs             = ('src/pl/plpgsql/src');
+       push @pldirs, "src/pl/plperl"   if $config->{perl};
+       push @pldirs, "src/pl/plpython" if $config->{python};
+       push @pldirs, "src/pl/tcl"      if $config->{tcl};
+       File::Find::find(
+           {   wanted => sub {
+                   /^(.*--.*\.sql|.*\.control)\z/s
+                     && push(@$pl_extension_files, $File::Find::name);
+                 }
+           },
+           @pldirs);
+       CopySetOfFiles('PL Extension files',
+           $pl_extension_files, $target . '/share/extension/');
+   }
 
    GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls});
 
@@ -218,6 +241,10 @@ sub CopySolutionOutput
 
        $sln =~ s/$rem//;
 
+       next
+         if ($insttype eq "client" && !grep { $_ eq $pf }
+           @client_program_files);
+
        my $proj = read_file("$pf.$vcproj")
          || croak "Could not open $pf.$vcproj\n";
        if ($vcproj eq 'vcproj' && $proj =~ qr{ConfigurationType="([^"]+)"})
@@ -378,6 +405,9 @@ sub CopyContribFiles
    {
        next if ($d =~ /^\./);
        next unless (-f "contrib/$d/Makefile");
+       next
+         if ($insttype eq "client" && !grep { $_ eq $d } @client_contribs);
+
        next if ($d eq "uuid-ossp" && !defined($config->{uuid}));
        next if ($d eq "sslinfo"   && !defined($config->{openssl}));
        next if ($d eq "xml2"      && !defined($config->{xml}));
index c636cbd7f70db47665ca993a9e3ebc5d1288637a..bed08f1e125dd9b05c9c61819ac03bf4cfe4ac3b 100644 (file)
@@ -20,7 +20,7 @@ CALL bldenv.bat
 del bldenv.bat
 :nobuildenv
 
-perl install.pl "%1"
+perl install.pl "%1" %2
 
 REM exit fix for pre-2003 shell especially if used on buildfarm
 if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
index f27a7b3f1629f0479afea6b2daf5e3edf73ed14a..97e297e1765a4258bd985723a75c9ef6158adfe5 100755 (executable)
@@ -9,10 +9,12 @@ use warnings;
 use Install qw(Install);
 
 my $target = shift || Usage();
-Install($target);
+my $insttype = shift;
+Install($target, $insttype);
 
 sub Usage
 {
-   print "Usage: install.pl \n";
+   print "Usage: install.pl  [installtype]\n";
+   print "installtype: client\n";
    exit(1);
 }
index cbf6a4612b5b3ec874e5921135ce09c44e115b2e..447b4a19167d7de0bab9aacd52c95b5ec6ec90e8 100644 (file)
@@ -150,7 +150,7 @@ sub isolationcheck
 {
    chdir "../isolation";
    copy("../../../$Config/isolationtester/isolationtester.exe",
-        "../../../$Config/pg_isolation_regress");
+       "../../../$Config/pg_isolation_regress");
    my @args = (
        "../../../$Config/pg_isolation_regress/pg_isolation_regress",
        "--psqldir=../../../$Config/psql",
@@ -252,7 +252,7 @@ sub upgradecheck
    (mkdir $tmp_root || die $!) unless -d $tmp_root;
    my $tmp_install = "$tmp_root/install";
    print "Setting up temp install\n\n";
-   Install($tmp_install, $config);
+   Install($tmp_install, "all", $config);
 
    # Install does a chdir, so change back after that
    chdir $cwd;