Subversion Repositories DevTools

Rev

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

Rev 4714 Rev 4740
Line 117... Line 117...
117
my $opt_pkgpkgdir;
117
my $opt_pkgpkgdir;
118
my $opt_output;
118
my $opt_output;
119
my $opt_name;
119
my $opt_name;
120
my $opt_variant;
120
my $opt_variant;
121
my $opt_pkgarch;
121
my $opt_pkgarch;
-
 
122
my $opt_tarFile;
122
 
123
 
123
#
124
#
124
#   Options derived from script directives
125
#   Options derived from script directives
125
#
126
#
126
my $opt_description;
127
my $opt_description;
Line 175... Line 176...
175
                "PackageDir=s"      => \$opt_pkgdir,
176
                "PackageDir=s"      => \$opt_pkgdir,
176
                "PackageLibDir=s"   => \$opt_pkglibdir,
177
                "PackageLibDir=s"   => \$opt_pkglibdir,
177
                "PackageBinDir=s"   => \$opt_pkgbindir,
178
                "PackageBinDir=s"   => \$opt_pkgbindir,
178
                "PackagePkgDir=s"   => \$opt_pkgpkgdir,
179
                "PackagePkgDir=s"   => \$opt_pkgpkgdir,
179
                "Output=s"          => \$opt_output,
180
                "Output=s"          => \$opt_output,
-
 
181
                "tarFile=s"         => \$opt_tarFile,
180
                "Variant:s"         => \$opt_variant,
182
                "Variant:s"         => \$opt_variant,
181
                "PkgArch:s"         => \$opt_pkgarch,
183
                "PkgArch:s"         => \$opt_pkgarch,
182
    );
184
    );
183
    $opt_verbose++ unless ( $opt_vargs eq '@' );
185
    $opt_verbose++ unless ( $opt_vargs eq '@' );
184
 
186
 
Line 220... Line 222...
220
    #   Configure the System command to fail on any error
222
    #   Configure the System command to fail on any error
221
    #
223
    #
222
    SystemConfig ( ExitOnError => 1 );
224
    SystemConfig ( ExitOnError => 1 );
223
 
225
 
224
    #
226
    #
225
    #   Extract the 'name' of the package from the output path
-
 
226
    #   Display purposes only
-
 
227
    #
-
 
228
    my $DebianPkgName = StripDirExt($opt_output);
-
 
229
 
-
 
230
    #
-
 
231
    #   Display variables used
227
    #   Display variables used
232
    #
228
    #
233
    Message    "=Building Debian Package =============================================";
229
    Message    ("=Building Debian Package =============================================");
234
    Message    "Build $opt_name";
230
    Message    ("Build $opt_name");
235
    Message    "       Package: $opt_buildname";
231
    Message    ("       Package: $opt_buildname");
236
    Message    "       Variant: $opt_variant" if ($opt_variant);
232
    Message    ("       Variant: $opt_variant") if ($opt_variant);
237
    Message    "       Version: $opt_buildversion";
233
    Message    ("       Version: $opt_buildversion");
238
    Message    "  Building for: $opt_platform, $opt_target";
234
    Message    ("  Building for: $opt_platform, $opt_target");
239
    Message    "       Product: $opt_product";
235
    Message    ("       Product: $opt_product");
240
    Message    "          Type: $opt_type";
236
    Message    ("          Type: $opt_type");
241
    Message    "      Pkg Arch: $opt_pkgarch" if ($opt_pkgarch);
237
    Message    ("      Pkg Arch: $opt_pkgarch") if ($opt_pkgarch);
242
    Verbose    "       Verbose: $opt_verbose";
238
    Verbose    ("       Verbose: $opt_verbose");
243
    Verbose    "  InterfaceDir: $opt_interfacedir";
239
    Verbose    ("  InterfaceDir: $opt_interfacedir");
244
    Message    "       Package: $DebianPkgName";
240
    Message    ("       Package: " . StripDirExt($opt_output));
-
 
241
    Message    ("       TarFile: " . StripDirExt($opt_tarFile)) if ($opt_tarFile);
245
    Message    "======================================================================";
242
    Message    ("======================================================================");
246
 
243
 
247
    #
244
    #
248
    #   Defaults
245
    #   Defaults
249
    #
246
    #
250
    $opt_pkgarch = $opt_platform unless ( $opt_pkgarch );
247
    $opt_pkgarch = $opt_platform unless ( $opt_pkgarch );
