#!/usr/bin/perl -w

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

# Intercept and monkey-patch dh_auto_coonfigure, etc.
$ENV{'PATH'}="/usr/share/dh-fortran:$ENV{'PATH'}";

insert_after("dh_clean", "dh_fortran_clean");
insert_after("dh_install", "dh_fortran_mod");
insert_after("dh_install", "dh_fortran_lib");

# cmake, pkgconf  use info from lib
insert_after("dh_fortran_lib", "dh_fortran_cmake");
insert_after("dh_fortran_lib", "dh_fortran_pkgconf");

# dwz will exit 1, breaking on patchelf
remove_command('dh_dwz');
1;
