source: trunk/dports/sysutils/rpm/files/patch-autodeps-darwin-prov.diff @ 2713

Last change on this file since 2713 was 2713, checked in by ranger, 17 years ago

Bug: 604
Submitted by:
Reviewed by: ssen@…
Approved by:
Obtained from:
Changes to handle a number of packaging bits work better.

  1. added python module support, so that yum (and maybe others) can be built
  2. added support for generating provides and depends for libraries and other binaries. frameworks show up as just the framework name without paths in the provides/requires lists.
  3. added support for a "fat" architecture, that is allowed to be installed on both i386 and ppc. it can be enabled by setting the BuildArch to "fat" and making sure compilation has fat linking enabled.
  • Property svn:eol-style set to native
File size: 1.2 KB
  • new file autodeps/darwin.prov

    - +  
     1#!/usr/bin/perl
     2# ----------------------------------------------------------
     3#       find-provides for Darwin
     4# ----------------------------------------------------------
     5
     6my %files;
     7
     8while (my $FILE = <STDIN>) {
     9        chomp $FILE;
     10
     11        next if (-d $FILE);
     12
     13        next if ($FILE =~ m,\.class$,);
     14
     15        for my $ARCH ('ppc', 'i386') {
     16                my $header;
     17                my $FILE_esc = $FILE;
     18                $FILE_esc =~ s/\'/\\\'/g;
     19                if (open(OTOOL, "otool -arch '$ARCH' -hv '$FILE_esc' 2>/dev/null |")) {
     20                        while (<OTOOL>) {
     21                                if (/MH_MAGIC/) {
     22                                                $header = $_;
     23                                }
     24                        }
     25                        close(OTOOL);
     26                        if (split(/\s+/, $header) and $_[4] eq 'DYLIB') {
     27                                if (open(OTOOL, "otool -arch '$ARCH' -D '$FILE_esc' 2>/dev/null |")) {
     28                                        <OTOOL>;
     29                                        chomp($FILE = <OTOOL>);
     30                                        if ($FILE =~ m,\.framework/,) {
     31                                                $FILE =~ s,^.*?/([^/]*?\.framework)/.*$,$1,;
     32                                        }
     33                                        $files{"$FILE-$ARCH"} = 1;
     34                                } else {
     35                                        warn "couldn't determine install_name for '$FILE': $!\n";
     36                                }
     37                        }
     38                } else {
     39                        warn "unable to run otool on $FILE: $!\n";
     40                        next;
     41                }
     42        }
     43}
     44
     45print join("\n", sort keys %files), "\n";
Note: See TracBrowser for help on using the repository browser.