Changeset 664 for trunk


Ignore:
Timestamp:
Sep 1, 2003, 3:34:07 PM (21 years ago)
Author:
joergs
Message:

extend buildall.pl to generate install sources.

Location:
trunk/technical/common/build
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/technical/common/build/buildall.pl

    r660 r664  
    22# automatisches buildskript fuer smartclient
    33# liest die konfiguration aus der mit -b übergebenen Datei
    4 # $Id: buildall.pl,v 1.18 2003/08/18 13:34:39 joergs Exp $
     4# $Id: buildall.pl,v 1.19 2003/09/01 13:34:07 joergs Exp $
    55# Philipp Storz, SuSE Linux AG
    66# pstorz@suse.de
     
    1616
    1717format TABELLE =
    18 @<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     18@<<<<<<<<<<<<<<<<<< @<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    1919$wert1, $wert2, $wert3
    2020.
     
    2222
    2323# Programmoptionen:
    24 #       -b (buildlist)
    25 #       -x (buildlog im seperaten xtern
     24#       -b      (buildlist)
     25#       -x      (buildlog im seperaten xtern
     26#       -d      Zielpfad um Install Source zu erzeugen
    2627
    2728my $workdir=`pwd`;
     
    3435#$workdir="";
    3536
    36 my $DEST_DIR="/tmp/smartclient_build/";
    37 
     37my $BUILD_DEST_DIR="/tmp/smartclient_build/";
     38my $INSTALL_SRC_SKEL_DIR="/net/dist/data/dist/sles/8/skeleton-i386/smartclient/";
    3839
    3940my $build = "build.sh";
    40 our ($opt_b, $opt_x);
     41our ( $opt_x, $opt_b, $opt_d );
    4142my @ArrayofBuilds;
    42 getopts('b:x');
    43 
    44 
    45 if (!$opt_b) {
    46   $opt_b = "buildlist";
    47   print "using default buildlist: buildlist\n\n";
    48   print "other buildlist can be specified with -b buildlist\n\n";
     43getopts('xb:d:');
     44
     45
     46
     47if (!$opt_b && !$opt_d)  {
     48        print <<EOF
     49Usage:
     50  -b BUILDLIST
     51     compiles packages specified in BUILDLIST
     52  -d INSTALL_SRC_DEST_DIR
     53     creates a new install source in INSTALL_SRC_DEST_DIR
     54EOF
    4955};
    5056
     57
     58
     59#
     60# build packages from buildlist
     61#
     62
     63if( $opt_b ) {
    5164(open(BUILDLIST,$opt_b)) || die "Die Buildlist $opt_b  konnte nicht gefunden werden";
    5265
     
    7184
    7285print "What will be done:\n\n";
    73 ($wert1,$wert2,$wert3)= ("Path","Distribuition","Buildoptions");
     86($wert1,$wert2,$wert3)= ("BUILD_DIST","BUILD_MODE","Package");
    7487$~="TABELLE";
    7588write;
    76 print "\n";
    7789for my $i (0 .. $#ArrayofBuilds)
    7890  {
    79     ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][2]);
     91    ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][1],$ArrayofBuilds[$i][2],$ArrayofBuilds[$i][0]);
    8092    $~="TABELLE";
    8193    write;
     
    88100if ($answer ne "y") {die("canceled")};
    89101
    90 $ENV{'DEST_DIR'}=$DEST_DIR;
     102$ENV{'DEST_DIR'}=$BUILD_DEST_DIR;
    91103
    92104my $mypath;
     
    110122  print "$_ \n";
    111123  tr/\//\_/;
    112   `mkdir -p $DEST_DIR`;
    113   my $logfilename = "$DEST_DIR/$_$ArrayofBuilds[$i][1].log";
     124  `mkdir -p $BUILD_DEST_DIR`;
     125  my $logfilename = "$BUILD_DEST_DIR/$_$ArrayofBuilds[$i][1].log";
    114126
    115127  my $build_cmd="cd $mypath && $build";
     
    122134  }
    123135
    124   # if mypath is not a directory, so it is a src.rpm (hopefully)
     136  # if mypath is not a directory, so it is a .src.rpm (hopefully)
    125137  if( ! -d $mypath ) {
    126138    my $base    = basename($mypath);
     
    154166  if ( $retval == 0 )
    155167   {
    156      $ArrayofBuilds[$i][3]= "SUCCESS $ArrayofBuilds[$i][0]: OK";
     168     $ArrayofBuilds[$i][3] = "OK";
    157169     print"******                                                      ******\n";
    158170     print"******   building of $ArrayofBuilds[$i][0]: OK                    \n" ;
     
    161173  else
    162174   {
    163      $ArrayofBuilds[$i][3]="ERROR  $ArrayofBuilds[$i][0]: *FAILED*\n";
     175     $ArrayofBuilds[$i][3] = "*FAILED*";
    164176     print"******                                                      ******\n";
    165177     print"\n\n\nERROR: building of $ArrayofBuilds[$i][0]: *FAILED*\n";
     
    172184
    173185
    174 ($wert1,$wert2,$wert3)= ("Path","Distribuition","Result");
     186($wert1,$wert2,$wert3)= ("BUILD_DIST","Result","Package");
    175187$~="TABELLE";
    176188write;
    177 print "\n";
    178189
    179190for my $i (0 .. $#ArrayofBuilds)
    180191  {
    181     ($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3]);
     192    #($wert1,$wert2,$wert3)= ($ArrayofBuilds[$i][0],$ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3]);
     193        ($wert1,$wert2,$wert3) = ($ArrayofBuilds[$i][1],$ArrayofBuilds[$i][3],$ArrayofBuilds[$i][0]);
    182194    $~="TABELLE";
    183195    write;
     
    186198
    187199print "buildall.pl terminated\n";
     200}
     201
     202
     203
     204#
     205# generating install source
     206#
     207
     208if( $opt_d ) {
     209
     210        my $INSTALL_SRC_DEST_DIR=$opt_d;
     211        chomp $INSTALL_SRC_DEST_DIR;
     212       
     213        # create target directory
     214        run_command( "mkdir -p $INSTALL_SRC_DEST_DIR" );
     215        # copy skeletion to dest
     216        run_command( "rsync -av $INSTALL_SRC_SKEL_DIR $INSTALL_SRC_DEST_DIR" );
     217       
     218        # copy build packages to dest
     219        foreach my $i ( "i386", "i486", "i586", "i686", "noarch", "src" ) {
     220                run_command( "mkdir -p $INSTALL_SRC_DEST_DIR/suse/$i" );
     221                run_command( "rsync -av $BUILD_DEST_DIR/*/*.$i.rpm $INSTALL_SRC_DEST_DIR/suse/$i/" );
     222        }
     223       
     224        # create_package_descr (do that has to run on target distribution?)
     225        run_command( "cd $INSTALL_SRC_DEST_DIR/suse/; /usr/lib/YaST2/bin/create_package_descr -o $INSTALL_SRC_DEST_DIR/setup/descr" );
     226}
     227
     228
     229#
     230# functions
     231#
     232
     233# executes a command (single string).
     234# returns
     235#       the returncode
     236#       and (combined) stdout and stderr
     237
     238sub run_command
     239{
     240  my $command = shift;
     241
     242  print "executing command: " . $command . "\n";
     243
     244  open(RESULT, $command . ' 2>&1 |' );
     245  my @result = <RESULT>;
     246  close(RESULT);
     247  my $retcode = $?>>8;
     248
     249  print @result; 
     250  if( $retcode ) { print "return code: " . $retcode . "\n"; }
     251
     252  return($retcode, @result);
     253}
     254
     255
     256
  • trunk/technical/common/build/buildlist_sles8

    r663 r664  
    11# Steuerdatei für autobuildskript
    2 # $Id: buildlist_sles8,v 1.5 2003/08/29 09:10:14 aboernig Exp $
     2# $Id: buildlist_sles8,v 1.6 2003/09/01 13:34:07 joergs Exp $
    33# Format:
    44#
     
    3333external/SuSE/perl-Digest-MD5   :sles8-i686      :--no-init
    3434# not needed?
    35 #external/SuSE/perl-MIME-Base64  :sles8-i686      :--no-init
     35#external/SuSE/perl-MIME-Base64  :sles8-i686     :--no-init
    3636# requires perl-Digest-HMAC
    3737external/SuSE/perl-Net-DNS      :sles8-i686      :--clean
    3838external/SuSE/perl-Net-Netmask  :sles8-i686      :--no-init
    39 external/SuSE/perl-Unix-Syslog  :sles8-i686     :--no-init
     39external/SuSE/perl-Unix-Syslog  :sles8-i686          :--no-init
    4040
    4141# needs perl-XML-Parser
    42 external/SuSE/perl-ldap         :sles8-i686      :--no-init
     42external/SuSE/perl-ldap         :sles8-i686      :--clean
    4343
    4444external/cpan/perl-Net-IP               :sles8-i686      :--no-init
Note: See TracChangeset for help on using the changeset viewer.