]> git.donarmstrong.com Git - debhelper.git/blob - dh_installlogcheck
dh_link: Doc improvement. Closes: #672988
[debhelper.git] / dh_installlogcheck
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installlogcheck - install logcheck rulefiles into etc/logcheck/
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_installlogcheck> [S<I<debhelper options>>]
15
16 =head1 DESCRIPTION
17
18 B<dh_installlogcheck> is a debhelper program that is responsible for
19 installing logcheck rule files.
20
21 =head1 FILES
22
23 =over 4
24
25 =item debian/I<package>.logcheck.cracking
26
27 =item debian/I<package>.logcheck.violations
28
29 =item debian/I<package>.logcheck.violations.ignore
30
31 =item debian/I<package>.logcheck.ignore.workstation
32
33 =item debian/I<package>.logcheck.ignore.server
34
35 =item debian/I<package>.logcheck.ignore.paranoid
36
37 Each of these files, if present, are installed into corresponding
38 subdirectories of F<etc/logcheck/> in package build directories.
39
40 =back
41
42 =head1 OPTIONS
43
44 =over 4
45
46 =item B<--name=>I<name>
47
48 Look for files named F<debian/package.name.logcheck.*> and install
49 them into the corresponding subdirectories of F<etc/logcheck/>, but
50 use the specified name instead of that of the package.
51
52 =back
53
54 =cut
55
56 init();
57
58 foreach my $package (@{$dh{DOPACKAGES}}) {
59         my $tmp=tmpdir($package);
60
61         foreach my $type (qw{ignore.d.workstation ignore.d.server
62                              ignore.d.paranoid cracking.d
63                              violations.d violations.ignore.d}) {
64                 my $typenod=$type;
65                 $typenod=~s/\.d//;
66                 my $logcheck=pkgfile($package,"logcheck.$typenod");
67                 if ($logcheck) {
68                         if (! -d "$tmp/etc/logcheck/$type") {
69                                 doit("install","-o",0,"-g",0,"-d","$tmp/etc/logcheck/$type");
70                         }
71                         my $packagenodot=pkgfilename($package); # run-parts..
72                         $packagenodot=~s/\./_/g;
73                         doit("install","-m","0644",$logcheck,"$tmp/etc/logcheck/$type/$packagenodot");
74                 }
75         }
76 }
77
78 =head1 SEE ALSO
79
80 L<debhelper(7)>
81
82 This program is a part of debhelper.
83     
84 =head1 AUTHOR
85
86 Jon Middleton <jjm@debian.org>
87
88 =cut