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 Use "name" as the filename the rules file is installed in
42 /etc/udev/. When this parameter is used, dh_installudev looks for and
43 installs files named debian/package.name.udev instead of the usual
46 =item B<--priority=>I<priority>
48 Sets the priority string of the rules.d symlink. Default is z60.
54 Note that this command is not idempotent. "dh_clean -k" should be called
55 between invocations of this command. Otherwise, it may cause multiple
56 instances of the same text to be added to maintainer scripts.
62 if (! defined $dh{PRIORITY}) {
69 foreach my $package (@{$dh{DOPACKAGES}}) {
70 my $tmp=tmpdir($package);
71 my $rules_file=pkgfile($package,"udev");
72 my $filename=basename($rules_file);
73 $filename=~s/\.udev$/.rules/;
76 if (! -e "$tmp/etc/udev") {
77 doit("install","-d","$tmp/etc/udev");
79 doit("install","-m","0644",$rules_file,"$tmp/etc/udev/$filename");
81 if (! $dh{NOSCRIPTS}) {
82 autoscript($package,"postinst","postinst-udev",
83 "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
84 autoscript($package,"postrm","postrm-udev",
85 "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
94 This program is a part of debhelper.
98 Joey Hess <joeyh@debian.org>