@@ -17,6 +17,16 @@ our (@ISA, @EXPORT_OK);
1717@ISA = qw( Exporter) ;
1818@EXPORT_OK = qw( Install) ;
1919
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+
2030sub lcopy
2131{
2232 my $src = shift ;
@@ -37,6 +47,8 @@ sub Install
3747 $| = 1;
3848
3949 my $target = shift ;
50+ $insttype = shift ;
51+ $insttype = " all" unless ($insttype );
4052
4153 # if called from vcregress, the config will be passed to us
4254 # so no need to re-include these
@@ -65,24 +77,31 @@ sub Install
6577 my $majorver = DetermineMajorVersion();
6678 print " Installing version $majorver for $conf in $target \n " ;
6779
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+ }
7592
7693 CopySolutionOutput($conf , $target );
7794 lcopy($target . ' /lib/libpq.dll' , $target . ' /bin/libpq.dll' );
7895 my $sample_files = [];
96+ my @top_dir = (" src" );
97+ @top_dir = (" src\\ bin" , " src\\ interfaces" ) if ($insttype eq " client" );
7998 File::Find::find(
8099 { wanted => sub {
81100 / ^.*\. sample\z /s
82101 && push (@$sample_files , $File::Find::name );
83102 }
84103 },
85- " src " );
104+ @top_dir );
86105 CopySetOfFiles(' config files' , $sample_files , $target . ' /share/' );
87106 CopyFiles(
88107 ' Import libraries' ,
@@ -95,53 +114,57 @@ sub Install
95114 " libpgport\\ libpgport.lib" ,
96115 " libpgtypes\\ libpgtypes.lib" ,
97116 " 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/' );
128117 CopyContribFiles($config , $target );
129118 CopyIncludeFiles($target );
130119
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+ }
145168
146169 GenerateNLSFiles($target , $config -> {nls }, $majorver ) if ($config -> {nls });
147170
@@ -218,6 +241,10 @@ sub CopySolutionOutput
218241
219242 $sln =~ s / $rem// ;
220243
244+ next
245+ if ($insttype eq " client" && !grep { $_ eq $pf }
246+ @client_program_files );
247+
221248 my $proj = read_file(" $pf .$vcproj " )
222249 || croak " Could not open $pf .$vcproj \n " ;
223250 if ($vcproj eq ' vcproj' && $proj =~ qr { ConfigurationType="([^"]+)"} )
@@ -378,6 +405,9 @@ sub CopyContribFiles
378405 {
379406 next if ($d =~ / ^\. / );
380407 next unless (-f " contrib/$d /Makefile" );
408+ next
409+ if ($insttype eq " client" && !grep { $_ eq $d } @client_contribs );
410+
381411 next if ($d eq " uuid-ossp" && !defined ($config -> {uuid }));
382412 next if ($d eq " sslinfo" && !defined ($config -> {openssl }));
383413 next if ($d eq " xml2" && !defined ($config -> {xml }));
0 commit comments