]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1881: * Add dh_installudev by Marco d'Itri.
authorjoeyh <joeyh>
Thu, 23 Feb 2006 16:51:33 +0000 (16:51 +0000)
committerjoeyh <joeyh>
Thu, 23 Feb 2006 16:51:33 +0000 (16:51 +0000)
autoscripts/postinst-udev [new file with mode: 0644]
autoscripts/postrm-udev [new file with mode: 0644]
debian/changelog
debian/copyright
dh_installudev [new file with mode: 0755]

diff --git a/autoscripts/postinst-udev b/autoscripts/postinst-udev
new file mode 100644 (file)
index 0000000..e73cb01
--- /dev/null
@@ -0,0 +1,3 @@
+if [ "$1" = configure -a -z "$2" ]; then
+       ln -s ../#FILE# /etc/udev/rules.d/#PRIO##FILE#
+fi
diff --git a/autoscripts/postrm-udev b/autoscripts/postrm-udev
new file mode 100644 (file)
index 0000000..15779ca
--- /dev/null
@@ -0,0 +1,4 @@
+if [ "$1" = purge ]; then
+       [ -L /etc/udev/rules.d/#PRIO##FILE# ] && \
+       rm /etc/udev/rules.d/#PRIO##FILE#
+fi
index b8c08d2b8eb48f9ce614f8a33cf1abb34332fdd6..24666c0540c6f0928dbde1f873aa39da82f8cb80 100644 (file)
@@ -1,3 +1,9 @@
+debhelper (5.0.24) unstable; urgency=low
+
+  * Add dh_installudev by Marco d'Itri.
+
+ -- Joey Hess <joeyh@debian.org>  Thu, 23 Feb 2006 11:40:22 -0500
+
 debhelper (5.0.23) unstable; urgency=low
 
   * dh_strip: remove binutils build-dep lines since stable has a new enough
index 632397a3818c2d9ba3846aaaef78fe802616a15c..889a7e2f25a5f0c6a4b6c98e6a82f2842e9fbc62 100644 (file)
@@ -1,4 +1,4 @@
-Debhelper is written by and copyright 1997-2005 Joey Hess <joeyh@debian.org>.
+Debhelper is written by and copyright 1997-2006 Joey Hess <joeyh@debian.org>.
 
 Increasingly miniscule parts of the code (and certainly my inspiration for the
 whole thing) came from debmake, by Christoph Lameter <clameter@debian.org>.
@@ -9,6 +9,7 @@ dh_installcatalogs is by Adam Di Carlo <aph@debian.org>.
 dh_scrollkeeper is by Ross Burton <ross@burtonini.com>.
 dh_usrlocal is by Andrew Stribblehill <ads@debian.org>.
 dh_installlogcheck is by Jon Middleton <jjm@debian.org>.
+dh_installudev is by Marco d'Itri <md@Linux.IT>.
 
 Some of the dh_md5sums command is from a program by Charles
 Briscoe-Smith <cpb4@ukc.ac.uk>.
diff --git a/dh_installudev b/dh_installudev
new file mode 100755 (executable)
index 0000000..696543f
--- /dev/null
@@ -0,0 +1,100 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_installudev - install udev rules files
+
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+use File::Find;
+
+=head1 SYNOPSIS
+
+B<dh_installudev> [S<I<debhelper options>>] [B<-n>] [B<--name=>I<name>] [B<--priority=>I<priority>]
+
+=head1 DESCRIPTION
+
+dh_installudev is a debhelper program that is responsible for
+installing udev rules files.
+
+Files named debian/package.udev will be installed as
+etc/udev/package.rules in the package build directory.
+
+Then postinst and postrm commands are automatically generated to enable
+the rules file when the package is first installed, by creating a symlink
+to it in the /etc/udev/rules.d/ directory. See L<dh_installdeb(1)> for an
+explanation of how this works.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-n>, B<--noscripts>
+
+Do not modify postinst/postrm scripts.
+
+=item B<--name=>I<name>
+
+Use "name" as the filename the rules file is installed in
+/etc/udev/. When this parameter is used, dh_installudev looks for and
+installs files named debian/package.name.udev instead of the usual
+debian/package.udev.
+
+=item B<--priority=>I<priority>
+
+Sets the priority string of the rules.d symlink. Default is z60.
+
+=back
+
+=head1 NOTES
+
+Note that this command is not idempotent. "dh_clean -k" should be called
+between invocations of this command. Otherwise, it may cause multiple
+instances of the same text to be added to maintainer scripts.
+
+=cut
+
+init();
+
+if (! defined $dh{PRIORITY}) {
+       $dh{PRIORITY}="z60";
+}
+if ($dh{PRIORITY}) {
+       $dh{PRIORITY}.="_";
+}
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+       my $tmp=tmpdir($package);
+       my $rules_file=pkgfile($package,"udev");
+       my $filename=basename($rules_file);
+       $filename=~s/\.udev$/.rules/;
+
+       if ($rules_file) {
+               if (! -e "$tmp/etc/udev") {
+                       doit("install","-d","$tmp/etc/udev");
+               }
+               doit("install","-m","0644",$rules_file,"$tmp/etc/udev/$filename");
+
+               if (! $dh{NOSCRIPTS}) {
+                       autoscript($package,"postinst","postinst-udev",
+                               "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
+                       autoscript($package,"postrm","postrm-udev",
+                               "s/#FILE#/$filename/g;s/#PRIO#/$dh{PRIORITY}/g");
+               }
+       }
+}
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is a part of debhelper.
+
+=head1 AUTHOR
+
+Joey Hess <joeyh@debian.org>
+
+=cut