]> git.donarmstrong.com Git - debhelper.git/blob - dh_scrollkeeper
r1695: * dh_gconf: gconf schemas moved to /usr/share/gconf/schemas. Relocate
[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). See
24 L<dh_installdeb(1)> for an explantion of Debhelper maintainer script
25 snippets.
26
27 It will also change any DTD declarations in the OMF and DocBook files
28 to refer to local files instead of remote URLs. This change does not
29 modify the source files, but the files in the package build tree.
30
31 =head1 OPTIONS
32
33 =over 4
34
35 =item B<-n>, B<--noscripts>
36
37 Do not modify F<postinst>/F<postrm> scripts.
38
39 =back
40
41 =head1 NOTES
42
43 Note that this command is not idempotent. "dh_clean -k" should be
44 called between invocations of this command. Otherwise, it may cause
45 multiple instances of the same text to be added to maintainer scripts.
46
47 =cut
48
49 init();
50
51 # This is a list of paths where DocBook files might be stored.
52 my @xml_paths = (
53         'usr/share/gnome/help' # GNOME Help
54 );
55
56 # Append the remaining command line arguments
57 push @xml_paths, @ARGV if @ARGV;
58
59 foreach my $package (@{$dh{DOPACKAGES}}) {
60         my $tmp=tmpdir($package);
61         
62         # Only run if there have been OMF files installed
63         if (-d "$tmp/usr/share/omf") {
64                 # Get a list of the OMF files
65                 my @omf_files = `find $tmp/usr/share/omf -type f -printf '%p\n'`;
66                 if (@omf_files) {
67                         if (! $dh{NOSCRIPTS}) {
68                                 autoscript($package,"postinst","postinst-scrollkeeper");
69                                 autoscript($package,"postrm","postrm-scrollkeeper");
70                         }
71                 }
72         }
73 }
74
75 =head1 SEE ALSO
76
77 L<debhelper>
78
79 This program is a part of debhelper.
80
81 =head1 AUTHOR
82
83 Ross Burton <ross@burtonini.com>
84
85 =cut