summaryrefslogtreecommitdiff
path: root/dh_installdocs
diff options
context:
space:
mode:
authorjoey <joey>1999-09-06 05:47:41 +0000
committerjoey <joey>1999-09-06 05:47:41 +0000
commit37c69d4e7124fb03edf46bea4eb38f6721f2aa2a (patch)
tree2ab81f9330d3cb5b01d3600ec41d1f1988b17f68 /dh_installdocs
parentda7d6c32c080678dc672f7c6e680c11569f46eda (diff)
r266: * FHS complience. Patch from Johnie Ingram <johnie@netgod.net>.
For the most part, this was a straight-forward substitution, dh_installmanpages needed a non-obvious change though. * Closes: #42489, #42587, #41732. * dh_installdocs: Adds code to postinst and prerm as specified in http://www.debian.org/Lists-Archives/debian-ctte-9908/msg00038.html, to make /usr/doc/<package> a compatability symlink to /usr/share/doc/<package>. Note that currently if something exists in /usr/doc/<package> when the postinst is run, it will silently not make the symlink. I'm considering more intellingent handing of this case. * Note that if you build a package with this version of debhelper, it will use /usr/share/man, /usr/share/doc, and /usr/share/info. You may need to modify other files in your package that reference the old locations.
Diffstat (limited to 'dh_installdocs')
-rwxr-xr-xdh_installdocs36
1 files changed, 26 insertions, 10 deletions
diff --git a/dh_installdocs b/dh_installdocs
index 20862bf..d6c11c8 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -1,6 +1,7 @@
#!/usr/bin/perl -w
#
-# Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE
+# Reads debian/docs, installs all files listed there into
+# /usr/share/doc/$PACKAGE
# Also installs the debian/copyright and debian/README.debian and debian/TODO
# and handles debian/doc-base.
@@ -12,8 +13,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$TMP=tmpdir($PACKAGE);
$file=pkgfile($PACKAGE,"docs");
- if ( ! -d "$TMP/usr/doc/$PACKAGE") {
- doit("install","-d","$TMP/usr/doc/$PACKAGE");
+ if ( ! -d "$TMP/usr/share/doc/$PACKAGE") {
+ doit("install","-d","$TMP/usr/share/doc/$PACKAGE");
}
undef @docs;
@@ -27,9 +28,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
}
if (@docs) {
- doit("cp","-a",@docs,"$TMP/usr/doc/$PACKAGE/");
- doit("chmod","-R","go=rX","$TMP/usr/doc");
- doit("chmod","-R","u+rw","$TMP/usr/doc");
+ doit("cp","-a",@docs,"$TMP/usr/share/doc/$PACKAGE/");
+ doit("chmod","-R","go=rX","$TMP/usr/share/doc");
+ doit("chmod","-R","u+rw","$TMP/usr/share/doc");
}
# .Debian is correct, according to policy, but I'm easy.
@@ -38,16 +39,19 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$readme_debian=pkgfile($PACKAGE,'README.debian');
}
if ($readme_debian) {
- doit("install","-m","644","-p","$readme_debian","$TMP/usr/doc/$PACKAGE/README.Debian");
+ doit("install","-m","644","-p","$readme_debian",
+ "$TMP/usr/share/doc/$PACKAGE/README.Debian");
}
$todo=pkgfile($PACKAGE,'TODO');
if ($todo) {
if (isnative($PACKAGE)) {
- doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO");
+ doit("install","-m","644","-p",$todo,
+ "$TMP/usr/share/doc/$PACKAGE/TODO");
}
else {
- doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO.Debian");
+ doit("install","-m","644","-p",$todo,
+ "$TMP/usr/share/doc/$PACKAGE/TODO.Debian");
}
}
@@ -59,7 +63,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$copyright="debian/copyright";
}
if ($copyright) {
- doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright");
+ doit("install","-m","644","-p",$copyright,
+ "$TMP/usr/share/doc/$PACKAGE/copyright");
}
# Handle doc-base files. There are two filename formats, the usual
@@ -104,4 +109,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
);
}
}
+
+
+ # Add in the /usr/doc compatability symlinks code.
+ if (! $dh{NOSCRIPTS}) {
+ autoscript($PACKAGE,"postinst","postinst-doc",
+ "s/#PACKAGE#/$PACKAGE/g",
+ );
+ autoscript($PACKAGE,"prerm","prerm-doc",
+ "s/#PACKAGE#/$PACKAGE/g",
+ );
+ }
}