Ignore:
Timestamp:
2014-12-15T15:56:33+13:00 (9 years ago)
Author:
Jeremy Symon
Message:

Building for correct architecture for RPM. Kind of. Subpackage architectures don't work due to a flaw in RPM subpackages (see rant in perllib/Greenstone/Package/_rpm.pm for details)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm

    r29611 r29638  
    5353        my @optional;
    5454        scalar(@{$self->{config}->{DEPENDS}}) gt 0 and
    55             push @optional, 'Requires:  %DEPENDS%';
     55            push @optional, 'Requires:      %DEPENDS%';
     56        # Cannot set architecture for subpackages because RPM's subpackages
     57        #  implementation is broken.
     58        # Greenstone core gets split into three packages:
     59        #  - The main web servlets (java classes)       - noarch
     60        #  - The native libraries used by the servlets  - native
     61        #  - The tools for building collections         - native
     62        # As RPM forces subpackages to inherit their name from a root package,
     63        #  the main web servlets must be set as the root package
     64        #  (in order for everything to get the right name).
     65        # This means that the root package should be noarch, and the subpackages
     66        #  must be native.
     67        # But this is impossible with RPM (subpackages must be either the same
     68        #  architecture as the root package, or noarch)
     69        # To avoid this until someone fixes RPM into an actual working package
     70        #  manager, we will just make the core greenstone package pretend to
     71        #  be native.
     72        unless (defined $packages) {
     73            $self->{config}->{ARCHITECTURE} eq $self->{config}->{ARCH_ANY} and
     74                push @optional, 'BuildArch:     %ARCHITECTURE%';
     75        }
    5676        for my $line (
    5777            'Name:          %NAME%',
     
    95115            $self->{config} = $package;
    96116            my @optional;
    97             scalar(@{$package->{DEPENDS}}) gt 0 and
    98                 push @optional, 'Requires:  %DEPENDS%';
     117            scalar(@{$self->{config}->{DEPENDS}}) gt 0 and
     118                push @optional, 'Requires:      %DEPENDS%';
    99119            for my $line (
    100120                '%package %NAME%',
    101                 'Summary:   %DESCRIPTION_SHORT%',
     121                'Summary:       %DESCRIPTION_SHORT%',
    102122                'AutoReqProv:   no',
    103123                @optional,
Note: See TracChangeset for help on using the changeset viewer.