5 dh_installudev - install udev rules files
11 use Debian::Debhelper::Dh_Lib;
16 B<dh_installudev> [S<I<debhelper options>>] [B<-n>] [B<--name=>I<name>] [B<--priority=>I<priority>]
20 dh_installudev is a debhelper program that is responsible for
21 installing udev rules files.
23 Files named debian/package.udev will be installed as
24 etc/udev/package.rules in the package build directory.
26 Then postinst and postrm commands are automatically generated to enable
27 the rules file when the package is first installed, by creating a symlink
28 to it in the /etc/udev/rules.d/ directory. See L<dh_installdeb(1)> for an
29 explanation of how this works.
35 =item B<-n>, B<--noscripts>
37 Do not modify postinst/postrm scripts.
39 =item B<--name=>I<name>
41 When this parameter is used, dh_installudev looks for and
42 installs files named debian/package.name.udev instead of the usual
45 =item B<--priority=>I<priority>
47 Sets the priority string of the rules.d symlink. Default is z60.
53 Note that this command is not idempotent. "dh_clean -k" should be called
54 between invocations of this command. Otherwise, it may cause multiple
55 instances of the same text to be added to maintainer scripts.
61 if (! defined $dh{PRIORITY}) {
68 foreach my $package (@{$dh{DOPACKAGES}}) {
69 my $tmp=tmpdir($package);
70 my $rules_file=pkgfile($package,"udev");
71 my $filename=basename($rules_file);
72 $filename=~s/\.udev$/.rules/;
75 if (! -e "$tmp/etc/udev/rules.d") {
76 doit("install","-d","$tmp/etc/udev/rules.d");
78 doit("install","-m","0644",$rules_file,"$tmp/etc/udev/$filename");
80 if (! $dh{NOSCRIPTS}) {
81 autoscript($package,"postinst","postinst-udev",
82 "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
83 autoscript($package,"postrm","postrm-udev",
84 "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
93 This program is a part of debhelper.
97 Joey Hess <joeyh@debian.org>