Changeset 2334 in ProjectBuilder for devel


Ignore:
Timestamp:
Oct 25, 2017, 12:01:59 AM (6 years ago)
Author:
Bruno Cornec
Message:

Greatly improve apk build (still not finished however)

Location:
devel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.yml

    r2333 r2334  
    685685  mandrake-10.2: rpm-build,wget,patch,make,ntp-client,perl-File-MimeInfo,diffutils,perl-DateManip,perl-YAML
    686686  md: rpm-build,wget,patch,make,ntp-client,perl-File-MimeInfo,perl-File-BaseDir,perl-Date-Manip,diffutils,perl-YAML
    687   apk: perl-date-manip,wget,patch,make,perl-file-basedir,perl-date-manip,perl-yaml,diffutils,alpine-sdk,bash
     687  apk: perl-date-manip,wget,patch,make,perl-file-basedir,perl-yaml,diffutils,alpine-sdk,bash
    688688  lsb:
    689689  deb: wget,patch,dpkg-dev,make,debian-builder,dh-make,fakeroot,ntpdate,libfile-mimeinfo-perl,libmodule-build-perl,libdate-manip-perl,libmail-sendmail-perl,diffutils,libyaml-perl
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r2333 r2334  
    413413    $regexp = '^Build-Depends:(.*)$';
    414414} elsif ($pbos->{'type'} eq "apk") {
    415     # TODO
    416     $regexp = 'TODO\n';
     415    $regexp = '^makedepends=(.*)$';
    417416} elsif ($pbos->{'type'} eq "ebuild") {
    418417    $sep = '"'.$/;
     
    527526        pb_log(1, "INFO: missing dependency $p\n");
    528527    } elsif ($pbos->{'type'} eq "ebuild") {
     528    } elsif ($pbos->{'type'} eq "apk") {
     529        my $res = pb_system("apk info $p","Looking for $p","mayfail");
     530        next if ($res eq 0);
     531        pb_log(1, "INFO: missing dependency $p\n");
    529532    } else {
    530533        # Not reached
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r2320 r2334  
    266266pb_log(1,"PBDESTDIR: $ENV{'PBDESTDIR'}\n");
    267267#
    268 # Removes all directory existing below the delivery dir
     268# Removes all directories existing below the delivery dir
    269269# as they are temp dir only except when called from a pbinit script
    270270# Files stay and have to be cleaned up manually if needed
  • devel/pb/bin/pb

    r2333 r2334  
    891891} elsif ($action =~ /^sbx2build$/) {
    892892    pb_cms2build("SandBox");
    893 } elsif ($action =~ /^build2prep/) {
     893} elsif ($action =~ /^build2prep$/) {
    894894    pb_build2prep();
    895 } elsif ($action =~ /^sbx2prep/) {
     895} elsif ($action =~ /^sbx2prep$/) {
    896896    pb_cms2build("SandBox");
    897897    pb_build2prep();
     
    17011701            # TODO: HP-UX
    17021702        } elsif ($pbos->{'type'} eq "apk") {
    1703             # TODO: Alpine
     1703            $ftype = "\/APKBUILD\$";
    17041704        } else {
    17051705            die "Unknown OS type format $pbos->{'type'}";
     
    19711971                }
    19721972            }
     1973
     1974        } elsif ($pbos->{'type'} eq "apk") {
     1975            pb_mkdir_p("$ENV{'PBBUILDDIR'}/tmp");
     1976
     1977            # We need to first extract the APKBUILD file
     1978            my @apkfile = pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/","$ENV{'PBBUILDDIR'}/tmp","build");
     1979
     1980            chdir "$ENV{'PBBUILDDIR'}/ || die "Unable to chdir to $ENV{'PBBUILDDIR'}/$pb->{'realpkg'}";
     1981
     1982            # Build
     1983            foreach my $f (@apkfile) {
     1984                if ($f =~ /^APKBUILD$/) {
     1985                    pb_system("abuild unpack ; abuild checksum ; abuild -r -P $ENV{'PBBUILDDIR'}/tmp build ; abuild -r -P .. root-pkg ; abuild -P pkg index","verbose");
     1986                }
     1987            # Get the name of the generated packages
     1988            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
     1989            while (<LOG>) {
     1990                chomp($_);
     1991                next if ($_ !~ /: Create /);
     1992                s|.*: Create (.*.apk)|$1|;
     1993                $made .= " $_";
     1994            }
     1995            close(LOG);
     1996
     1997}
    19731998
    19741999        } elsif ($pbos->{'type'} eq "tgz") {
     
    23462371        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
    23472372    } elsif ($cmt eq "Packages") {
    2348         if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz")) {
     2373        if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz") || ($pbos->{'type'} eq "apk")) {
    23492374            # put packages under an arch subdir
    23502375            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
     
    25732598done
    25742599EOF
     2600        } elsif ($pbos->{'type'} eq "apk") {
     2601            # TODO
    25752602        }
    25762603        close(PBS);
     
    30643091}
    30653092
     3093$vetype = pb_ve_get_type($vetype);
     3094if ((($vtype =~ /vm/) || (($vtype =~ /ve/) && ($vetype eq "docker"))) && (((not defined $pbimage) || ($pbimage eq "")) && ($pbstep == 0))) {
     3095    confess "-i image parameter needed";
     3096}
     3097
    30663098my $counter = 0;
    30673099foreach my $v (@$vm) {
     
    31343166# Launch the VMs/VEs
    31353167if ($vtype eq "vm") {
    3136     confess "-i image parameter needed" if (((not defined $pbimage) || ($pbimage eq "")) && ($pbstep == 0));
    3137 
    31383168    my ($ptr,$ptr2,$vmpath,$vmport,$vms) = pb_conf_get("vmtype","vmcmd","vmpath","vmport","vmsize");
    31393169    my ($vmopt,$vmmm,$vmtmout,$vmsnap,$vmbuildtm,$vmmonport) = pb_conf_get_if("vmopt","vmmem","vmtmout","vmsnap","vmbuildtm","vmmonport");
     
    38323862    } elsif ( -x "/usr/sbin/addgroup" ) {
    38333863        pb_system("/usr/sbin/addgroup $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}");
     3864        pb_system("/usr/sbin/addgroup $pbac->{$ENV{'PBPROJ'}} abuild","Adding $pbac->{$ENV{'PBPROJ'}} to group abuild");
    38343865    } else {
    38353866        die "Unable to find a command to add a group on this distribution";
     
    43084339            my $ntag = "[2-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]";
    43094340            $pbver .= $ntag;
     4341            # TODO add apk
    43104342            $findstr .= "-name \'$pbrealpkgrpm-$pbver-$pbtag\.*.rpm\' -o -name \'$pbrealpkgrpm-debug-$pbver-$pbtag\.*.rpm\' -o -name \'$pbrealpkgdeb"."_$pbver-$pbtag"."_*\.deb\' -o -name \'$pbrealpkgdeb"."_$pbver-$pbtag.dsc\' -o -name \'$pbrealpkgdeb"."_$pbver-$pbtag.tar.gz\' -o -name \'$pbrealpkg-$nver"."_p$ntag\.ebuild\' -o -name \'$pbrealpkg-$pbver-$pbtag*\.pkg\.gz\' -o -name \'$pbrealpkg-$pbver-$pbtag*\.sd\' ";
    43114343            $srcstr .= "src/$pbrealpkg-$pbver.tar.gz src/$pbrealpkg-$pbver.pbconf.tar.gz ";
     
    43664398                    $theorlist{"$pbos->{'name'}/$pbos->{'version'}/$pbrealpkg-$pbver$prefix$pbtag.ebuild"} = 0;
    43674399                    $archlist{"$pbos->{'name'}/$pbos->{'version'}/$pbrealpkg-$pbver$prefix$pbtag.ebuild"} = "$pbos->{'arch'}";
     4400                } elsif ($pbos->{'type'} eq "apk") {
     4401                    # TODO
    43684402                } elsif ($pbos->{'type'} eq "pkg") {
    43694403                    $theorlist{"$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/$pbrealpkg-$pbver-$pbtag.pkg.gz"} = 0;
     
    44464480            $p =~ s/(-0\.[0-9]{8})[0-9]{6}/$1*/ if ((defined $testver) && (defined $testver->{$ENV{'PBPROJ'}}) && ($testver->{$ENV{'PBPROJ'}} =~ /true/i));
    44474481            $p =~ s/(-r|_p[0-9]+)\.ebuild/$1*/ if ((defined $testver) && (defined $testver->{$ENV{'PBPROJ'}}) && ($testver->{$ENV{'PBPROJ'}} =~ /true/i));
     4482            # TODO apk
    44484483            $theorlist{$p} = -2 if (not defined $theorlist{$p});
    44494484            $theorlist{$p} = $theorlist{$p} + 1;
Note: See TracChangeset for help on using the changeset viewer.