Line 290... Line 287...
290
        }
287
        }
291
 
288
 
292
    #
289
    #
293
    #   Complete the building of the package
290
    #   Complete the building of the package
294
    #
291
    #
-
 
292
    if ($opt_tarFile)
-
 
293
    {
-
 
294
        BuildTarFile();
-
 
295
        Message ("Created TGZ file");
-
 
296
    }
-
 
297
 
-
 
298
 
295
    BuildDebianPackage ();
299
    BuildDebianPackage ();
296
    Message ("Created Debian Package");
300
    Message ("Created Debian Package");
297
}
301
}
298
 
302
 
299
#-------------------------------------------------------------------------------
303
#-------------------------------------------------------------------------------
Line 353... Line 357...
353
    System ("build_dpkg.sh", '-I', $opt_output) if (IsVerbose(1));
357
    System ("build_dpkg.sh", '-I', $opt_output) if (IsVerbose(1));
354
 
358
 
355
}
359
}
356
 
360
 
357
#-------------------------------------------------------------------------------
361
#-------------------------------------------------------------------------------
-
 
362
# Function        : BuildTarFile 
-
 
363
#
-
 
364
# Description     : This function will create a TGZ file of the constructed package
-
 
365
#                   Not often used 
-
 
366
#
-
 
367
# Inputs          : None
-
 
368
#
-
 
369
# Returns         : Nothing
-
 
370
#
-
 
371
sub BuildTarFile
-
 
372
{
-
 
373
    Verbose ("Create TGZ file containing body of the package");
-
 
374
    System ('tar', 
-
 
375
            '--create',
-
 
376
            '--auto-compress',
-
 
377
            '--owner=0' ,
-
 
378
            '--group=0' ,
-
 
379
            '--one-file-system' ,
-
 
380
            '--exclude=./DEBIAN' ,
-
 
381
            '-C', $DebianWorkDir,  
-
 
382
            '--file', $opt_tarFile,
-
 
383
            '.'
-
 
384
            );
-
 
385
}
-
 
386
 
-
 
387
 
-
 
388
#-------------------------------------------------------------------------------
358
# Function        : UpdateControlFile
389
# Function        : UpdateControlFile
359
#
390
#
360
# Description     : Update the Debian 'control' file to fix up various fields
391
# Description     : Update the Debian 'control' file to fix up various fields
361
#                   within the file.
392
#                   within the file.
362
#
393
#
Line 924... Line 955...
924
    #
955
    #
925
    my %copyOpts;
956
    my %copyOpts;
926
    $copyOpts{'IgnoreDirs'} = ['.svn', '.git', '.cvs', '.hg'];
957
    $copyOpts{'IgnoreDirs'} = ['.svn', '.git', '.cvs', '.hg'];
927
    $copyOpts{'Ignore'} = ['.gbedir', '_gbedir'];
958
    $copyOpts{'Ignore'} = ['.gbedir', '_gbedir'];
928
    $copyOpts{'Log'} = 1 if ( $opt_verbose > 1 );
959
    $copyOpts{'Log'} = 1 if ( $opt_verbose > 1 );
-
 
960
    $copyOpts{'DeleteFirst'} = 1;
929
 
961
 
930
    $dst_dir = $DebianWorkDir . '/' . $dst_dir;
962
    $dst_dir = $DebianWorkDir . '/' . $dst_dir;
931
    $dst_dir =~ s~//~/~;
963
    $dst_dir =~ s~//~/~;
932
 
964
 
933
    #
965
    #
Line 935... Line 967...
935
    #
967
    #
936
    foreach  ( @opts )
968
    foreach  ( @opts )
937
    {
969
    {
938
        Verbose2 ("CopyDir: $_");
970
        Verbose2 ("CopyDir: $_");
939
        if ( m/^--Merge/ ) {
971
        if ( m/^--Merge/ ) {
940
            $copyOpts{'DeleteFirst'} = 1;
972
            $copyOpts{'DeleteFirst'} = 0;
941
 
973
 
942
        } elsif ( m/^--Source=(.+)/ ) {
974
        } elsif ( m/^--Source=(.+)/ ) {
943
            Error ("Source directory can only be specified once")
975
            Error ("Source directory can only be specified once")
944
                if ( defined $opt_source );
976
                if ( defined $opt_source );
945
            $opt_source = $1;
977
            $opt_source = $1;