Subversion Repositories DevTools

Rev

Rev 4188 | Rev 4907 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4188 Rev 4740
Line 24... Line 24...
24
#                   --Variant=Text                      - Package Variant(optional)
24
#                   --Variant=Text                      - Package Variant(optional)
25
#                   --DeployMode                        - Create Deployable packages(optional)
25
#                   --DeployMode                        - Create Deployable packages(optional)
26
#                                                         These are:
26
#                                                         These are:
27
#                                                           * Packaged into the root of target pkg
27
#                                                           * Packaged into the root of target pkg
28
#                                                           * Have P or D in the name
28
#                                                           * Have P or D in the name
-
 
29
#                   --TarFile=name                      - Create named .tgz file, of the data area, not scripts
-
 
30
#                                                         Name can contain PACKAGE, VERSION and TYPE
-
 
31
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
-
 
32
#                       
29
#
33
#
30
#......................................................................#
34
#......................................................................#
31
 
35
 
32
require 5.006_001;
36
require 5.006_001;
33
#use strict;
37
#use strict;
Line 55... Line 59...
55
    my $script_set=0;
59
    my $script_set=0;
56
    my $name_set=0;
60
    my $name_set=0;
57
    my $variant_set=0;
61
    my $variant_set=0;
58
    my $deploy_mode = 0;
62
    my $deploy_mode = 0;
59
 
63
 
-
 
64
    my $tarFileName = '';
-
 
65
    my @outputFiles;
-
 
66
    my @optArgs;
-
 
67
 
60
    #
68
    #
61
    #   Take the project name and convert it into a full path
69
    #   Take the project name and convert it into a full path
62
    #
70
    #
63
    my $script;
71
    my $script;
64
 
72
 
Line 81... Line 89...
81
            $variant_set++;
89
            $variant_set++;
82
 
90
 
83
        } elsif ( m/^--DeployMode/ ) {
91
        } elsif ( m/^--DeployMode/ ) {
84
            $deploy_mode = 1;
92
            $deploy_mode = 1;
85
            
93
            
-
 
94
        } elsif ( m/^--TarFile$/ ) {
-
 
95
            $tarFileName = 'DEFAULT';
-
 
96
            
-
 
97
        } elsif ( m/^--TarFile=(.*)/ ) {
-
 
98
            $tarFileName = $1;
-
 
99
            
86
        } elsif ( m/^--/ ) {
100
        } elsif ( m/^--/ ) {
87
            Error("MakeDebianPackage. Unknown option: $_");
101
            Error("MakeDebianPackage. Unknown option: $_");
88
 
102
 
89
        } else {
103
        } else {
90
            Error("MakeDebianPackage. Unknown argument: $_");
104
            Error("MakeDebianPackage. Unknown argument: $_");
Line 163... Line 177...
163
    #   Note: dpkg-name generates: Name _ Version _ Architecture [ _ Type ]
177
    #   Note: dpkg-name generates: Name _ Version _ Architecture [ _ Type ]
164
    #
178
    #
165
    #
179
    #
166
    my $PkgType = $deploy_mode ? ( '_' . '$(GBE_TYPE)' ) : '' ;
180
    my $PkgType = $deploy_mode ? ( '_' . '$(GBE_TYPE)' ) : '' ;
167
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${::ScmPlatform}${PkgType}.deb";
181
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${::ScmPlatform}${PkgType}.deb";
-
 
182
    push @outputFiles,  $DebianPkgName;
-
 
183
 
-
 
184
    #
-
 
185
    #   Create name for the optional TGZ file
-
 
186
    #   Allow use to specify parts of the name symbolically
-
 
187
    #
-
 
188
    if ($tarFileName)
-
 
189
    {
-
 
190
        if ($tarFileName eq 'DEFAULT')
-
 
191
        {
-
 
192
            $tarFileName = 'PACKAGE_VERSION_PLATFORM';
-
 
193
            if ($deploy_mode)
-
 
194
            {
-
 
195
                $tarFileName .= '_TYPE';
-
 
196
            }
-
 
197
        }
-
 
198
 
-
 
199
        $tarFileName =~ s~PACKAGE~${build_name}~g;
-
 
200
        $tarFileName =~ s~VERSION~${::ScmBuildVersionFull}~g;
-
 
201
        $tarFileName =~ s~PLATFORM~${::ScmPlatform}~g;
-
 
202
        $tarFileName =~ s~TYPE~\$(GBE_TYPE)~;
-
 
203
        $tarFileName .= '.tgz';
-
 
204
        push @outputFiles,  $tarFileName;
-
 
205
        push @optArgs, "-TarFile=--GeneratedProg{$tarFileName}";
-
 
206
    }
-
 
207
 
168
    #
208
    #
169
    #   Simply use Generate Files
209
    #   Simply use Generate Files
170
    #   With lots of options
210
    #   With lots of options
171
    #
211
    #
172
    Src ( '*', $script );
212
    Src ( '*', $script );
Line 205... Line 245...
205
                        '--Var(PkgArch)',
245
                        '--Var(PkgArch)',
206
 
246
 
207
                        "-Name=$build_name",                      # Base Package Name
247
                        "-Name=$build_name",                      # Base Package Name
208
                        "-Variant=$build_variant",                # Variant Name
248
                        "-Variant=$build_variant",                # Variant Name
209
                        "-Output=--GeneratedProg{$DebianPkgName}",# Specify output file
249
                        "-Output=--GeneratedProg{$DebianPkgName}",# Specify output file
-
 
250
                        @optArgs,                                 # Optional args - tarfile
210
                        );
251
                        );
211
 
252
 
212
    #
253
    #
213
    #   The Packager has created a binary in the 'PROG' directory
254
    #   The Packager has created a binary in the 'PROG' directory
214
    #   Lets package it as a program.
255
    #   Lets package it as a program.
215
    #
256
    #
216
    if ($deploy_mode)
257
    if ($deploy_mode)
217
    {
258
    {
218
        PackageFile ('*', $DebianPkgName );
259
        PackageFile ('*', @outputFiles );
219
    }
260
    }
220
    else
261
    else
221
    {
262
    {
222
        PackageProg ('*', $DebianPkgName );
263
        PackageProg ('*', @outputFiles );
223
    }
264
    }
224
}
265
}
225
 
266
 
226
1;
267
1;