/usr/bin/dh_gnome is in gnome-pkg-tools 0.20.2ubuntu2.
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 105 106 107 108 109 110 111 112 113 | #!/usr/bin/perl -w
=head1 NAME
dh_gnome - tools for the Debian GNOME Packaging Team
=cut
use strict;
use Debian::Debhelper::Dh_Lib;
=head1 SYNOPSIS
B<dh_gnome> [I<debhelper options>] [--no-clean-la] [--no-gnome-version]
=head1 DESCRIPTION
gnome-pkg-tools contains some useful tools for the Debian GNOME Packaging Team.
dh_gnome is a tool designed to provide useful functions to GNOME packages
which do use of debhelper as preferred build system, similar to the CDBS
routines provided by gnome-pkg-tools.
dh_gnome handles some routines to be run during binary-install phase.
=head1 OPTIONS
=over 4
=item B<--no-clean-la>
Use this flag if you do not want to automatically empty dependency_libs fields
provided by your packages' .la files.
=item B<--no-gnome-versions>
Use this flag if you do not want to generate GNOME subsvars for your packages.
=back
=cut
init(options => { "no-clean-la" => \$dh{CLEAN_LA},
"no-gnome-versions" => \$dh{GNOME_VERSIONS} });
sub clean_la_files {
# Empty dependency_libs lines from .la files
foreach my $package (@{$dh{DOPACKAGES}}) {
if (-d "debian/$package/usr/lib") {
opendir (DIR, "debian/$package/usr/lib");
my @files = grep (/\.la$/, readdir (DIR) );
closedir (DIR);
foreach my $file (@files) {
my $la = "debian/$package/usr/lib/$file";
open FILE, $la or die $!;
my @lines = <FILE>;
close FILE;
open FILE, "+>", $la or die $!;
foreach (@lines) {
if ($_ =~ /^dependency_libs/) {
$_ =~ s/'.*'/''/;
}
print FILE $_;
}
close FILE;
}
}
}
}
sub gnome_versions {
# Generate ${gnome:Version} and ${gnome:NextVersion} substvars
foreach my $package (@{$dh{DOPACKAGES}}) {
my $gnome_version;
my $gnome_next_version;
isnative($package);
$dh{VERSION} =~ /^([0-9]+:)?([0-9]\.[0-9]+)\..*$/;
if ($1) {
$gnome_version = $1.$2;
} else {
$gnome_version = $2;
}
$gnome_version =~ /^([0-9]+:)?([0-9]\.)([0-9]+)$/;
if ($1) {
$gnome_next_version = $1.$2.($3+1);
} else {
$gnome_next_version = $2.($3+1);
}
open FILE, ">>", "debian/$package.substvars" or die $!;
print FILE "gnome:Version=$gnome_version\n";
print FILE "gnome:NextVersion=$gnome_next_version\n";
close FILE;
}
}
unless ($dh{CLEAN_LA}) { clean_la_files(); }
unless ($dh{GNOME_VERSIONS}) { gnome_versions(); }
=head1 SEE ALSO
L<debhelper(7)>
This program is a part of gnome-pkg-tools but is made to work with debhelper.
=head1 AUTHORS
Luca Falavigna <dktrkranz@debian.org>
=cut
|