Changeset 129 for trunk


Ignore:
Timestamp:
08/15/07 17:23:01 (17 years ago)
Author:
kdeugau
Message:

/trunk

Add support for Recommends, Suggests, and Replaces. Note that these are
Debian-specific headers/tags, and MUST be wrapped with a suitable %if
construct for multiplatform builds. (%if %{_vendor} == "debbuild" is
probably the best minimum choice.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r128 r129  
    661661    if ($stage eq 'package') {
    662662      # gotta expand %defines here.  Whee.
    663       if (my ($dname,$dvalue) = (/^(Summary|Group|Version|Requires|Provides|BuildArch(?:itecture)?):\s+(.+)$/i)) {
     663# Note that we look for the Debian-specific Recommends, Suggests, and Replaces,
     664# although they will have to be wrapped in '%if %{_vendor} == "debbuild"' for
     665# an rpmbuild-compatible .spec file
     666# NB: NOT going to support Pre-Depends, since it's a "Don't Use" (mis)feature, and
     667# RPM's support for a similar tag (PreReq) has been recently dropped.
     668      if (my ($dname,$dvalue) = (/^(Recommends|Suggests|Replaces|Summary|Group|Version|Requires|Conflicts|Provides|BuildArch(?:itecture)?):\s+(.+)$/i)) {
    664669        $dname =~ tr/[A-Z]/[a-z]/;
    665670        if ($dname =~ /^BuildArch/i) {
     
    883888      } elsif (/^conflicts:\s+(.+)/i) {
    884889        $pkgdata{main}{conflicts} .= ", $1";
     890      } elsif (/^recommends:\s+(.+)/i) {
     891        $pkgdata{main}{recommends} .= ", $1";
     892        warn "Warning:  Debian-specific 'Recommends:' outside \%if wrapper\n" if $iflevel == 0;
     893      } elsif (/^suggests:\s+(.+)/i) {
     894        $pkgdata{main}{suggests} .= ", $1";
     895        warn "Warning:  Debian-specific 'Suggests:' outside \%if wrapper\n" if $iflevel == 0;
     896      } elsif (/^replaces:\s+(.+)/i) {
     897        $pkgdata{main}{replaces} .= ", $1";
     898        warn "Warning:  Debian-specific 'Replaces:' outside \%if wrapper\n" if $iflevel == 0;
    885899      } elsif (/^autoreq(?:prov)?:\s+(.+)/i) {
    886900        # we don't handle auto-provides (yet)
     
    10921106    }
    10931107
     1108# These are Debian-specific!
     1109    if (defined($pkgdata{$pkg}{recommends})) {
     1110      $pkgdata{$pkg}{recommends} =~ s/^, //;
     1111      $pkgdata{$pkg}{recommends} = expandmacros($pkgdata{$pkg}{recommends},'gp');
     1112    }
     1113    if (defined($pkgdata{$pkg}{suggests})) {
     1114      $pkgdata{$pkg}{suggests} =~ s/^, //;
     1115      $pkgdata{$pkg}{suggests} = expandmacros($pkgdata{$pkg}{suggests},'gp');
     1116    }
     1117    if (defined($pkgdata{$pkg}{replaces})) {
     1118      $pkgdata{$pkg}{replaces} =~ s/^, //;
     1119      $pkgdata{$pkg}{replaces} = expandmacros($pkgdata{$pkg}{replaces},'gp');
     1120    }
     1121
    10941122    # Gotta do this next, otherwise the control file has nowhere to go.  >:(
    10951123    mkdir "$buildroot/$pkg/DEBIAN";
     
    11221150        ( defined($pkgdata{$pkg}{provides}) ? "Provides: $pkgdata{$pkg}{provides}\n" : '' ).
    11231151        ( defined($pkgdata{$pkg}{conflicts}) ? "Conflicts: $pkgdata{$pkg}{conflicts}\n" : '' ).
     1152        ( defined($pkgdata{$pkg}{recommends}) ? "Recommends: $pkgdata{$pkg}{recommends}\n" : '' ).
     1153        ( defined($pkgdata{$pkg}{suggests}) ? "Suggests: $pkgdata{$pkg}{suggests}\n" : '' ).
     1154        ( defined($pkgdata{$pkg}{replaces}) ? "Replaces: $pkgdata{$pkg}{replaces}\n" : '' ).
    11241155        "Description: $pkgdata{$pkg}{summary}\n";
    11251156    $control .= "$pkgdata{$pkg}{desc}\n";
Note: See TracChangeset for help on using the changeset viewer.