Changeset 41 for trunk


Ignore:
Timestamp:
02/23/06 16:14:33 (19 years ago)
Author:
kdeugau
Message:

/trunk

Removed some extraneous reference comments
Expanded some description comments
Expanded dependency processing to handle libs that are part of

the package getting built, and (sub)packages that don't contain
executables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r40 r41  
    671671  }
    672672
    673 ##work
    674673  foreach my $pkg (@pkglist) {
    675674
     
    695694
    696695    # Do this here since we're doing {depends}...
    697     $pkgdata{$pkg}{provides} =~ s/^, // if defined($pkgdata{$pkg}{provides});
     696    if (defined($pkgdata{$pkg}{provides})) {
     697      $pkgdata{$pkg}{provides} =~ s/^, //;
     698      $pkgdata{$pkg}{provides} = expandmacros($pkgdata{$pkg}{provides},'gp');
     699    }
    698700
    699701    # Gotta do this next, otherwise the control file has nowhere to go.  >:(
     
    720722        "Architecture: i386\n".
    721723        "Maintainer: $pkgdata{main}{packager}\n".
    722         "Depends: $pkgdata{$pkg}{depends}\n".
     724        ( $pkgdata{$pkg}{depends} ne '' ? "Depends: $pkgdata{$pkg}{depends}\n" : '' ).
    723725        ( defined($pkgdata{$pkg}{provides}) ? "Provides: $pkgdata{$pkg}{provides}\n" : '' ).
    724726        "Description: $pkgdata{$pkg}{summary}\n";
     
    775777      }
    776778    }
    777 
    778 #print `ls -l $buildroot/DEBIAN`;
    779 
    780 #Package: httpd
    781 #Version: 2.0.54-7via
    782 #Section: unknown
    783 #Priority: optional
    784 #Architecture: i386
    785 #Depends: libc6 (>= 2.3.2.ds1-21), libdb4.2, libexpat1 (>= 1.95.8), libssl0.9.7, libapr0
    786 #Replaces: apache2
    787 #Installed-Size: 3076
    788 #Maintainer: Kris Deugau <kdeugau@vianet.ca>
    789 #Description: apache2 for ViaNet
    790 # apache2 for ViaNet.  Includes per-vhost setuid patches from
    791 # http://home.samfundet.no/~sesse/mpm-itk/.
    792779
    793780    # execute
     
    915902# executables and libs in a given file tree.
    916903# (Debian doesn't have soname-level deps;  just package-level)
     904# Returns an empty string if the tree contains no binaries.
     905# Doesn't work well on shell scripts. but those *should* be
     906# fine anyway.  (Yeah, right...)
    917907sub getreqs() {
    918908  my $pkgtree = $_[0];
    919909
    920910  print "Checking library requirements...\n";
    921   my @reqlist = qx { find $pkgtree -type f -perm 755 | grep -v $pkgtree/etc | xargs ldd };
     911  my @binlist = qx { find $pkgtree -type f -perm 755 | grep -v $pkgtree/etc };
     912
     913  if (scalar(@binlist) == 0) {
     914    return '';
     915  }
     916
     917  my @reqlist;
     918  foreach (@binlist) {
     919    push @reqlist, qx { ldd $_ };
     920  }
     921
     922  # Get the list of libs provided by this package.  Still doesn't
     923  # handle the case where the lib gets stuffed into a subpackage.  :/
     924  my @intprovlist = qx { find $pkgtree -type f -name "*.so*" };
     925  my $provlist = '';
     926  foreach (@intprovlist) {
     927    s/$pkgtree//;
     928    $provlist .= "$_";
     929  }
    922930
    923931  my %reqs;
     
    926934  foreach (@reqlist) {
    927935    next if /^$pkgtree/;
    928     next if m|/lib/ld-linux.so|;
    929     my ($req) = (/^\s+([a-z0-9._-]+)/);
     936    next if m|/lib/ld-linux.so|;        # Hack! Hack!  PTHBTT!  (libc suxx0rz)
     937
     938    my ($req) = (/^\s+([a-z0-9._-]+)/); # dig out the actual library (so)name
     939
     940    # Ignore libs provided by this package.  Note that we don't match
     941    # on word-boundary at the *end* of the lib we're looking for, as the
     942    # looked-for lib may not have the full soname version. (ie, it may
     943    # "just" point to one of the symlinks that get created somewhere.)
     944    next if $provlist =~ /\b$req/;
    930945
    931946    $reqlibs .= " $req";
Note: See TracChangeset for help on using the changeset viewer.