diff options
author | joeyh <joeyh> | 2006-02-23 16:51:33 +0000 |
---|---|---|
committer | joeyh <joeyh> | 2006-02-23 16:51:33 +0000 |
commit | 51c3322ebaed2029aab342f10b759e982e05668f (patch) | |
tree | 258cc3efa35b9117b7b04bb3d4aef997549ac6cc | |
parent | d6cc1db4d09238ed419b8f5c61110b6a752972d7 (diff) | |
download | debhelper-51c3322ebaed2029aab342f10b759e982e05668f.tar.gz |
r1881: * Add dh_installudev by Marco d'Itri.
-rw-r--r-- | autoscripts/postinst-udev | 3 | ||||
-rw-r--r-- | autoscripts/postrm-udev | 4 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/copyright | 3 | ||||
-rwxr-xr-x | dh_installudev | 100 |
5 files changed, 115 insertions, 1 deletions
diff --git a/autoscripts/postinst-udev b/autoscripts/postinst-udev new file mode 100644 index 00000000..e73cb010 --- /dev/null +++ b/autoscripts/postinst-udev @@ -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 index 00000000..15779ca6 --- /dev/null +++ b/autoscripts/postrm-udev @@ -0,0 +1,4 @@ +if [ "$1" = purge ]; then + [ -L /etc/udev/rules.d/#PRIO##FILE# ] && \ + rm /etc/udev/rules.d/#PRIO##FILE# +fi diff --git a/debian/changelog b/debian/changelog index b8c08d2b..24666c05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/debian/copyright b/debian/copyright index 632397a3..889a7e2f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -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 index 00000000..696543f1 --- /dev/null +++ b/dh_installudev @@ -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 |