Changeset 2333 in ProjectBuilder


Ignore:
Timestamp:
Oct 24, 2017, 12:49:59 AM (7 years ago)
Author:
Bruno Cornec
Message:

Initial support of apk for pb

Location:
devel
Files:
5 edited

Legend:

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

    r2324 r2333  
    5757  # OEL
    5858  oel: /etc/oracle-release
     59
     60  # Alpine
     61  alpine: /etc/alpine-release
    5962
    6063  # HP-UX
     
    148151  redhat: Red Hat Linux release (.+) \(
    149152  cloudlinux: CloudLinux Server release (.+) \(
     153  alpine: (\d)\.[0-9.]*
    150154  # If you want to differentiate .release for Scientific
    151155  #scilinux: Scientific Linux release ([0-9\.]+)\b
     
    197201  mandriva: md
    198202  mageia: md
     203  alpine: alp
    199204  lsb: rh
    200205  freebsd: bsd
     
    214219  sol: pkg
    215220  hpux: sd
     221  alp: apk
    216222
    217223# Group ostype by os
     
    222228  ebuild: linux
    223229  rpm: linux
     230  apk: linux
    224231  port: bsd
    225232  pkg: solaris
     
    251258  novell: sudo /usr/bin/zypper refresh ; sudo /usr/bin/zypper --gpg-auto-import-keys -n update --auto-agree-with-licenses
    252259  redhat: /bin/true
     260  apk: sudo apk add -U
    253261  sol: /bin/true
    254262  lsb: /bin/true
     
    277285  novell: sudo /usr/bin/zypper refresh ; sudo /usr/bin/zypper --gpg-auto-import-keys -n install --auto-agree-with-licenses
    278286  redhat: sudo /bin/rpm -i --ignorearch
     287  apk: sudo apk add -U
    279288  sol: sudo /usr/sbin/pkgadd -d
    280289  lsb: /bin/true
     
    302311  cloudlinux: cl
    303312  mageia: mga
     313  apk: apk
    304314  lsb: lsb
    305315  hpux: sd
     
    313323  gentoo: true
    314324  arch: true
     325  alpine: true
    315326
    316327# For that OS no need to keep the . in the version release
     
    336347  default: perl-YAML,sudo,wget,tar,make,gzip
    337348  deb: libyaml-perl,sudo,wget,tar,make,gzip
     349  apk: perl,perl-yaml,sudo,wget,tar,make,gzip
    338350  rhel-7-x86_64: perl-Data-Dumper,sudo,wget,tar,make,gzip
    339351  centos-7-x86_64: perl-YAML,sudo,wget,tar,make,gzip
     
    628640  mandrake-10.1: Date-Manip,YAML
    629641  md:
     642  apk: File-MimeInfo
    630643  # LSB
    631644  lsb: Module-Build,Date-Manip,File-MimeInfo,File-BaseDir
     
    672685  mandrake-10.2: rpm-build,wget,patch,make,ntp-client,perl-File-MimeInfo,diffutils,perl-DateManip,perl-YAML
    673686  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
    674688  lsb:
    675689  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

    r2330 r2333  
    206206# 3: Should have the same keys as the previous one. If ambiguity, which other distributions should be checked
    207207# 4: Matching Rg. Expr to detect distribution and version
    208 my ($single_rel_files, $ambiguous_rel_files,$distro_similar,$distro_match) = pb_conf_get("osrelfile","osrelambfile","osambiguous","osrelexpr");
     208my ($single_rel_files, $ambiguous_rel_files,$distro_similar,$distro_match,$nover) = pb_conf_get("osrelfile","osrelambfile","osambiguous","osrelexpr","osnover");
    209209
    210210my $release;
     
    226226            ($release) = $tmp =~ m/$distro_match->{$d}/m;
    227227        } else {
    228             print STDERR "Unable to find $d version in $r (non-ambiguous)\n";
    229             print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
     228            if (not defined ($nover->{$d})) {
     229                print STDERR "Unable to find $d version in $r (non-ambiguous)\n";
     230                print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
     231            }
    230232            $release = "unknown";
    231233        }
     
    410412} elsif ($pbos->{'type'} eq "deb") {
    411413    $regexp = '^Build-Depends:(.*)$';
     414} elsif ($pbos->{'type'} eq "apk") {
     415    # TODO
     416    $regexp = 'TODO\n';
    412417} elsif ($pbos->{'type'} eq "ebuild") {
    413418    $sep = '"'.$/;
    414     $regexp = '^DEPEND="(.*)"\n'
     419    $regexp = '^DEPEND="(.*)"\n';
    415420} else {
    416421    # No idea
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r2317 r2333  
    255255        } elsif ($pbos->{'type'} eq "ebuild") {
    256256            die "Please teach the dev team how to build gentoo chroot";
     257        } elsif ($pbos->{'type'} eq "apk") {
     258            die "Please teach the dev team how to build alpine chroot";
    257259        } else {
    258260            die "Unknown distribution type $pbos->{'type'}. Report to dev team";
  • devel/pb/bin/pb

    r2327 r2333  
    17001700        } elsif ($pbos->{'type'} eq "hpux") {
    17011701            # TODO: HP-UX
     1702        } elsif ($pbos->{'type'} eq "apk") {
     1703            # TODO: Alpine
    17021704        } else {
    17031705            die "Unknown OS type format $pbos->{'type'}";
     
    38223824EOF
    38233825    # TODO: Level of portability of these cmds ? Critical now for RM
    3824     # TODO: Check existence before adding to avoid errors
     3826    # TODO: use an external parameter
    38253827    print SCRIPT << "EOF";
    3826 pb_system("/usr/sbin/groupadd $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}");
    3827 pb_system("/usr/sbin/useradd -g $pbac->{$ENV{'PBPROJ'}} -m -d $home/$pbac->{$ENV{'PBPROJ'}} $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})");
     3828    # Most Linux distros
     3829    if ( -x "/usr/sbin/groupadd" ) {
     3830        pb_system("/usr/sbin/groupadd $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}");
     3831    # Alpine with busybox
     3832    } elsif ( -x "/usr/sbin/addgroup" ) {
     3833        pb_system("/usr/sbin/addgroup $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}");
     3834    } else {
     3835        die "Unable to find a command to add a group on this distribution";
     3836    }
     3837    # Most Linux distros
     3838    if ( -x "/usr/sbin/useradd" ) {
     3839        pb_system("/usr/sbin/useradd -g $pbac->{$ENV{'PBPROJ'}} -m -d $home/$pbac->{$ENV{'PBPROJ'}} $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})");
     3840    # Alpine with busybox
     3841    } elsif ( -x "/usr/sbin/adduser" ) {
     3842        pb_system("/usr/sbin/adduser -G $pbac->{$ENV{'PBPROJ'}} -h $home/$pbac->{$ENV{'PBPROJ'}} -D $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})");
     3843    } else {
     3844        die "Unable to find a command to add a user on this distribution";
     3845    }
    38283846}
    38293847EOF
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r2325 r2333  
    104104        } elsif ($dtype eq "ebuild") {
    105105            $pbpkgreal = $pbpkg;
     106        } elsif ($dtype eq "apk") {
     107            $pbpkgreal = $pbpkg;
    106108        } elsif ($dtype eq "hpux") {
    107109            $pbpkgreal = $pbpkg;
Note: See TracChangeset for help on using the changeset viewer.