Changeset 1652 in ProjectBuilder


Ignore:
Timestamp:
Oct 7, 2012, 7:54:06 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • As Red Hat 6.2 in chroot doesn't support setarch i386 for a x86_64 environment, we have to fake x86_64 rpm build in /etc/rpmrc
  • Red Hat 6.2 builds with the rpm command, not rpmbuild
  • Red Hat 6.2 sudo doesn't support the env_keep var, remove it
Location:
devel
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/bin/pbdistrocheck

    r1551 r1652  
    3030=head1 SYNOPSIS
    3131
    32 pbdistrocheck [-d][-v][-l [-c][-i][-r][-a]][-s] [distro-ver-arch]
     32pbdistrocheck [-h][-d][-v][-l [-c][-i][-r][-a]][-s] [distro-ver-arch]
    3333
    3434=head1 OPTIONS
    3535
    3636=over 4
     37
     38=item B<-h|--help>
     39
     40Prints this help
    3741
    3842=item B<-v|--verbose>
     
    4246=item B<-a|--all>
    4347
    44 print all parameters
     48Print all parameters
    4549
    4650=item B<-s|--short>
    4751
    48 generate a short format user friendly, comma separated allowing parsing
     52Generate a short format user friendly, comma separated allowing parsing
    4953
    5054=item B<-l|--lsb>
    5155
    52 generate an LSB compliant output
     56Generate an LSB compliant output
    5357
    5458=item B<-d|--description>
    5559
    56 print only description (LSB only)
     60Print only description (LSB only)
    5761
    5862=item B<-r|--release>
    5963
    60 print only release (LSB only)
     64Print only release (LSB only)
    6165
    6266=item B<-c|--codename>
    6367
    64 print only codename (LSB only)
     68Print only codename (LSB only)
    6569
    6670=item B<-i|--id>
    6771
    68 print only distribution identificator (LSB only)
     72Print only distribution identificator (LSB only)
    6973
    7074=item B<-a|--all>
    7175
    72 print all LSB fields
     76Print all LSB fields
    7377
    7478=back
     
    7680=head1 ARGUMENTS
    7781
    78 arguments are optional. If none given, analyzes the underlying operating system
     82Arguments are optional. If none given, analyzes the underlying operating system
    7983If one is given, it should have the format osname-version-architecture, and in that case pbdistrocheck will provide all the information related to that OS needed by pb.
    8084
     
    107111        "verbose|v+" => \$opts{'v'},
    108112        "short|s" => \$opts{'s'},
     113        "help|h" => \$opts{'h'},
    109114        "description|d" => \$opts{'d'},
    110115        "id|i" => \$opts{'i'},
  • devel/pb-modules/etc/pb.conf

    r1651 r1652  
    301301# These deps are needed for rpmbootstrap to install a base distribution
    302302# Originally reuse from rinse conf files
    303 rbsmindep redhat-6.2 = MAKEDEV,SysVinit,authconfig,basesystem,bash,binutils,bzip2,chkconfig,console-tools,cracklib,cracklib-dicts,dev,dev86,diffutils,dhcpcd,e2fsprogs,file,filesystem,fileutils,findutils,gawk,gdbm,glib,glibc,gmp,grep,gzip,info,initscripts,iproute,iputils,kernel,krb5-configs,krb5-libs,ldconfig,ld.so,libc,libelf,libstdc++,libtermcap,logrotate,make,mingetty,mktemp,modutils,mount,newt,ncurses,net-tools,pam,passwd,patch,perl,popt,procps,psmisc,pwdb,python,readline,redhat-release,rpm,rpm-python,sed,setup,shadow-utils,sh-utils,slang,sysklogd,tar,tcsh,termcap,textutils,util-linux,vim-common,vim-minimal,vixie-cron,which,wget,xntp3,zlib
     303# For Rd Hat 6.2 perl is excluded as a manual install from http://www.cpan.org/src/5.0/perl-5.6.2.tar.gz is required
     304rbsmindep redhat-6.2 = MAKEDEV,SysVinit,authconfig,basesystem,bash,binutils,bzip2,chkconfig,console-tools,cracklib,cracklib-dicts,dev,dev86,diffutils,dhcpcd,e2fsprogs,file,filesystem,fileutils,findutils,gawk,gdbm,glib,glibc,gmp,grep,gzip,info,initscripts,iproute,iputils,kernel,krb5-configs,krb5-libs,ldconfig,ld.so,libc,libelf,libstdc++,libtermcap,logrotate,make,mingetty,mktemp,modutils,mount,newt,ncurses,net-tools,pam,passwd,patch,popt,procps,psmisc,pwdb,python,readline,redhat-release,rpm,rpm-build,rpm-python,sed,setup,shadow-utils,sh-utils,slang,sysklogd,tar,tcsh,termcap,textutils,util-linux,vim-common,vim-minimal,vixie-cron,which,wget,xntp3,zlib
    304305#
    305306rbsmindep fedora-4 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,chkconfig,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libtermcap,libxml2,libxml2-python,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,zlib
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1651 r1652  
    453453
    454454This function returns the architecture of our local environment and
    455 standardize on i386 for those platforms. It also solves issues where a i386 VE on x86_64 returns x86_64 wrongly
     455standardize on i386 for those platforms.
    456456
    457457=cut
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1651 r1652  
    132132# Initialize arch
    133133$pbos->{'arch'} = pb_get_arch() if (not defined $pbos->{'arch'});
     134# Solves a bug on Red Hat 6.x where real arch is not detected when using setarch and a chroot
     135# As it was only i386 forcing it here.
     136$pbos->{'arch'} = "i386" if (($pbos->{'name'} eq "redhat") && ($pbos->{'version'} =~ /^6\./));
    134137
    135138# Dig into the tuple to find the best answer
     
    330333# Get dependencies in the build file if not forced
    331334$deps = pb_distro_getdeps($f,$pbos) if (not defined $deps);
    332 pb_log(1, "ftp_proxy=$ENV{ftp_proxy} http_proxy=$ENV{http_proxy}\n");
     335pb_log(1, "ftp_proxy=$ENV{ftp_proxy}\n") if (defined $ENV{ftp_proxy});
     336pb_log(1, "http_proxy=$ENV{http_proxy}\n")  if (defined $ENV{http_proxy});
    333337pb_log(2,"deps: $deps\n");
    334338return if ((not defined $deps) || ($deps =~ /^\s*$/));
  • devel/pb/bin/pb

    r1651 r1652  
    14771477            # Older Redhat use _target_platform in %configure incorrectly
    14781478            my $specialdef = "";
    1479             if (($pbos->{'name'} eq "redhat") || (($pbos->{'name'} eq "rhel") && ($pbos->{'version'} eq "2.1"))) {
     1479            if (($pbos->{'name'} eq "rhel") && ($pbos->{'version'} eq "2.1")) {
    14801480                $specialdef = "--define \'_target_platform \"\"\'";
     1481            }
     1482            my $buildcmd = "rpmbuild";
     1483            if (($pbos->{'name'} eq "redhat") && ($pbos->{'version'} =~ /^6/)){
     1484                $buildcmd = "rpm" ;
    14811485            }
    14821486
     
    14851489                    # This could cause an issue in // mode
    14861490                    pb_distro_installdeps($f,$pbos);
    1487                     pb_system("rpmbuild $specialdef --define \"packager $ENV{'PBPACKAGER'}\" --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}","verbose");
     1491                    pb_system("$buildcmd $specialdef --define \"packager $ENV{'PBPACKAGER'}\" --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}","verbose");
    14881492                    last;
    14891493                }
     
    23432347    if ($cmt =~ /^VE/) {
    23442348        my $res = pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers","quiet");
    2345         pb_system("$shcmdroot sed '/requiretty/d' /etc/sudoers > /tmp/sudoers.new ; mv /tmp/sudoers.new $tpdir/tmp/sudoers.new ; $shcmdroot mv /tmp/sudoers.new /etc/sudoers","Removing again potential requiretty in sudoers as sed -i failed") if (($res ne 0) && (-f "$tpdir/etc/sudoers"));
     2349        pb_system("$shcmdroot sed '/requiretty/d' /etc/sudoers > /tmp/sudoers.new ; mv /tmp/sudoers.new $tpdir/tmp/sudoers.new ; $shcmdroot mv /tmp/sudoers.new /etc/sudoers ; $shcmdroot chown root:root /etc/sudoers ; $shcmdroot chmod 440 /etc/sudoers","Removing again potential requiretty in sudoers as sed -i failed") if (($res ne 0) && (-f "$tpdir/etc/sudoers"));
    23462350        pb_system("$shcmd \"sudo $chowncommand -R $mac $tdir\"","Adapt owner in $tdir to $mac");
    23472351    }
     
    23692373        pb_system("$cpcmd $cp2target/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$ 2> /dev/null","Get package names in $cp2target");
    23702374        if (not -f "$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") {
    2371             pb_log(0,"ERROR with VM/RM $v on getting $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$");
     2375            pb_log(0,"ERROR with VM/RM $v on getting $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$\n");
    23722376        } else {
    23732377            open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$";
     
    24662470    # in $ENV{'PBDESTDIR'}/pbscript.$$
    24672471    if ((defined $pbscript ) && ($pbscript ne "$ENV{'PBDESTDIR'}/pbscript.$$")) {
    2468         copy($pbscript,"$ENV{'PBDESTDIR'}/pbscript.$$") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript.$$";
     2472        copy($pbscript,"$ENV{'PBDESTDIR'}/pbscript.$$") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript.$$ from $pbscript";
    24692473        chmod 0755,"$ENV{'PBDESTDIR'}/pbscript.$$";
    24702474    }
     
    27632767    if ($action eq "build") {
    27642768        print SCRIPT "# Preparation for pb\n";
     2769        print SCRIPT "rm -f \$HOME/.pbrc\n";
    27652770        print SCRIPT "mv .pbrc \$HOME\n";
    27662771        print SCRIPT "cd ..\n";
     
    32993304print PBOUT "Defaults:$pbac->{$ENV{'PBPROJ'}} !requiretty\n";
    33003305print PBOUT "Defaults:root !requiretty\n";
     3306EOF
     3307    # RH 6.2 sudo doesn't support env_keep
     3308    if (($pbos->{'name'} ne "redhat") && ($pbos->{'version'} ne "6.2")) {
     3309        print SCRIPT << "EOF";
    33013310# Keep proxy configuration while using sudo
    33023311print PBOUT "Defaults:$pbac->{$ENV{'PBPROJ'}}    env_keep += \\\"http_proxy ftp_proxy\\\"\n";
    33033312print PBOUT "Defaults:root    env_keep += \\\"http_proxy ftp_proxy\\\"\n";
    33043313EOF
     3314    }
    33053315    # Try to restrict security to what is really needed
    33063316    if ($vtype =~ /^vm/) {
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1645 r1652  
    449449        unlink("$vepath/tmp/$p1");
    450450    }
    451 # RedHat 6.2 has a buggy termcap setup
    452 } elsif ($pbos->{'name'} =~ /redhat/) {
     451# RedHat 6.2 has a buggy termcap setup and doesn't support usage of setarch, so still returns x86_64 in a chroot
     452} elsif (($pbos->{'name'} =~ /redhat/) && ( $pbos->{'version'} =~ /^6/)) {
    453453    pb_system("chroot $vepath ldconfig","Forcing ldconfig on $pbos->{'name'} $pbos->{'version'}");
     454    pb_system("chroot $vepath echo 'arch_canon:     x86_64: x86_64  1' >> /etc/rpmrc","Forcing ldconfig on $pbos->{'name'} $pbos->{'version'}");
     455    pb_system("chroot $vepath echo 'arch_compat: x86_64: i386' >> /etc/rpmrc","Forcing ldconfig on $pbos->{'name'} $pbos->{'version'}");
     456    pb_system("chroot $vepath echo 'buildarch_compat: x86_64: i386' >> /etc/rpmrc","Forcing ldconfig on $pbos->{'name'} $pbos->{'version'}");
     457    pb_system("chroot $vepath echo 'buildarchtranslate: x86_64: i386' >> /etc/rpmrc","Forcing ldconfig on $pbos->{'name'} $pbos->{'version'}");
    454458}
    455459#
  • devel/rpmbootstrap/etc/.pbrc

    r1078 r1652  
    4141#velist default = mandrake-10.1-i386,mandrake-10.2-i386,mandriva-2006.0-i386,mandriva-2007.0-i386,mandriva-2007.1-i386,mandriva-2008.0-i386,mandriva-2008.1-i386,mandriva-2009.0-i386,redhat-7.3-i386,redhat-9-i386,fedora-4-i386,fedora-5-i386,fedora-6-i386,fedora-7-i386,fedora-8-i386,fedora-9-i386,fedora-10-i386,rhel-2.1-i386,rhel-3-i386,rhel-4-i386,rhel-5-i386,suse-10.0-i386,suse-10.1-i386,suse-10.2-i386,suse-10.3-i386,sles-9-i386,sles-10-i386,gentoo-nover-i386,debian-3.1-i386,debian-4.0-i386,ubuntu-6.06-i386,ubuntu-7.04-i386,ubuntu-7.10-i386,ubuntu-8.04-i386,mandriva-2007.0-x86_64,mandriva-2007.1-x86_64,mandriva-2008.0-x86_64,mandriva-2008.1-x86_64,mandriva-2009.0-x86_64,fedora-6-x86_64,fedora-7-x86_64,fedora-8-x86_64,fedora-9-x86_64,fedora-10-x86_64,rhel-4-x86_64,rhel-5-x86_64,suse-10.2-x86_64,suse-10.3-x86_64,sles-10-x86_64,gentoo-nover-x86_64,debian-4.0-x86_64,ubuntu-7.04-x86_64,ubuntu-7.10-x86_64,rhel-3-ia64,centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64
    4242#velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64
    43 velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64,debian-5.0-i386,debian-5.0-x86_64,lsb-3.2.0-i386,lsb-3.2.0-x86_64,lsb-4.0.1-i386,lsb-4.0.1-x86_64,mandriva-2010.0-x86_64,ubuntu-10.04-x86_64,mandriva-2010.1-x86_64
     43velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64,debian-5.0-i386,debian-5.0-x86_64,lsb-3.2.0-i386,lsb-3.2.0-x86_64,lsb-4.0.1-i386,lsb-4.0.1-x86_64,mandriva-2010.0-x86_64,mandriva-2010.1-x86_64,redhat-6.2-i386,ubuntu-10.04-x86_64
Note: See TracChangeset for help on using the changeset viewer.