#!/usr/bin/perl -w =head1 NAME dh_apparmor - reload AppArmor profile and create local include =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B B<--profile-name=>I =head1 DESCRIPTION dh_apparmor is a debhelper program that will create/remove the /etc/apparmor.d/local/ include file in maintainer scripts. It also reloads the specified AppArmor profile in postinst using: =over 4 apparmor_parser -r -W -T /etc/apparmor.d/ =back By using '-W -T' we ensure that any abstraction updates are also pulled in. =head1 OPTIONS =over 4 =item B<--profile-name=> Specify the profile name. =back =head1 NOTES Note that for packages that have multiple binary packages, you will want to pass '-p' to dh_apparmor, otherwise dh_apparmor will add AppArmor reload commands for all packages rather than just the one that ships the profile. =cut init(options => { "profile-name=s" => \$dh{PROFILE_NAME}, }); foreach my $package (@{$dh{DOPACKAGES}}) { if (! $dh{PROFILE_NAME}) { error("Must specify --profile-name"); } my $pname = $dh{PROFILE_NAME}; autoscript($package,"postinst","postinst-apparmor","s/#PROFILE#/$pname/"); autoscript($package,"postrm","postrm-apparmor","s/#PROFILE#/$pname/"); } =head1 SEE ALSO L This program is a part of debhelper. =head1 AUTHOR Jamie Strandboge =cut