Subversion Repositories DevTools

Rev

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

Rev 6742 Rev 6937
Line 23... Line 23...
23
#                   --Name=Name                         - Redhat Package name(optional)
23
#                   --Name=Name                         - Redhat Package name(optional)
24
#                   --Variant=Text                      - Package Variant(optional)
24
#                   --Variant=Text                      - Package Variant(optional)
25
#                   --DeployMode                        - Ignored
25
#                   --DeployMode                        - Ignored
26
#                   --NoDeployMode                      - Ignored
26
#                   --NoDeployMode                      - Ignored
27
#                                                         Default for embedded devices
27
#                                                         Default for embedded devices
-
 
28
#                   --NoArch                            - Marks the package as having no specific architecture
-
 
29
#                                                         
28
#                   --TarFile[=TemplateName]            - Create named .tgz file, of the data area [not Debian scripts]
30
#                   --TarFile[=TemplateName]            - Create named .tgz file, of the data area [not Debian scripts]
29
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
31
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
30
#                   --TarOnly                           - Suppress the Debian Build
32
#                   --TarOnly                           - Suppress the Debian Build
-
 
33
#                   
-
 
34
#                   --ZipFile[=TemplateName]            - Create named .zip file, of the data area [not Debian scripts]
-
 
35
#                   --ZipFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
31
#                   --NoArch                            - Marks the package as having no specific architecture
36
#                   --ZipOnly                           - Suppress the Debian Build
32
#
37
#
33
#               Templates may contain:
38
#               Templates may contain:
34
#                   PACKAGE
39
#                   PACKAGE
35
#                   VARIANT
40
#                   VARIANT
36
#                   VERSION
41
#                   VERSION
Line 68... Line 73...
68
    my $name_set=0;
73
    my $name_set=0;
69
    my $variant_set=0;
74
    my $variant_set=0;
70
 
75
 
71
    my $tarOnly;
76
    my $tarOnly;
72
    my $tarFileName = '';
77
    my $tarFileName = '';
-
 
78
 
-
 
79
    my $zipOnly;
-
 
80
    my $zipFileName = '';
-
 
81
 
73
    my @outputFiles;
82
    my @outputFiles;
74
    my @optArgs;
83
    my @optArgs;
75
    my $noArch;
84
    my $noArch;
76
 
85
 
77
    my $script;
86
    my $script;
Line 105... Line 114...
105
        } elsif ( m/^--TarOnly$/i ) {
114
        } elsif ( m/^--TarOnly$/i ) {
106
            $tarOnly = 1;
115
            $tarOnly = 1;
107
 
116
 
108
        } elsif ( m/^--TarFile(=(.*))?/i ) {
117
        } elsif ( m/^--TarFile(=(.*))?/i ) {
109
            $tarFileName = defined($1) ? $2 : 'DEFAULT';
118
            $tarFileName = defined($1) ? $2 : 'DEFAULT';
-
 
119
 
-
 
120
        } elsif ( m/^--ZipOnly$/i ) {
-
 
121
            $zipOnly = 1;
-
 
122
 
-
 
123
        } elsif ( m/^--ZipFile(=(.*))?/i ) {
-
 
124
            $zipFileName = defined($1) ? $2 : 'DEFAULT';
110
            
125
            
111
        } elsif ( m/^--/ ) {
126
        } elsif ( m/^--/ ) {
112
            ReportError("MakeRpmPackage. Unknown option: $_");
127
            ReportError("MakeRpmPackage. Unknown option: $_");
113
 
128
 
114
        } else {
129
        } else {
Line 128... Line 143...
128
    #
143
    #
129
    #   If the platform cannot generate a native installer then (silently) ignore the request
144
    #   If the platform cannot generate a native installer then (silently) ignore the request
130
    #   unless the user has specified a --TarOnly
145
    #   unless the user has specified a --TarOnly
131
    #
146
    #
132
    my $canGenerateInstaller = ActivePlatform('PKG_RPM');
147
    my $canGenerateInstaller = ActivePlatform('PKG_RPM');
133
    if ( !$canGenerateInstaller && !$tarOnly) {
148
    if ( !$canGenerateInstaller && !$tarOnly && !$zipOnly) {
134
        Verbose ("MakeRpmPackage: Installer not builadble for this platform");
149
        Verbose ("MakeRpmPackage: Installer not builadble for this platform");
135
        return;
150
        return;
136
    }
151
    }
137
 
152
 
138
    #   Sanity check the package name and version
153
    #   Sanity check the package name and version
Line 200... Line 215...
200
        $PkgType = '';
215
        $PkgType = '';
201
        push @optArgs, "-NoArch";
216
        push @optArgs, "-NoArch";
202
    }
217
    }
203
    my $PkgName = "${build_name}-${::ScmBuildVersionFull}-${PkgRelease}.${PkgArch}.rpm";
218
    my $PkgName = "${build_name}-${::ScmBuildVersionFull}-${PkgRelease}.${PkgArch}.rpm";
204
    push @optArgs, "-PkgArch=$PkgArch";
219
    push @optArgs, "-PkgArch=$PkgArch";
205
    unless ($tarOnly) {
220
    unless ($tarOnly || $zipOnly) {
206
        push (@outputFiles, $PkgName);
221
        push (@outputFiles, $PkgName);
207
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
222
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
208
    }
223
    }
209
 
224
 
210
    #
225
    #
Line 239... Line 254...
239
#        push @optArgs, "-TarFile=$tarFileName";
254
#        push @optArgs, "-TarFile=$tarFileName";
240
        push (@optArgs, '-TarOnly' ) if $tarOnly;
255
        push (@optArgs, '-TarOnly' ) if $tarOnly;
241
    }
256
    }
242
 
257
 
243
    #
258
    #
-
 
259
    #   Create name for the optional ZIP file
-
 
260
    #       Allow user to specify parts of the name symbolically
-
 
261
    #
-
 
262
    if ($zipFileName) {
-
 
263
        if ($zipFileName eq 'DEFAULT') {
-
 
264
            $zipFileName = 'PACKAGE_VERSION_RELEASE.PLATFORM';
-
 
265
            if ($deploy_mode && ! $noArch) {
-
 
266
                $zipFileName .= '_TYPE';
-
 
267
            }
-
 
268
        }
-
 
269
 
-
 
270
        if ($noArch) {
-
 
271
            $PkgArch = 'all';
-
 
272
        }
-
 
273
 
-
 
274
        $zipFileName =~ s~PACKAGE~${build_name}~g;
-
 
275
        $zipFileName =~ s~VERSION~${::ScmBuildVersionFull}~g;
-
 
276
        $zipFileName =~ s~PLATFORM~${::ScmPlatform}~g;
-
 
277
        $zipFileName =~ s~ARCH~${PkgArch}~g;
-
 
278
        $zipFileName =~ s~TYPE~\$(GBE_TYPE)~;
-
 
279
        $zipFileName =~ s~RELEASE~${PkgRelease}~g;
-
 
280
        $zipFileName .= '.zip' unless $zipFileName =~ m~\.zip$~;
-
 
281
        push @outputFiles,  $zipFileName;
-
 
282
 
-
 
283
        push @optArgs, "-ZipFile=--GeneratedProg{$zipFileName}";
-
 
284
#        push @optArgs, "-TarFile=$zipFileName";
-
 
285
        push (@optArgs, '-ZipOnly' ) if $zipOnly;
-
 
286
    }
-
 
287
 
-
 
288
    #
244
    #   Simply use Generate Files
289
    #   Simply use Generate Files
245
    #       With lots of options
290
    #       With lots of options
246
    #
291
    #
247
    Src ( '*', $script );
292
    Src ( '*', $script );
248
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool
293
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool