#!/usr/bin/perl -w

# dh_puredata_substvar: Generate variables ${puredata:Depends} and
#     ${puredata:Upstream-Description} for Octave-Forge
#     Debian packages. Also, adds the virtual package
#     puredata-abi-N to ${shlibs:Depends
#
# This file is part of the dh-puredata Debian package and was also part
# of the deprecated puredata-pkg-dev package.

# Copyright (c) 2018, 2019  Rafael Laboissière <rafael@debian.org>
#
# 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_puredata_substvar - generate substitution variables for a Pd external package

=cut

use strict;
use Debian::Debhelper::Dh_Lib;

init ();

=head1 SYNOPSIS

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

=head1 DESCRIPTION

B<dh_puredata_substvar> generates the substitution variable
C<${puredata:Depends}> needed for running Pd-external Debian packages.

=cut

my %depends = ();

foreach my $package (@{$dh{DOPACKAGES}}) {
    delsubstvar ($package, 'puredata:Depends');
    addsubstvar ($package, 'puredata:Depends', "puredata | pd");
    #    for my $pkg (keys %depends) {
    #    # add dependencies from the DESCRIPTION file
    #    addsubstvar ($package, 'puredata:Depends', $pkg, $depends {$pkg});
    #}
}

=head1 SEE ALSO

L<debhelper(7)>, L<dh(1)>

This program is meant to be used together with debhelper for Debian
packages derived from Pd externals packages.
It is recommended to enable it by adding the dh-sequence-pd-lib-builder
virtual package to Build-Depends, Build-Depends-Arch or
Build-Depends-Indep.
This is equivalent to adding dh-puredata to the same field and adding
--with=pd-lib-builder to the dh sequencer in debian/rules, except that only
-arch/-indep/profiled builds are affected.
This is also slightly more simple in the most common case.

=head1 AUTHOR

IOhannes m zmölnig <umlaeute@debian.org>

=cut

exit;
