parent
790eaa699e
commit
a7e5f7bf68
|
@ -408,6 +408,14 @@ $ENV{CONFIG}="Debug";
|
||||||
required to initialize and use the database, run the command:
|
required to initialize and use the database, run the command:
|
||||||
<screen>
|
<screen>
|
||||||
<userinput>install c:\destination\directory</userinput>
|
<userinput>install c:\destination\directory</userinput>
|
||||||
|
</screen>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If you want to install only the client applications and
|
||||||
|
interface libraries, then you can use these commands:
|
||||||
|
<screen>
|
||||||
|
<userinput>install c:\destination\directory client</userinput>
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
|
@ -17,6 +17,16 @@ our (@ISA, @EXPORT_OK);
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT_OK = qw(Install);
|
@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
|
sub lcopy
|
||||||
{
|
{
|
||||||
my $src = shift;
|
my $src = shift;
|
||||||
|
@ -37,6 +47,8 @@ sub Install
|
||||||
$| = 1;
|
$| = 1;
|
||||||
|
|
||||||
my $target = shift;
|
my $target = shift;
|
||||||
|
$insttype = shift;
|
||||||
|
$insttype = "all" unless ($insttype);
|
||||||
|
|
||||||
# if called from vcregress, the config will be passed to us
|
# if called from vcregress, the config will be passed to us
|
||||||
# so no need to re-include these
|
# so no need to re-include these
|
||||||
|
@ -65,24 +77,31 @@ sub Install
|
||||||
my $majorver = DetermineMajorVersion();
|
my $majorver = DetermineMajorVersion();
|
||||||
print "Installing version $majorver for $conf in $target\n";
|
print "Installing version $majorver for $conf in $target\n";
|
||||||
|
|
||||||
EnsureDirectories(
|
my @client_dirs = ('bin', 'lib', 'share', 'symbols');
|
||||||
$target, 'bin',
|
my @all_dirs = (
|
||||||
'lib', 'share',
|
@client_dirs, 'doc', 'doc/contrib', 'doc/extension', 'share/contrib',
|
||||||
'share/timezonesets', 'share/extension',
|
'share/extension', 'share/timezonesets', 'share/tsearch_data');
|
||||||
'share/contrib', 'doc',
|
if ($insttype eq "client")
|
||||||
'doc/extension', 'doc/contrib',
|
{
|
||||||
'symbols', 'share/tsearch_data');
|
EnsureDirectories($target, @client_dirs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EnsureDirectories($target, @all_dirs);
|
||||||
|
}
|
||||||
|
|
||||||
CopySolutionOutput($conf, $target);
|
CopySolutionOutput($conf, $target);
|
||||||
lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
|
lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
|
||||||
my $sample_files = [];
|
my $sample_files = [];
|
||||||
|
my @top_dir = ("src");
|
||||||
|
@top_dir = ("src\\bin", "src\\interfaces") if ($insttype eq "client");
|
||||||
File::Find::find(
|
File::Find::find(
|
||||||
{ wanted => sub {
|
{ wanted => sub {
|
||||||
/^.*\.sample\z/s
|
/^.*\.sample\z/s
|
||||||
&& push(@$sample_files, $File::Find::name);
|
&& push(@$sample_files, $File::Find::name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src");
|
@top_dir);
|
||||||
CopySetOfFiles('config files', $sample_files, $target . '/share/');
|
CopySetOfFiles('config files', $sample_files, $target . '/share/');
|
||||||
CopyFiles(
|
CopyFiles(
|
||||||
'Import libraries',
|
'Import libraries',
|
||||||
|
@ -95,6 +114,11 @@ sub Install
|
||||||
"libpgport\\libpgport.lib",
|
"libpgport\\libpgport.lib",
|
||||||
"libpgtypes\\libpgtypes.lib",
|
"libpgtypes\\libpgtypes.lib",
|
||||||
"libecpg_compat\\libecpg_compat.lib");
|
"libecpg_compat\\libecpg_compat.lib");
|
||||||
|
CopyContribFiles($config, $target);
|
||||||
|
CopyIncludeFiles($target);
|
||||||
|
|
||||||
|
if ($insttype ne "client")
|
||||||
|
{
|
||||||
CopySetOfFiles(
|
CopySetOfFiles(
|
||||||
'timezone names',
|
'timezone names',
|
||||||
[ glob('src\timezone\tznames\*.txt') ],
|
[ glob('src\timezone\tznames\*.txt') ],
|
||||||
|
@ -125,8 +149,6 @@ sub Install
|
||||||
'Dictionaries sample files',
|
'Dictionaries sample files',
|
||||||
[ glob("src\\backend\\tsearch\\*_sample.*") ],
|
[ glob("src\\backend\\tsearch\\*_sample.*") ],
|
||||||
$target . '/share/tsearch_data/');
|
$target . '/share/tsearch_data/');
|
||||||
CopyContribFiles($config, $target);
|
|
||||||
CopyIncludeFiles($target);
|
|
||||||
|
|
||||||
my $pl_extension_files = [];
|
my $pl_extension_files = [];
|
||||||
my @pldirs = ('src/pl/plpgsql/src');
|
my @pldirs = ('src/pl/plpgsql/src');
|
||||||
|
@ -142,6 +164,7 @@ sub Install
|
||||||
@pldirs);
|
@pldirs);
|
||||||
CopySetOfFiles('PL Extension files',
|
CopySetOfFiles('PL Extension files',
|
||||||
$pl_extension_files, $target . '/share/extension/');
|
$pl_extension_files, $target . '/share/extension/');
|
||||||
|
}
|
||||||
|
|
||||||
GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls});
|
GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls});
|
||||||
|
|
||||||
|
@ -218,6 +241,10 @@ sub CopySolutionOutput
|
||||||
|
|
||||||
$sln =~ s/$rem//;
|
$sln =~ s/$rem//;
|
||||||
|
|
||||||
|
next
|
||||||
|
if ($insttype eq "client" && !grep { $_ eq $pf }
|
||||||
|
@client_program_files);
|
||||||
|
|
||||||
my $proj = read_file("$pf.$vcproj")
|
my $proj = read_file("$pf.$vcproj")
|
||||||
|| croak "Could not open $pf.$vcproj\n";
|
|| croak "Could not open $pf.$vcproj\n";
|
||||||
if ($vcproj eq 'vcproj' && $proj =~ qr{ConfigurationType="([^"]+)"})
|
if ($vcproj eq 'vcproj' && $proj =~ qr{ConfigurationType="([^"]+)"})
|
||||||
|
@ -378,6 +405,9 @@ sub CopyContribFiles
|
||||||
{
|
{
|
||||||
next if ($d =~ /^\./);
|
next if ($d =~ /^\./);
|
||||||
next unless (-f "contrib/$d/Makefile");
|
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 "uuid-ossp" && !defined($config->{uuid}));
|
||||||
next if ($d eq "sslinfo" && !defined($config->{openssl}));
|
next if ($d eq "sslinfo" && !defined($config->{openssl}));
|
||||||
next if ($d eq "xml2" && !defined($config->{xml}));
|
next if ($d eq "xml2" && !defined($config->{xml}));
|
||||||
|
|
|
@ -20,7 +20,7 @@ CALL bldenv.bat
|
||||||
del bldenv.bat
|
del bldenv.bat
|
||||||
:nobuildenv
|
:nobuildenv
|
||||||
|
|
||||||
perl install.pl "%1"
|
perl install.pl "%1" %2
|
||||||
|
|
||||||
REM exit fix for pre-2003 shell especially if used on buildfarm
|
REM exit fix for pre-2003 shell especially if used on buildfarm
|
||||||
if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
|
if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
|
||||||
|
|
|
@ -9,10 +9,12 @@ use warnings;
|
||||||
use Install qw(Install);
|
use Install qw(Install);
|
||||||
|
|
||||||
my $target = shift || Usage();
|
my $target = shift || Usage();
|
||||||
Install($target);
|
my $insttype = shift;
|
||||||
|
Install($target, $insttype);
|
||||||
|
|
||||||
sub Usage
|
sub Usage
|
||||||
{
|
{
|
||||||
print "Usage: install.pl <targetdir>\n";
|
print "Usage: install.pl <targetdir> [installtype]\n";
|
||||||
|
print "installtype: client\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ sub upgradecheck
|
||||||
(mkdir $tmp_root || die $!) unless -d $tmp_root;
|
(mkdir $tmp_root || die $!) unless -d $tmp_root;
|
||||||
my $tmp_install = "$tmp_root/install";
|
my $tmp_install = "$tmp_root/install";
|
||||||
print "Setting up temp install\n\n";
|
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
|
# Install does a chdir, so change back after that
|
||||||
chdir $cwd;
|
chdir $cwd;
|
||||||
|
|
Loading…
Reference in New Issue