#!/usr/bin/perl -w

=head1 NAME

dh_pybuild_rename - Rename output directories of pybuild according to a chosen package names

=cut

use strict;
use Debian::Debhelper::Dh_Lib;
use File::Copy;

=head1 SYNOPSIS

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

=cut

init();

foreach my $package (@{$dh{DOPACKAGES}}) {
	my $package_dir = tmpdir($package);
	
	# Generate package name used by pybuild
	my $python = ($package =~ /python3/) ? 'python3' : 'python';
	my $pybuild_dir = tmpdir($python . '-' . $ENV{'PYBUILD_NAME'});
	
	move($pybuild_dir, $package_dir);
}

=head1 AUTHOR

Sergey Klyaus <sklyaus@yandex-team.ru>

=cut
