5 dh_installudev - install udev rules files
10 use Debian::Debhelper::Dh_Lib;
15 B<dh_installudev> [S<I<debhelper options>>] [B<-n>] [B<--name=>I<name>] [B<--priority=>I<priority>]
19 dh_installudev is a debhelper program that is responsible for
20 installing udev rules files.
22 Files named debian/package.udev will be installed in
23 etc/udev/rules.d/ in the package build directory.
25 Code is added to the preinst and postinst to handle the upgrade from the
26 old udev rules file location.
32 =item B<--name=>I<name>
34 When this parameter is used, dh_installudev looks for and
35 installs files named debian/package.name.udev instead of the usual
38 =item B<--priority=>I<priority>
40 Sets the priority string of the rules.d symlink. Default is z60.
42 =item B<-n>, B<--noscripts>
44 Do not modify postinst/postrm scripts.
50 Note that this command is not idempotent. L<dh_prep(1)> should be called
51 between invocations of this command. Otherwise, it may cause multiple
52 instances of the same text to be added to maintainer scripts.
58 if (! defined $dh{PRIORITY}) {
65 foreach my $package (@{$dh{DOPACKAGES}}) {
66 my $tmp=tmpdir($package);
67 my $rules_file=pkgfile($package,"udev");
68 my $filename=basename($rules_file);
69 if ($filename eq 'udev') {
70 $filename = "$package.udev";
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/rules.d/$dh{PRIORITY}$filename");
79 if (! $dh{NOSCRIPTS}) {
80 my $old="/etc/udev/$filename";
81 my $rule="/etc/udev/rules.d/$dh{PRIORITY}$filename";
82 autoscript($package,"preinst","preinst-udev","s!#OLD#!$old!g;s!#RULE#!$rule!g;s!#PACKAGE#!$package!g");
83 autoscript($package,"postinst","postinst-udev","s!#OLD#!$old!g;s!#RULE#!$rule!g");
92 This program is a part of debhelper.
96 Joey Hess <joeyh@debian.org>