- Timestamp:
- 02/16/06 12:13:40 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r35 r36 14 14 use warnings; 15 15 use Fcntl; # for sysopen flags 16 use Cwd 'abs_path'; # for finding where files really are 16 17 17 18 # regex debugger … … 749 750 # a "source package" is seriously flawed IMO, because you can't 750 751 # easily copy it as-is. 752 # Not quite identical to RPM, but Good Enough (TM). 751 753 sub srcpackage { 754 my $pkgsrcname = "$pkgdata{main}{name}-$pkgdata{main}{version}-$pkgdata{main}{release}.sdeb"; 755 756 my $paxcmd; 757 758 # We'll definitely need this later, and *may* need it sooner. 759 (my $barespec = $specfile) =~ s|.+/([^/]+)$|$1|; 760 761 # Copy the specfile to the build tree, but only if it's not there already. 762 ##buglet: need to deal with silly case where silly user has put the spec 763 # file in a subdir of %{_topdir}/SPECS. Ewww. Silly user! 764 if (abs_path($specfile) !~ /^$topdir\/SPECS/) { 765 $paxcmd .= "cp $specfile %{_topdir}/SPECS/; \n" 766 } 767 752 768 # use pax -w [file] [file] ... >outfile.sdeb 753 my $paxcmd = "cd %{_topdir}; pax -w ";769 $paxcmd = "cd $topdir; pax -w "; 754 770 755 771 # tweak source entry into usable form. Need it locally somewhere along the line. 756 772 (my $pkgsrc = $pkgdata{main}{source}) =~ s|.+/([^/]+)$|$1|; 757 $paxcmd .= " $pkgsrc ";773 $paxcmd .= "SOURCES/$pkgsrc "; 758 774 759 775 # create file list: Source[nn], Patch[nn] 760 776 foreach my $specbit (keys %{$pkgdata{main}} ) { 761 777 next if $specbit eq 'source'; 762 $paxcmd .= "$pkgdata{main}{$specbit} " if $specbit =~ /^(source|patch)/; 778 $paxcmd .= "SOURCES/$pkgdata{main}{$specbit} " if $specbit =~ /^(source|patch)/; 779 ##buglet: need to deal with case where patches are listed as URLs? 780 # or other extended pathnames? Silly !@$%^&!%%!%!! user! 763 781 } 764 782 765 # add the spec file now 766 $paxcmd .= "$specfile > SDEBS/$pkgdata{main}{name}.sdeb"; 767 783 # add the spec file, source package destination, and cd back where we came from. 784 $paxcmd .= "SPECS/$barespec > $topdir/SDEBS/$pkgsrcname; cd -"; 785 786 # In case of %-macros... 768 787 $paxcmd = expandmacros($paxcmd,'gp'); 769 788 770 print "$paxcmd\n"; 789 system "$paxcmd"; 790 print "Wrote source package $pkgsrcname in $topdir/SDEBS.\n"; 771 791 } 772 792
Note:
See TracChangeset
for help on using the changeset viewer.