r41056 - /website/debhelper.pod

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Fri Jul 31 03:19:45 UTC 2009


Author: jawnsy-guest
Date: Fri Jul 31 03:19:38 2009
New Revision: 41056

URL: http://svn.debian.org/wsvn/?sc=1&rev=41056
Log:
Added notes on working with files and how to remove a directory from installation.

Modified:
    website/debhelper.pod

Modified: website/debhelper.pod
URL: http://svn.debian.org/wsvn/website/debhelper.pod?rev=41056&op=diff
==============================================================================
--- website/debhelper.pod (original)
+++ website/debhelper.pod Fri Jul 31 03:19:38 2009
@@ -78,7 +78,9 @@
 
 =head1 Arcane Uses
 
-=head2 Removing A File
+=head2 Removing Something
+
+=head3 A File
 
 If for some reason you're not able to distribute a file, then you'll need
 to repack it. But if it's just causing issues like warnings with lintian
@@ -89,7 +91,24 @@
 
 <pre>override_dh_auto_install:
 &#09;dh_auto_install
-&#09;rm debian/$(shell dh_listpackages)/usr/share/perl5/Data/Format/._HTML.pm
+&#09;rm $(TMP)/usr/share/perl5/Data/Format/._HTML.pm
+</pre>
+
+=end html
+
+This requires support for overrides, introduced in B<debhelper 7.0.50>
+
+=head3 A Directory
+
+Sometimes you want to remove an entire directory post-install. You can do
+that too, but it usually helps to have some extra tests so that the 'rm'
+operation doesn't make too much noise.
+
+=begin html
+
+<pre>override_dh_auto_install:
+&#09;dh_auto_install
+&#09;rmdir --ignore-fail-on-non-empty --parents --verbose $(TMP)/usr/lib/perl5
 </pre>
 
 =end html
@@ -105,12 +124,31 @@
 
 <pre>override_dh_fixperms:
 &#09;dh_fixperms
-&#09;chmod 644 $(CURDIR)/debian/package-name/usr/share/path/to/file
+&#09;chmod 644 $(TMP)/usr/share/path/to/file
 </pre>
 
 =end html
 
 Using overrides requires B<debhelper 7.0.50>
+
+=head2 Note on Paths
+
+In order to save on typing, be a bit lazy and improve a little bit on
+maintainability and readability of the file, the following variables are
+typically placed at the top of your B<rules> file when there are some file
+operations involved.
+
+=begin html
+
+<pre>PACKAGE = $(shell dh_listpackages)
+TMP = $(CURDIR)/debian/$(PACKAGE)
+</pre>
+
+=end html
+
+Then any of your paths become pretty trivial, you can specify them as:
+B<($TMP)/usr/share/path/to/file>. Otherwise, you can accomplish the same
+thing with: B<$(CURDIR)/debian/package-name/usr/share/path/to/file>
 
 =head2 Module::Install 0.85
 




More information about the Pkg-perl-cvs-commits mailing list