@@ -17,6 +17,16 @@ our (@ISA, @EXPORT_OK);
17
17
@ISA =qw( Exporter) ;
18
18
@EXPORT_OK =qw( Install) ;
19
19
20
+ my $insttype ;
21
+ my @client_contribs = (' oid2name' ,' pgbench' ,' vacuumlo' );
22
+ my @client_program_files = (
23
+ ' clusterdb' ,' createdb' ,' createlang' ,' createuser' ,
24
+ ' dropdb' ,' droplang' ,' dropuser' ,' ecpg' ,
25
+ ' libecpg' ,' libecpg_compat' ,' libpgtypes' ,' libpq' ,
26
+ ' pg_basebackup' ,' pg_config' ,' pg_dump' ,' pg_dumpall' ,
27
+ ' pg_isready' ,' pg_receivexlog' ,' pg_restore' ,' psql' ,
28
+ ' reindexdb' ,' vacuumdb' ,@client_contribs );
29
+
20
30
sub lcopy
21
31
{
22
32
my $src =shift ;
@@ -37,6 +47,8 @@ sub Install
37
47
$| = 1;
38
48
39
49
my $target =shift ;
50
+ $insttype =shift ;
51
+ $insttype =" all" unless ($insttype );
40
52
41
53
# if called from vcregress, the config will be passed to us
42
54
# so no need to re-include these
@@ -65,24 +77,31 @@ sub Install
65
77
my $majorver = DetermineMajorVersion();
66
78
print " Installing version$majorver for$conf in$target \n " ;
67
79
68
- EnsureDirectories(
69
- $target ,' bin' ,
70
- ' lib' ,' share' ,
71
- ' share/timezonesets' ,' share/extension' ,
72
- ' share/contrib' ,' doc' ,
73
- ' doc/extension' ,' doc/contrib' ,
74
- ' symbols' ,' share/tsearch_data' );
80
+ my @client_dirs = (' bin' ,' lib' ,' share' ,' symbols' );
81
+ my @all_dirs = (
82
+ @client_dirs ,' doc' ,' doc/contrib' ,' doc/extension' ,' share/contrib' ,
83
+ ' share/extension' ,' share/timezonesets' ,' share/tsearch_data' );
84
+ if ($insttype eq " client" )
85
+ {
86
+ EnsureDirectories($target ,@client_dirs );
87
+ }
88
+ else
89
+ {
90
+ EnsureDirectories($target ,@all_dirs );
91
+ }
75
92
76
93
CopySolutionOutput($conf ,$target );
77
94
lcopy($target .' /lib/libpq.dll' ,$target .' /bin/libpq.dll' );
78
95
my $sample_files = [];
96
+ my @top_dir = (" src" );
97
+ @top_dir = (" src\\ bin" ," src\\ interfaces" )if ($insttype eq " client" );
79
98
File::Find::find(
80
99
{wanted => sub {
81
100
/ ^.*\. sample\z /s
82
101
&&push (@$sample_files ,$File::Find::name );
83
102
}
84
103
},
85
- " src " );
104
+ @top_dir );
86
105
CopySetOfFiles(' config files' ,$sample_files ,$target .' /share/' );
87
106
CopyFiles(
88
107
' Import libraries' ,
@@ -95,53 +114,57 @@ sub Install
95
114
" libpgport\\ libpgport.lib" ,
96
115
" libpgtypes\\ libpgtypes.lib" ,
97
116
" libecpg_compat\\ libecpg_compat.lib" );
98
- CopySetOfFiles(
99
- ' timezone names' ,
100
- [glob (' src\timezone\tznames\*.txt' ) ],
101
- $target .' /share/timezonesets/' );
102
- CopyFiles(
103
- ' timezone sets' ,
104
- $target .' /share/timezonesets/' ,
105
- ' src/timezone/tznames/' ,' Default' ,' Australia' ,' India' );
106
- CopySetOfFiles(
107
- ' BKI files' ,
108
- [glob (" src\\ backend\\ catalog\\ postgres.*" ) ],
109
- $target .' /share/' );
110
- CopySetOfFiles(
111
- ' SQL files' ,
112
- [glob (" src\\ backend\\ catalog\\ *.sql" ) ],
113
- $target .' /share/' );
114
- CopyFiles(
115
- ' Information schema data' ,$target .' /share/' ,
116
- ' src/backend/catalog/' ,' sql_features.txt' );
117
- GenerateConversionScript($target );
118
- GenerateTimezoneFiles($target ,$conf );
119
- GenerateTsearchFiles($target );
120
- CopySetOfFiles(
121
- ' Stopword files' ,
122
- [glob (" src\\ backend\\ snowball\\ stopwords\\ *.stop" ) ],
123
- $target .' /share/tsearch_data/' );
124
- CopySetOfFiles(
125
- ' Dictionaries sample files' ,
126
- [glob (" src\\ backend\\ tsearch\\ *_sample.*" ) ],
127
- $target .' /share/tsearch_data/' );
128
117
CopyContribFiles($config ,$target );
129
118
CopyIncludeFiles($target );
130
119
131
- my $pl_extension_files = [];
132
- my @pldirs = (' src/pl/plpgsql/src' );
133
- push @pldirs ," src/pl/plperl" if $config -> {perl };
134
- push @pldirs ," src/pl/plpython" if $config -> {python };
135
- push @pldirs ," src/pl/tcl" if $config -> {tcl };
136
- File::Find::find(
137
- {wanted => sub {
138
- / ^(.*--.*\. sql|.*\. control)\z /s
139
- &&push (@$pl_extension_files ,$File::Find::name );
140
- }
141
- },
142
- @pldirs );
143
- CopySetOfFiles(' PL Extension files' ,
144
- $pl_extension_files ,$target .' /share/extension/' );
120
+ if ($insttype ne " client" )
121
+ {
122
+ CopySetOfFiles(
123
+ ' timezone names' ,
124
+ [glob (' src\timezone\tznames\*.txt' ) ],
125
+ $target .' /share/timezonesets/' );
126
+ CopyFiles(
127
+ ' timezone sets' ,
128
+ $target .' /share/timezonesets/' ,
129
+ ' src/timezone/tznames/' ,' Default' ,' Australia' ,' India' );
130
+ CopySetOfFiles(
131
+ ' BKI files' ,
132
+ [glob (" src\\ backend\\ catalog\\ postgres.*" ) ],
133
+ $target .' /share/' );
134
+ CopySetOfFiles(
135
+ ' SQL files' ,
136
+ [glob (" src\\ backend\\ catalog\\ *.sql" ) ],
137
+ $target .' /share/' );
138
+ CopyFiles(
139
+ ' Information schema data' ,$target .' /share/' ,
140
+ ' src/backend/catalog/' ,' sql_features.txt' );
141
+ GenerateConversionScript($target );
142
+ GenerateTimezoneFiles($target ,$conf );
143
+ GenerateTsearchFiles($target );
144
+ CopySetOfFiles(
145
+ ' Stopword files' ,
146
+ [glob (" src\\ backend\\ snowball\\ stopwords\\ *.stop" ) ],
147
+ $target .' /share/tsearch_data/' );
148
+ CopySetOfFiles(
149
+ ' Dictionaries sample files' ,
150
+ [glob (" src\\ backend\\ tsearch\\ *_sample.*" ) ],
151
+ $target .' /share/tsearch_data/' );
152
+
153
+ my $pl_extension_files = [];
154
+ my @pldirs = (' src/pl/plpgsql/src' );
155
+ push @pldirs ," src/pl/plperl" if $config -> {perl };
156
+ push @pldirs ," src/pl/plpython" if $config -> {python };
157
+ push @pldirs ," src/pl/tcl" if $config -> {tcl };
158
+ File::Find::find(
159
+ {wanted => sub {
160
+ / ^(.*--.*\. sql|.*\. control)\z /s
161
+ &&push (@$pl_extension_files ,$File::Find::name );
162
+ }
163
+ },
164
+ @pldirs );
165
+ CopySetOfFiles(' PL Extension files' ,
166
+ $pl_extension_files ,$target .' /share/extension/' );
167
+ }
145
168
146
169
GenerateNLSFiles($target ,$config -> {nls },$majorver )if ($config -> {nls });
147
170
@@ -218,6 +241,10 @@ sub CopySolutionOutput
218
241
219
242
$sln =~s / $rem// ;
220
243
244
+ next
245
+ if ($insttype eq " client" && !grep {$_ eq $pf }
246
+ @client_program_files );
247
+
221
248
my $proj = read_file(" $pf .$vcproj " )
222
249
|| croak" Could not open$pf .$vcproj \n " ;
223
250
if ($vcproj eq ' vcproj' &&$proj =~qr { ConfigurationType="([^"]+)"} )
@@ -378,6 +405,9 @@ sub CopyContribFiles
378
405
{
379
406
next if ($d =~/ ^\. / );
380
407
next unless (-f " contrib/$d /Makefile" );
408
+ next
409
+ if ($insttype eq " client" && !grep {$_ eq $d }@client_contribs );
410
+
381
411
next if ($d eq " uuid-ossp" && !defined ($config -> {uuid }));
382
412
next if ($d eq " sslinfo" && !defined ($config -> {openssl }));
383
413
next if ($d eq " xml2" && !defined ($config -> {xml }));