This file is indexed.

/usr/bin/dh_octave_substvar is in dh-octave 0.3.2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
#!/usr/bin/perl -w

# dh_octave_substvar: Generate variables ${octave:Depends} and
#     ${octave:Upstream-Description} for Octave-Forge
#     Debian packages
# This file is part of the dh-octave Debian package and was also part
# of the deprecated octave-pkg-dev package.

# Copyright (c) 2018  Rafael Laboissière <rafael@laboissiere.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

=encoding utf8

=head1 NAME

dh_octave_substvar - generate substitution variables for an Octave-Forge package

=cut

use strict;
use File::Find;
use Debian::Debhelper::Dh_Lib;
use MIME::Head;

init ();

=head1 SYNOPSIS

B<dh_octave_substvar> [S<I<debhelper options>>]

=head1 DESCRIPTION

B<dh_octave_substvar> generates the substitution variables C<${octave:Depends}>
and C<${octave:Upstream-Description}> needed for building an Octave-Forge
Debian package.

=cut

my %depends = ();
my $desc = "";

my $octave_version = qx {/usr/bin/octave-config --print VERSION};
$octave_version =~ s/-rc/~rc/;

if (-f "DESCRIPTION") {

    my $fields = MIME::Head->new->from_file ("DESCRIPTION");

    my $deps = $fields->get ('depends');
    if (defined $deps) {
        map {
            if (/([^ ]+) \((.*)\)/) {
                $depends {"octave-$1"} = $2;
            } else {
                $depends {"octave-$_"} = "";
            }
        } grep {not /^octave/i} split (", ", $deps);
    }

    $desc = $fields->get ('description');
    $desc =~ s/\n */\n/g;
    chomp $desc;
    $desc =~ s/\n/\${Newline}/g;
}

foreach my $package (@{$dh{DOPACKAGES}}) {
    delsubstvar ($package, 'octave:Depends');
    addsubstvar ($package, 'octave:Depends', "octave (>= $octave_version)");
    for my $pkg (keys %depends) {
        # add dependencies from the DESCRIPTION file
        addsubstvar ($package, 'octave:Depends', $pkg, $depends {$pkg});
    }
    delsubstvar ($package, 'octave:Upstream-Description');
    addsubstvar ($package, 'octave:Upstream-Description', $desc);
}

=head1 SEE ALSO

L<debhelper(7)>, L<dh(1)>, L<dh_octave_clean(1)>, L<dh_octave_check(1)>,
L<dh_octave_version(1)>, L<dh_octave_changelogs(1)>

This program is meant to be used together with debhelper for Debian
packages derived from Octave-Forge packages.

=head1 AUTHOR

Rafael Laboissière <rafael@debian.org>

=cut

exit;