#!/usr/bin/perl -w =head1 NAME dh_monoaot - generates AOT images for assemblies =cut use strict; use File::Find; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-n>] =head1 DESCRIPTION dh_monoaot is a debhelper program that is responsible for generating AOT images at package install time. It also automatically generates the postinst and prerm commands needed to generate AOT images. See L for an explanation of how this works. This is based on L in the cli-common package. =head1 OPTIONS =over 4 =item B<-n>, B<--noscripts> Do not modify postinst/prerm scripts. =back =head1 NOTES Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. =cut init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my $monoaot = pkgfile($package, "installmonoaot"); if ($monoaot ne '') { # sanity check: do all files listed in the installcligac file exist? open MONOAOT, "<$monoaot" or die "E: Can't open $monoaot\n"; while () { chomp; if (! -f "$tmp$_") { die "E: Can't find file $tmp$_!\n"; } } close MONOAOT; if (! $dh{NOSCRIPTS}) { open MONOAOT, "<$monoaot" or die "E: Can't open $monoaot\n"; while () { chomp; foreach my $file ($_) { autoscript($package, "postinst", "postinst-monoaot", "s!#FILE#!$file!g"); autoscript($package, "prerm", "prerm-monoaot", "s!#FILE#!$file.so!"); } } close MONOAOT; } } } =head1 SEE ALSO L This program is a part of cli-common-dev. =head1 AUTHOR Mirco 'meebey' Bauer Jo Shields =cut