]> git.donarmstrong.com Git - debhelper.git/blob - dh_ucf
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / dh_ucf
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_ucf - register configuration files with ucf 
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_ucf> [S<I<debhelper options>>] [B<-n>]
15
16 =head1 DESCRIPTION
17
18 B<dh_ucf> is a debhelper program that is responsible for generating the
19 F<postinst> and F<postrm> commands that register files with ucf(1) and ucfr(1).
20
21 =head1 FILES
22
23 =over 4
24
25 =item debian/I<package>.ucf
26
27 List pairs of source and destination files to register with ucf. Each pair
28 should be put on its own line, with the source and destination separated by
29 whitespace. Both source and destination must be absolute paths. The source
30 should be a file that is provided by your package, typically in /usr/share/,
31 while the destination is typically a file in /etc/.
32
33 A dependency on ucf will be generated in B<${misc:Depends}>.
34
35 =back
36
37 =head1 OPTIONS
38
39 =over 4
40
41 =item B<-n>, B<--noscripts>
42
43 Do not modify F<postinst>/F<postrm> scripts. Turns this command into a no-op.
44
45 =back
46
47 =head1 NOTES
48
49 Note that this command is not idempotent. L<dh_prep(1)> should be called
50 between invocations of this command. Otherwise, it may cause multiple
51 instances of the same text to be added to maintainer scripts.
52
53 =cut
54
55 init();
56
57 foreach my $package (@{$dh{DOPACKAGES}}) {
58         my $tmp=tmpdir($package);
59         my $file=pkgfile($package,"ucf");
60
61         my @ucf;
62         if ($file) {
63                 @ucf=filedoublearray($file);
64         }
65
66         if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
67                 push @ucf, [@ARGV];
68         }
69         
70         if (! $dh{NOSCRIPTS}) {
71                 if (@ucf) {
72                         addsubstvar($package, "misc:Depends", "ucf");
73                 }
74                 foreach my $set (@ucf) {
75                         my $src = $set->[0];
76                         my $dest = $set->[1];
77                         autoscript($package,"postinst","postinst-ucf","s:#UCFSRC#:$src:;s:#UCFDEST#:$dest:;s/#PACKAGE#/$package/",);
78                         autoscript($package,"postrm","postrm-ucf","s:#UCFDEST#:$dest:;s/#PACKAGE#/$package/");
79                 }
80         }
81 }
82
83 =head1 SEE ALSO
84
85 L<debhelper(7)>
86
87 This program is a part of debhelper.
88
89 =head1 AUTHOR
90
91 Joey Hess <joeyh@debian.org>
92 Jeroen Schot <schot@a-eskwadraat.nl>
93
94 =cut