#!/usr/bin/perl

use strict;
use warnings;

use Debian::Debhelper::Dh_Lib;

=head1 NAME

dh_perl6_maintscript -- create postinst/post scripts for perl 6 module packages

=head1 SYNOPSIS

B<dh_perl6_maintscript>

=head1 DESCRIPTION

This script will create postinst and postrm snippets that call rakudo-helper.pl 
from the rakudo package, which is required by perl 6 module packages to create 
and remove precompilation files.

=head1 SEE ALSO

L<dh_perl6_depsfile>(1), L<dh_perl6_test>(1), L<debhelper>(7), L<dh>(1)

=cut

init();

foreach my $package (@{$dh{DOPACKAGES}}) {
    # create the postinst/postrm to call rakudo-helper.pl
    foreach my $script_type (qw/postinst postrm/) {
        autoscript($package, "$script_type", "$script_type-perl6", "s/#PACKAGE#/$package/");
    }
}

