Subversion Repositories DevTools

Rev

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

Rev 6738 Rev 6937
Line 30... Line 30...
30
#                                                         These are:
30
#                                                         These are:
31
#                                                           * Packaged into the root of target pkg
31
#                                                           * Packaged into the root of target pkg
32
#                                                           * Have P or D in the name
32
#                                                           * Have P or D in the name
33
#                   --NoDeployMode                      - Create packages that cannot be directly deployed
33
#                   --NoDeployMode                      - Create packages that cannot be directly deployed
34
#                                                         Default for embedded devices
34
#                                                         Default for embedded devices
-
 
35
#                   --NoArch                            - Marks the package as having no specific architecture
-
 
36
#                                                         
35
#                   --TarFile[=TemplateName]            - Create named .tgz file, of the data area [not Debian scripts]
37
#                   --TarFile[=TemplateName]            - Create named .tgz file, of the data area [not Debian scripts]
36
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
38
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
37
#                   --TarOnly                           - Suppress the Debian Build
39
#                   --TarOnly                           - Suppress the Debian Build
-
 
40
#                   
-
 
41
#                   --ZipFile[=TemplateName]            - Create named .zip file, of the data area [not Debian scripts]
-
 
42
#                   --ZipFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
38
#                   --NoArch                            - Marks the package as having no specific architecture
43
#                   --ZipOnly                           - Suppress the Debian Build
39
#                   
44
#                   
40
#
45
#
41
#               Templates may contain:
46
#               Templates may contain:
42
#                   PACKAGE
47
#                   PACKAGE
43
#                   VARIANT
48
#                   VARIANT
Line 81... Line 86...
81
 
86
 
82
    my $deploy_mode = GetGlobalOption('DEBIAN_PACKAGE_DEPLOYABLE', 0);
87
    my $deploy_mode = GetGlobalOption('DEBIAN_PACKAGE_DEPLOYABLE', 0);
83
 
88
 
84
    my $tarOnly;
89
    my $tarOnly;
85
    my $tarFileName = '';
90
    my $tarFileName = '';
-
 
91
 
-
 
92
    my $zipOnly;
-
 
93
    my $zipFileName = '';
-
 
94
 
86
    my @outputFiles;
95
    my @outputFiles;
87
    my @optArgs;
96
    my @optArgs;
88
    my $noArch;
97
    my $noArch;
89
 
98
 
90
    my @arglist;
99
    my @arglist;
Line 142... Line 151...
142
        } elsif ( m/^--TarOnly$/i ) {
151
        } elsif ( m/^--TarOnly$/i ) {
143
            $tarOnly = 1;
152
            $tarOnly = 1;
144
 
153
 
145
        } elsif ( m/^--TarFile(=(.*))?/i ) {
154
        } elsif ( m/^--TarFile(=(.*))?/i ) {
146
            $tarFileName = defined($1) ? $2 : 'DEFAULT';
155
            $tarFileName = defined($1) ? $2 : 'DEFAULT';
-
 
156
 
-
 
157
        } elsif ( m/^--ZipOnly$/i ) {
-
 
158
            $zipOnly = 1;
-
 
159
 
-
 
160
        } elsif ( m/^--ZipFile(=(.*))?/i ) {
-
 
161
            $zipFileName = defined($1) ? $2 : 'DEFAULT';
147
            
162
            
148
        } elsif ( m/^--/ ) {
163
        } elsif ( m/^--/ ) {
149
            ReportError("MakeDebianPackage. Unknown option: $_");
164
            ReportError("MakeDebianPackage. Unknown option: $_");
150
 
165
 
151
        } else {
166
        } else {
Line 181... Line 196...
181
    #
196
    #
182
    #   If the platform cannot generate a native installer then (silently) ignore the request
197
    #   If the platform cannot generate a native installer then (silently) ignore the request
183
    #   unless the user has specified a --TarOnly
198
    #   unless the user has specified a --TarOnly
184
    #
199
    #
185
    my $canGenerateInstaller = ActivePlatform('PKG_DEB');
200
    my $canGenerateInstaller = ActivePlatform('PKG_DEB');
186
    if ( !$canGenerateInstaller && !$tarOnly) {
201
    if ( !$canGenerateInstaller && !$tarOnly && !zipOnly) {
187
        Verbose ("MakeDebianPackage: Installer not builadble for this platform");
202
        Verbose ("MakeDebianPackage: Installer not builadble for this platform");
188
        return;
203
        return;
189
    }
204
    }
190
 
205
 
191
    #
206
    #
Line 255... Line 270...
255
            push @optArgs, "-NoArch";
270
            push @optArgs, "-NoArch";
256
        }
271
        }
257
 
272
 
258
    my $PkgName = "${build_name}_${build_version}_${Platform}${PkgType}.deb";
273
    my $PkgName = "${build_name}_${build_version}_${Platform}${PkgType}.deb";
259
    push @optArgs, "-PkgArch=$PkgArch";
274
    push @optArgs, "-PkgArch=$PkgArch";
260
    unless ($tarOnly) {
275
    unless ($tarOnly || $zipOnly) {
261
        push (@outputFiles, $PkgName);
276
        push (@outputFiles, $PkgName);
262
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
277
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
263
    }
278
    }
264
 
279
 
265
    #
280
    #
Line 293... Line 308...
293
#        push @optArgs, "-TarFile=$tarFileName";
308
#        push @optArgs, "-TarFile=$tarFileName";
294
        push (@optArgs, '-TarOnly' ) if $tarOnly;
309
        push (@optArgs, '-TarOnly' ) if $tarOnly;
295
    }
310
    }
296
 
311
 
297
    #
312
    #
-
 
313
    #   Create name for the optional ZIP file
-
 
314
    #       Allow user to specify parts of the name symbolically
-
 
315
    #
-
 
316
    if ($zipFileName) {
-
 
317
        if ($zipFileName eq 'DEFAULT') {
-
 
318
            $zipFileName = 'PACKAGE_VERSION_PLATFORM';
-
 
319
            if ($deploy_mode && ! $noArch) {
-
 
320
                $zipFileName .= '_TYPE';
-
 
321
            }
-
 
322
        }
-
 
323
 
-
 
324
        if ($noArch) {
-
 
325
            $PkgArch = 'all';
-
 
326
        }
-
 
327
 
-
 
328
        $zipFileName =~ s~PACKAGE~${build_name}~g;
-
 
329
        $zipFileName =~ s~VERSION~${build_version}~g;
-
 
330
        $zipFileName =~ s~PLATFORM~${Platform}~g;
-
 
331
        $zipFileName =~ s~ARCH~${PkgArch}~g;
-
 
332
        $zipFileName =~ s~TYPE~\$(GBE_TYPE)~;
-
 
333
        $zipFileName .= '.zip' unless $zipFileName =~ m~\.zip$~;
-
 
334
        push @outputFiles,  $zipFileName;
-
 
335
 
-
 
336
        push @optArgs, "-ZipFile=--GeneratedProg{$zipFileName}";
-
 
337
#        push @optArgs, "-TarFile=$zipFileName";
-
 
338
        push (@optArgs, '-ZipOnly' ) if $zipOnly;
-
 
339
    }
-
 
340
 
-
 
341
    #
298
    #   Simply use Generate Files
342
    #   Simply use Generate Files
299
    #       With lots of options
343
    #       With lots of options
300
    #
344
    #
301
    Src ( '*', $script );
345
    Src ( '*', $script );
302
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool
346
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool