Subversion Repositories DevTools

Rev

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

Rev 4907 Rev 5215
Line 26... Line 26...
26
#                                                         Default for native targets
26
#                                                         Default for native targets
27
#                                                         These are:
27
#                                                         These are:
28
#                                                           * Packaged into the root of target pkg
28
#                                                           * Packaged into the root of target pkg
29
#                                                           * Have P or D in the name
29
#                                                           * Have P or D in the name
30
#                   --NoDeployMode                      - Create packages that cannto be directly deployed
30
#                   --NoDeployMode                      - Create packages that cannto be directly deployed
31
#                                                         Default for embeded devices
31
#                                                         Default for embedded devices
32
#                   --TarFile=name                      - Create named .tgz file, of the data area, not scripts
32
#                   --TarFile=name                      - Create named .tgz file, of the data area, not scripts
33
#                                                         Name can contain PACKAGE, VERSION and TYPE
33
#                                                         Name can contain PACKAGE, VERSION and TYPE
34
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
34
#                   --TarFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
-
 
35
#                   --NoArch                            - Marks the package as having no specific architecture
35
#                       
36
#                       
36
#
37
#
37
#......................................................................#
38
#......................................................................#
38
 
39
 
39
require 5.006_001;
40
require 5.006_001;
Line 65... Line 66...
65
    my $deploy_mode = GetGlobalOption('DEBIAN_PACKAGE_DEPLOYABLE', 0);
66
    my $deploy_mode = GetGlobalOption('DEBIAN_PACKAGE_DEPLOYABLE', 0);
66
 
67
 
67
    my $tarFileName = '';
68
    my $tarFileName = '';
68
    my @outputFiles;
69
    my @outputFiles;
69
    my @optArgs;
70
    my @optArgs;
-
 
71
    my $noArch;
70
 
72
 
71
    #
73
    #
72
    #   Take the project name and convert it into a full path
74
    #   Take the project name and convert it into a full path
73
    #
75
    #
74
    my $script;
76
    my $script;
Line 95... Line 97...
95
            $deploy_mode = 1;
97
            $deploy_mode = 1;
96
 
98
 
97
        } elsif ( m/^--NoDeployMode/ ) {
99
        } elsif ( m/^--NoDeployMode/ ) {
98
            $deploy_mode = 0;
100
            $deploy_mode = 0;
99
 
101
 
-
 
102
        } elsif ( m/^--NoArch$/ ) {
-
 
103
            $noArch = 1;
-
 
104
 
100
        } elsif ( m/^--TarFile$/ ) {
105
        } elsif ( m/^--TarFile$/ ) {
101
            $tarFileName = 'DEFAULT';
106
            $tarFileName = 'DEFAULT';
102
            
107
            
103
        } elsif ( m/^--TarFile=(.*)/ ) {
108
        } elsif ( m/^--TarFile=(.*)/ ) {
104
            $tarFileName = $1;
109
            $tarFileName = $1;
Line 169... Line 174...
169
 
174
 
170
    unless ( $::ScmBuildVersionFull =~ m/^[0-9][-+:.A-Za-z0-9]+$/ )
175
    unless ( $::ScmBuildVersionFull =~ m/^[0-9][-+:.A-Za-z0-9]+$/ )
171
    {
176
    {
172
        Error ("Package Version does not conform to Debian Requirements",
177
        Error ("Package Version does not conform to Debian Requirements",
173
               "Must only contain: (a-zA-Z) (0-9), - and .",
178
               "Must only contain: (a-zA-Z) (0-9), - and .",
174
               "Must sart with a number",
179
               "Must start with a number",
175
               );
180
               );
176
    }
181
    }
177
 
182
 
178
    #
183
    #
179
    #   Create the name of the target package
184
    #   Create the name of the target package
Line 182... Line 187...
182
    #   Note: "_" used since this is the format of dpkg-name
187
    #   Note: "_" used since this is the format of dpkg-name
183
    #   Note: dpkg-name generates: Name _ Version _ Architecture [ _ Type ]
188
    #   Note: dpkg-name generates: Name _ Version _ Architecture [ _ Type ]
184
    #
189
    #
185
    #
190
    #
186
    my $PkgType = $deploy_mode ? ( '_' . '$(GBE_TYPE)' ) : '' ;
191
    my $PkgType = $deploy_mode ? ( '_' . '$(GBE_TYPE)' ) : '' ;
-
 
192
    my $PkgArch = $::ScmPlatform;
-
 
193
    if ($noArch)
-
 
194
    {
-
 
195
        $PkgArch = 'all';
-
 
196
        $PkgType = '';
-
 
197
        push @optArgs, "-NoArch";
-
 
198
    }
187
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${::ScmPlatform}${PkgType}.deb";
199
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${PkgArch}${PkgType}.deb";
188
    push @outputFiles,  $DebianPkgName;
200
    push @outputFiles,  $DebianPkgName;
189
 
201
 
190
    #
202
    #
191
    #   Create name for the optional TGZ file
203
    #   Create name for the optional TGZ file
192
    #   Allow use to specify parts of the name symbolically
204
    #   Allow use to specify parts of the name symbolically
Line 194... Line 206...
194
    if ($tarFileName)
206
    if ($tarFileName)
195
    {
207
    {
196
        if ($tarFileName eq 'DEFAULT')
208
        if ($tarFileName eq 'DEFAULT')
197
        {
209
        {
198
            $tarFileName = 'PACKAGE_VERSION_PLATFORM';
210
            $tarFileName = 'PACKAGE_VERSION_PLATFORM';
199
            if ($deploy_mode)
211
            if ($deploy_mode && ! $noArch)
200
            {
212
            {
201
                $tarFileName .= '_TYPE';
213
                $tarFileName .= '_TYPE';
202
            }
214
            }
203
        }
215
        }
204
 
216
 
205
        $tarFileName =~ s~PACKAGE~${build_name}~g;
217
        $tarFileName =~ s~PACKAGE~${build_name}~g;
206
        $tarFileName =~ s~VERSION~${::ScmBuildVersionFull}~g;
218
        $tarFileName =~ s~VERSION~${::ScmBuildVersionFull}~g;
207
        $tarFileName =~ s~PLATFORM~${::ScmPlatform}~g;
219
        $tarFileName =~ s~PLATFORM~${PkgArch}~g;
208
        $tarFileName =~ s~TYPE~\$(GBE_TYPE)~;
220
        $tarFileName =~ s~TYPE~\$(GBE_TYPE)~;
209
        $tarFileName .= '.tgz';
221
        $tarFileName .= '.tgz';
210
        push @outputFiles,  $tarFileName;
222
        push @outputFiles,  $tarFileName;
211
        push @optArgs, "-TarFile=--GeneratedProg{$tarFileName}";
223
        push @optArgs, "-TarFile=--GeneratedProg{$tarFileName}";
212
    }
224
    }