Debian Codegraph @

dh_octave_examples

raw
1 #!/usr/bin/perl -w
2
3 # dh_octave_examples: Install examples files.
4 # This file is part of the dh-octave Debian package.
5
6 # Copyright (c) 2018 Rafael Laboissière <[email protected]>
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, see <https://www.gnu.org/licenses/>.
20
21 =encoding utf8
22
23 =head1 NAME
24
25 dh_octave_exmaples - install examples files for an Octave add-on package
26
27 =cut
28
29 use strict;
30 use File::Find;
31 use Debian::Debhelper::Dh_Lib;
32
33 init ();
34
35 =head1 SYNOPSIS
36
37 B<dh_octave_examples> [S<I<debhelper options>>]
38
39 =head1 DESCRIPTION
40
41 B<dh_octave_examples> create a symbolic link in /usr/share/doc/ for
42 the upstream examples files.
43
44 =cut
45
46 foreach my $pkg (@{$dh{DOPACKAGES}}) {
47
48 my $tmpdir = "debian/$pkg";
49
50 my @examplesdir;
51 find (sub {
52 return unless -d;
53 return unless /^examples$/;
54 push @examplesdir, $File::Find::name;
55 }, "$tmpdir/usr/share");
56
57 if ($#examplesdir > -1) {
58
59 if ($#examplesdir > 0) {
60 warn "dh_octave_examples:W: found more than one examples directory for package $pkg";
61 }
62 (my $src = $examplesdir[0]) =~ s/^$tmpdir//;
63
64 make_symlink ("/usr/share/doc/$pkg/examples", $src, tmpdir ($pkg));
65
66 }
67
68 }
69
70 =head1 SEE ALSO
71
72 L<debhelper(7)>, L<dh(1)>, L<dh_octave_clean(1)>, L<dh_octave_check(1)>,
73 L<dh_octave_version(1)>, L<dh_octave_changelogs(1)>, L<dh_octave_substvar(1)>
74
75 This program is meant to be used together with debhelper for Debian
76 packages derived from Octave add-on packages.
77 It is recommended to enable it by adding the dh-sequence-octave
78 virtual package to Build-Depends, Build-Depends-Arch or
79 Build-Depends-Indep.
80 This is equivalent to adding dh-octave to the same field and adding
81 --with=octave to the dh sequencer in debian/rules, except that only
82 -arch/-indep/profiled builds are affected.
83 This is also slightly more simple in the most common case.
84
85 =head1 AUTHOR
86
87 Rafael Laboissière <[email protected]>
88
89 =cut
90
91 exit;
92
93 # Local Variables:
94 # indent-tabs-mode: nil
95 # tab-width: 4
96 # End: