Changeset 30


Ignore:
Timestamp:
12/15/05 15:34:00 (19 years ago)
Author:
kdeugau
Message:

/trunk

checkpoint
%files support should be pretty much complete for basic cases

  • still needs processing for %dir, %attr, and %defattr
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r29 r30  
    2222# -> Parse/execute "user" config/macros (if any - *my* requirement is %_topdir)
    2323# -> Parse command line for options, spec file/tarball/.src.deb (NB - also accept .src.rpm)
     24
     25sub expandmacros;
    2426
    2527# User's prefs for dirs, environment, etc,etc,etc.
     
    145147if ($cmdopts{stage} =~ /[ilabs]/) {
    146148  install();
     149#foreach my $pkg (@pkglist) {
     150#  print "files in $pkg:\n ".$filelist{$pkg}."\n";
     151#}
     152
    147153}
    148154# -> binpkg and srcpkg if -.a
     
    412418          $cleanscript .= $_;
    413419        }
    414 print "before:\n$cleanscript\n";
    415420        $cleanscript = expandmacros($cleanscript,'gp');
    416 print "\nafter:\n$cleanscript\n";
    417 exit 0;
    418421      }
    419422
     
    458461
    459462          # and finally we can fall through %{_<FHS>}-prefixed locations...
    460           $filelist{$pkgname} .= " $_" if /^\%\{_/;
     463          if (/^\%\{_/) {
     464            $filelist{$pkgname} .= " $_";
     465            next;
     466          }
     467        # EW.  Necessary to clear up %define expansions before we exit with redo.
     468          $_ = expandmacros $_, 'g';
    461469
    462470          # ... unknown or "next section" % directives ...
     
    466474          $filelist{$pkgname} .= " $_";
    467475        }
     476        $filelist{$pkgname} = expandmacros($filelist{$pkgname}, 'g');
    468477      } # done %file section
    469478
     
    619628  # Make sure we have somewhere to write the .deb file
    620629  if (!-e "$topdir/DEBS/i386") {
    621 #       "if [ -e $topdir/DEBS/i386 ]; then\n\tmkdir $topdir/DEBS/i386\nfi\n".
    622630    mkdir "$topdir/DEBS/i386";
    623631  }
     
    628636    # Gotta do this first, otherwise we don't have a place to move files from %files
    629637    mkdir "$buildroot/$pkg";
     638
     639    # Eliminate any lingering % macros
     640    $filelist{$pkg} = expandmacros $filelist{$pkg}, 'g';
    630641
    631642    my @pkgfilelist = split ' ', $filelist{$pkg};
     
    828839    $macrostring =~ s'%{_docdir}'/usr/share/doc'g;
    829840
     841    # Standard FHS locations
     842    $macrostring =~ s'%{_bindir}'/usr/bin'g;
     843    $macrostring =~ s'%{_sbindir}'/usr/bin'g;
     844    $macrostring =~ s'%{_mandir}'/usr/share/man'g;
     845    $macrostring =~ s'%{_includedir}'/usr/include'g;
     846
    830847    # %define's
    831848    foreach my $key (keys %specglobals) {
Note: See TracChangeset for help on using the changeset viewer.