- Timestamp:
- 11/09/05 16:41:04 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r15 r16 99 99 my $installscript; 100 100 my $cleanscript; 101 # pre/post (un)install scripts. Note that these will likely barf as-is. :/ 102 my $preinstscript = ''; 103 my $postinstscript = ''; 104 my $preuninstscript = ''; 105 my $postuninstscript = ''; 101 106 102 107 die "Not enough arguments\n" if #$argv == 0; … … 381 386 $cleanscript = expandmacros($cleanscript,'gp'); 382 387 } 383 if (/^\%post/) { 384 } 385 if (/^\%preun/) { 388 # pre/post (un)install scripts 389 if (/^\%pre\b/) { 390 while (<SPECFILE>) { 391 redo LINE if /^\%/; 392 $preinstscript .= $_; 393 } 394 } 395 if (/^\%post\b/) { 396 while (<SPECFILE>) { 397 redo LINE if /^\%/; 398 $postinstscript .= $_; 399 } 400 } 401 if (/^\%preun\b/) { 402 while (<SPECFILE>) { 403 redo LINE if /^\%/; 404 $preuninstscript .= $_; 405 } 406 } 407 if (/^\%postun\b/) { 408 while (<SPECFILE>) { 409 redo LINE if /^\%/; 410 $postuninstscript .= $_; 411 } 386 412 } 387 413 if (/^\%files/) { … … 439 465 $buildroot = expandmacros($buildroot,'gp'); 440 466 467 close SPECFILE; 441 468 } # end parse_spec() 442 469 … … 534 561 or die $!; 535 562 print DEBSCRIPT $scriptletbase; 536 print DEBSCRIPT " tree $buildroot\n".537 " fakeroot dpkg-deb -b $buildroot $topdir/DEBS/i386/$pkgdata{main}{name}_$pkgdata{main}{version}-$pkgdata{main}{release}_i386.deb\n";563 print DEBSCRIPT "fakeroot dpkg-deb -b $buildroot $topdir/DEBS/i386/". 564 "$pkgdata{main}{name}_$pkgdata{main}{version}-$pkgdata{main}{release}_i386.deb\n"; 538 565 # %$&$%@#@@#%@@@ Debian and their horrible ugly package names. >:( 539 566 close DEBSCRIPT; … … 550 577 print CONTROL $control; 551 578 close CONTROL; 579 580 if ($preinstscript ne '') { 581 open PREINST, ">$buildroot/DEBIAN/preinst"; 582 print PREINST "#!/bin/sh\nset -e\n\n"; 583 print PREINST $preinstscript; 584 close PREINST; 585 `chmod 0755 $buildroot/DEBIAN/preinst`; 586 } 587 if ($postinstscript ne '') { 588 open POSTINST, ">$buildroot/DEBIAN/postinst"; 589 print POSTINST "#!/bin/sh\nset -e\n\n"; 590 print POSTINST $postinstscript; 591 close POSTINST; 592 `chmod 0755 $buildroot/DEBIAN/postinst`; 593 } 594 if ($preuninstscript ne '') { 595 open PREUNINST, ">$buildroot/DEBIAN/prerm"; 596 print PREUNINST "#!/bin/sh\nset -e\n\n"; 597 print PREUNINST $preuninstscript; 598 close PREUNINST; 599 `chmod 0755 $buildroot/DEBIAN/prerm`; 600 } 601 if ($postuninstscript ne '') { 602 open POSTUNINST, ">$buildroot/DEBIAN/postrm"; 603 print POSTUNINST "#!/bin/sh\nset -e\n\n"; 604 print POSTUNINST $postuninstscript; 605 close POSTUNINST; 606 `chmod 0755 $buildroot/DEBIAN/postrm`; 607 } 608 609 print `ls -l $buildroot/DEBIAN`; 552 610 553 611 #Package: httpd … … 565 623 566 624 # execute 567 print "C reating .debfor $pkgdata{main}{name}...\n";625 print "Calling package creation script $debscriptfile for $pkgdata{main}{name}...\n"; 568 626 system("/bin/sh -e $debscriptfile") == 0 569 627 or die "Can't exec: $!\n";
Note:
See TracChangeset
for help on using the changeset viewer.