X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_installcatalogs;h=b3aaf5e6dca86a0232f919c3123f725721df8266;hb=18a0da8092ea9f3dc48bca92b36f592af25a608d;hp=510a2bb316918a3382150ddd1de8d2a3adb36acc;hpb=0dbdf93cb69c3336da3ffac4db50092ca982ff07;p=debhelper.git diff --git a/dh_installcatalogs b/dh_installcatalogs index 510a2bb..b3aaf5e 100755 --- a/dh_installcatalogs +++ b/dh_installcatalogs @@ -9,7 +9,7 @@ dh_installcatalogs - install and register SGML Catalogs use strict; use Debian::Debhelper::Dh_Lib; -my $sgmlbasever = "1.17"; +my $sgmlbasever = "1.26+nmu2"; =head1 SYNOPSIS @@ -17,28 +17,35 @@ B [S>] [B<-n>] =head1 DESCRIPTION -dh_installcatalogs is a debhelper program that installs and +B is a debhelper program that installs and registers SGML catalogs. It complies with the Debian XML/SGML policy. -The file F.sgmlcatalogs> contains the catalogs to be -installed per package. Each line in that file should be of the form -C, where C indicates where the catalog resides in -the source tree, and C indicates the destination location for -the catalog under the package build area. C should start with -F. - Catalogs will be registered in a supercatalog, in F.cat>. This command automatically adds maintainer script snippets for -registering and unregistering the catalogs and "supercatalogs" (unless +registering and unregistering the catalogs and supercatalogs (unless B<-n> is used). These snippets are inserted into the maintainer scripts -by dh_installdeb; see L for an explanation of +by B; see L for an explanation of Debhelper maintainer script snippets. -A dependency on B will be added to C<${misc:Depends}>, so be +A dependency on B will be added to B<${misc:Depends}>, so be sure your package uses that variable in F. +=head1 FILES + +=over 4 + +=item debian/I.sgmlcatalogs + +Lists the catalogs to be installed per package. Each line in that file +should be of the form C I>, where I indicates where the +catalog resides in the source tree, and I indicates the destination +location for the catalog under the package build area. I should +start with F. + +=back + =head1 OPTIONS =over 4 @@ -89,12 +96,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("install","-d","-m755","$tmpdir/etc/sgml"); } + my $centralcat = "/etc/sgml/$package.cat"; + + open(CENTRALCAT, ">", "$tmpdir$centralcat") || error("failed to write to $tmpdir$centralcat"); + foreach my $sgmldest (@sgmlinstalled) { + print CENTRALCAT "CATALOG " . $sgmldest . "\n"; + } + close CENTRALCAT; + if (! $dh{NOSCRIPTS}) { - my $ordcats = join(" ", @sgmlinstalled); - my $centralcat = "/etc/sgml/$package.cat"; - autoscript($package, "postinst", "postinst-sgmlcatalog", - "s%#CENTRALCAT#%$centralcat%g; s%#ORDCATS#%$ordcats%g;"); - autoscript($package, "prerm", "prerm-sgmlcatalog", + autoscript($package, "preinst", "preinst-sgmlcatalog", "s%#CENTRALCAT#%$centralcat%g;"); autoscript($package, "postrm", "postrm-sgmlcatalog", "s%#CENTRALCAT#%$centralcat%g;");