]> git.donarmstrong.com Git - debhelper.git/blob - dh_scrollkeeper
r1968: * dh_fixperms: Make all files in /usr/include 644, not only .h files.
[debhelper.git] / dh_scrollkeeper
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_scrollkeeper - generate ScrollKeeper registration scripts
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_scrollkeeper> [S<I<debhelper options>>] [B<-n>] [S<I<directory>>]
15
16 =head1 DESCRIPTION
17
18 B<dh_scrollkeeper> is a debhelper program that handles correctly
19 registering OMF files that it finds in package build trees with
20 ScrollKeeper.
21
22 This command automatically adds maintainer script snippets for registering
23 and unregistering files with ScrollKeeper (unless B<-n> is used). These
24 snippets are inserted into the maintainer scripts by dh_installdeb. See
25 L<dh_installdeb(1)> for an explanation of Debhelper maintainer script
26 snippets.
27
28 It will also change any DTD declarations in the OMF and DocBook files
29 to refer to local files instead of remote URLs. This change does not
30 modify the source files, but the files in the package build tree.
31
32 =head1 OPTIONS
33
34 =over 4
35
36 =item B<-n>, B<--noscripts>
37
38 Do not modify F<postinst>/F<postrm> scripts.
39
40 =back
41
42 =head1 NOTES
43
44 Note that this command is not idempotent. "dh_clean -k" should be
45 called between invocations of this command. Otherwise, it may cause
46 multiple instances of the same text to be added to maintainer scripts.
47
48 =cut
49
50 init();
51
52 # This is a list of paths where DocBook files might be stored.
53 my @xml_paths = (
54         'usr/share/gnome/help' # GNOME Help
55 );
56
57 # Append the remaining command line arguments
58 push @xml_paths, @ARGV if @ARGV;
59
60 foreach my $package (@{$dh{DOPACKAGES}}) {
61         my $tmp=tmpdir($package);
62         
63         # Only run if there have been OMF files installed
64         if (-d "$tmp/usr/share/omf") {
65                 # Get a list of the OMF files
66                 my @omf_files = `find $tmp/usr/share/omf -type f -printf '%p\n'`;
67                 if (@omf_files) {
68                         if (! $dh{NOSCRIPTS}) {
69                                 autoscript($package,"postinst","postinst-scrollkeeper");
70                                 autoscript($package,"postrm","postrm-scrollkeeper");
71                         }
72                 }
73         }
74 }
75
76 =head1 SEE ALSO
77
78 L<debhelper>
79
80 This program is a part of debhelper.
81
82 =head1 AUTHOR
83
84 Ross Burton <ross@burtonini.com>
85
86 =cut