Subversion Repositories DevTools

Rev

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

Rev 3923 Rev 4188
Line 18... Line 18...
18
#                 a script (DebianPackager.pl) to actually do the hard work.
18
#                 a script (DebianPackager.pl) to actually do the hard work.
19
#
19
#
20
# Syntax        : MakeDebianPackage (<platforms>, Options+);
20
# Syntax        : MakeDebianPackage (<platforms>, Options+);
21
#                 Where Options may be one of:
21
#                 Where Options may be one of:
22
#                   --Script=DebianPackagerScript       - Mandatory. Name of a the debian script
22
#                   --Script=DebianPackagerScript       - Mandatory. Name of a the debian script
-
 
23
#                   --Name=Name                         - Debian Package name(optional)
-
 
24
#                   --Variant=Text                      - Package Variant(optional)
-
 
25
#                   --DeployMode                        - Create Deployable packages(optional)
-
 
26
#                                                         These are:
-
 
27
#                                                           * Packaged into the root of target pkg
-
 
28
#                                                           * Have P or D in the name
23
#
29
#
24
#......................................................................#
30
#......................................................................#
25
 
31
 
26
require 5.006_001;
32
require 5.006_001;
27
#use strict;
33
#use strict;
Line 30... Line 36...
30
#-------------------------------------------------------------------------------
36
#-------------------------------------------------------------------------------
31
# Function        : MakeDebianPackage
37
# Function        : MakeDebianPackage
32
#
38
#
33
# Description     : Create a Debian Package
39
# Description     : Create a Debian Package
34
#
40
#
35
# Inputs          : PkgName                 - Symbolic Package Name
41
# Inputs          : See above
36
#                   --Script=Name           - Script to use in the packaging process
-
 
37
#                   --Name=Name             - Debian Package name(optional)
-
 
38
#                   --Variant=Text          - Package Variant(optional)
-
 
39
#
42
#
40
# Returns         : 
43
# Returns         : Nothing 
41
#
44
#
42
sub MakeDebianPackage
45
sub MakeDebianPackage
43
{
46
{
44
    my( $platforms, @elements ) = @_;
47
    my( $platforms, @elements ) = @_;
45
    Debug2( "MakeDebianPackage($platforms, @elements)" );
48
    Debug2( "MakeDebianPackage($platforms, @elements)" );
Line 50... Line 53...
50
    my $build_variant = '';
53
    my $build_variant = '';
51
 
54
 
52
    my $script_set=0;
55
    my $script_set=0;
53
    my $name_set=0;
56
    my $name_set=0;
54
    my $variant_set=0;
57
    my $variant_set=0;
-
 
58
    my $deploy_mode = 0;
55
 
59
 
56
    #
60
    #
57
    #   Take the project name and convert it into a full path
61
    #   Take the project name and convert it into a full path
58
    #
62
    #
59
    my $script;
63
    my $script;
Line 73... Line 77...
73
            $name_set++;
77
            $name_set++;
74
 
78
 
75
        } elsif ( m/^--Variant=(.+)/ ) {
79
        } elsif ( m/^--Variant=(.+)/ ) {
76
            $build_variant = $1;
80
            $build_variant = $1;
77
            $variant_set++;
81
            $variant_set++;
-
 
82
 
-
 
83
        } elsif ( m/^--DeployMode/ ) {
-
 
84
            $deploy_mode = 1;
78
            
85
            
79
        } elsif ( m/^--/ ) {
86
        } elsif ( m/^--/ ) {
80
            Error("MakeDebianPackage. Unknown option: $_");
87
            Error("MakeDebianPackage. Unknown option: $_");
81
 
88
 
82
        } else {
89
        } else {
Line 151... Line 158...
151
    #
158
    #
152
    #   Create the name of the target package
159
    #   Create the name of the target package
153
    #   The form of the name is of a fixed form.
160
    #   The form of the name is of a fixed form.
154
    #
161
    #
155
    #   Note: "_" used since this is the format of dpkg-name
162
    #   Note: "_" used since this is the format of dpkg-name
156
    #   Note: dpkg-name generates: Name _ Version _ Architecture
163
    #   Note: dpkg-name generates: Name _ Version _ Architecture [ _ Type ]
157
    #
164
    #
158
    #
165
    #
-
 
166
    my $PkgType = $deploy_mode ? ( '_' . '$(GBE_TYPE)' ) : '' ;
159
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${::ScmPlatform}.deb";
167
    my $DebianPkgName = "${build_name}_${::ScmBuildVersionFull}_${::ScmPlatform}${PkgType}.deb";
160
 
-
 
161
    #
168
    #
162
    #   Simply use Generate Files
169
    #   Simply use Generate Files
163
    #   With lots of options
170
    #   With lots of options
164
    #
171
    #
165
    Src ( '*', $script );
172
    Src ( '*', $script );
Line 197... Line 204...
197
                        '--Var(LocalBinDir)',
204
                        '--Var(LocalBinDir)',
198
                        '--Var(PkgArch)',
205
                        '--Var(PkgArch)',
199
 
206
 
200
                        "-Name=$build_name",                      # Base Package Name
207
                        "-Name=$build_name",                      # Base Package Name
201
                        "-Variant=$build_variant",                # Variant Name
208
                        "-Variant=$build_variant",                # Variant Name
202
                        "-Output=--GeneratedProg($DebianPkgName)",# Specify output file
209
                        "-Output=--GeneratedProg{$DebianPkgName}",# Specify output file
203
                        );
210
                        );
204
 
211
 
205
    #
212
    #
206
    #   The Packager has created a binary in the 'PROG' directory
213
    #   The Packager has created a binary in the 'PROG' directory
207
    #   Lets package it as a program.
214
    #   Lets package it as a program.
208
    #
215
    #
-
 
216
    if ($deploy_mode)
-
 
217
    {
-
 
218
        PackageFile ('*', $DebianPkgName );
-
 
219
    }
-
 
220
    else
-
 
221
    {
209
    PackageProg ('*', $DebianPkgName );
222
        PackageProg ('*', $DebianPkgName );
-
 
223
    }
210
}
224
}
211
 
225
 
212
1;
226
1;