Changeset 8


Ignore:
Timestamp:
11/01/05 18:07:43 (19 years ago)
Author:
kdeugau
Message:

/trunk

Checkpoint.
build binary package should be complete.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r7 r8  
    272272    if (/^\%/) {
    273273      # A macro that needs further processing.
     274      if (/^\%description/) {
     275        $pkgdata{main}{desc} .= $_;
     276        while (<SPECFILE>) {
     277          redo LINE if /^\%/;
     278          $pkgdata{main}{desc} .= " $_";
     279        }
     280
     281      }
    274282      if (/^\%prep/) {
    275283        # %prep section.  May have %setup macro;  may include %patch tags,
     
    396404  $scriptletbase =~ s/\%\{release\}/$pkgdata{main}{release}/g;
    397405
     406# Some more macro substitution.  Nrgh.
     407  $buildroot =~ s/\%\{name\}/$pkgdata{main}{name}/g;
     408  $buildroot =~ s/\%\{version\}/$pkgdata{main}{version}/g;
     409  $buildroot =~ s/\%\{release\}/$pkgdata{main}{release}/g;
    398410} # end parse_spec()
    399411
     
    468480
    469481
    470 sub binpackage {}
     482## binpackage()
     483# Creates the binary .deb package from the installed tree in $buildroot.
     484sub binpackage {
     485  # Gotta do this first, otherwise the control file has nowhere to go.  >:(
     486eval {
     487  mkdir "$buildroot/DEBIAN";
     488};
     489die $@ if $@;
     490
     491  # create script filename
     492  my $debscriptfile = "/var/tmp/deb-tmp.pkg.".int(rand(99998)+1);
     493  sysopen(DEBSCRIPT, $debscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW)
     494        or die $!;
     495  print DEBSCRIPT $scriptletbase;
     496  print DEBSCRIPT "tree $buildroot\n".
     497        "mkdir $topdir/DEBS/i386\n".
     498        "dpkg-deb -b $buildroot $topdir/DEBS/i386/$pkgdata{main}{name}_$pkgdata{main}{version}-$pkgdata{main}{release}_i386.deb\n";
     499
     500  close DEBSCRIPT;
     501
     502  my $control = "Package: $pkgdata{main}{name}\n".
     503        "Version: $pkgdata{main}{version}-$pkgdata{main}{release}\n".
     504        "Section: unknown\n".
     505        "Priority: optional\n".
     506        "Architecture: i386\n".
     507        "Maintainer: $pkgdata{main}{packager}\n".
     508        "Description: $pkgdata{main}{desc}\n";
     509
     510eval {
     511  open CONTROL, ">$buildroot/DEBIAN/control";
     512  print CONTROL $control;
     513  close CONTROL;
     514};
     515if ($@) {
     516  print $@;
     517}
     518
     519#Package: httpd
     520#Version: 2.0.54-7via
     521#Section: unknown
     522#Priority: optional
     523#Architecture: i386
     524#Depends: libc6 (>= 2.3.2.ds1-21), libdb4.2, libexpat1 (>= 1.95.8), libssl0.9.7, libapr0
     525#Replaces: apache2
     526#Installed-Size: 3076
     527#Maintainer: Kris Deugau <kdeugau@vianet.ca>
     528#Description: apache2 for ViaNet
     529# apache2 for ViaNet.  Includes per-vhost setuid patches from
     530# http://home.samfundet.no/~sesse/mpm-itk/.
     531
     532
     533  # execute
     534  print "Creating .deb for $pkgdata{main}{name}...\n";
     535  system("/bin/sh -e $debscriptfile") == 0
     536        or die "Can't exec: $!\nalso: $?";
     537
     538  # and clean up
     539  unlink $debscriptfile;
     540
     541} # end binpackage()
     542
     543
    471544sub srcpackage {}
Note: See TracChangeset for help on using the changeset viewer.