/usr/bin/installdeb-hunspell is in dictionaries-common-dev 1.27.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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | #!/usr/bin/perl -w
#
# Registration with hunspell dictionary
use strict;
my $class = "hunspell";
my $program = "installdeb-$class";
my $debug;
# =======================================================
# Main part
# =======================================================
use Text::Wrap;
$Text::Wrap::columns = 72;
use Debian::Debhelper::Dh_Lib;
use Debian::DictionariesCommon q(:all);
use Devel::DictionariesCommon q(:all);
if ( "$class" eq "wordlist" or "$class" eq "ispell" ){
init( options => { 'write-elanguages' => \$dh{WRITE_ELANGUAGES},
'no-elanguages' => \$dh{DISABLE_ELANGUAGES},
'no-pre-post' => \$dh{DISABLE_PREPOST},
'no-installdebconf' => \$dh{NO_INSTALLDEBCONF}
});
} elsif ( $class eq "aspell" ){
init(options => { 'aspell-simple' => \$dh{ASPELL_SIMPLE} });
} else {
init();
}
if ( $dh{NOSCRIPTS} ){
$dh{DISABLE_PREPOST}++;
$dh{NO_INSTALLDEBCONF}++;
};
delete $dh{WRITE_ELANGUAGES} if ( $dh{DISABLE_ELANGUAGES} );
foreach my $package (@{$dh{DOPACKAGES}}) {
my $lib_dir = tmpdir($package) . getlibdir($class);
my $usr_lib_dir = tmpdir($package) . "/usr/lib/$class";
my $var_lib_dir = tmpdir($package) . "/var/lib/$class";
my $usr_share_dir = tmpdir($package) . "/usr/share/$class";
my %options = ('class' => $class,
'program' => $program,
'package' => $package,
'lib_dir' => $lib_dir,
'usr_lib_dir' => $usr_lib_dir,
'var_lib_dir' => $var_lib_dir,
'usr_share_dir' => $usr_share_dir
);
# "cdbs" snippets call installdeb-* scripts unconditionally in
# case there is something for them.
# Do not trigger an error if not found, just try next one.
my $dicts = dico_process_infofile(\%options)
or next;
#
# Install debhelper and debhelper-like auto-scripts
unless ( $dh{NOSCRIPTS} or $dh{DISABLE_PREPOST}) {
# Install normal autoscripts. While called earlier than autocompat
# autoscripts, will be placed later in maintainer scripts.
autoscript ($package, "postinst", "postinst-$class",
"s/#PACKAGE#/$package/");
autoscript ($package, "postrm", "postrm-$class",
"s/#PACKAGE#/$package/");
if ( $class eq "ispell" || $class eq "aspell" ){
my %hash_extension = ("ispell" => "hash", "aspell" => "rws");
my $autocompat_info = dico_process_autocompat($dicts,\%options);
#
if ( %{$autocompat_info->{'auto-compat'}} ){
verbose_print("$program info:");
if ( defined $autocompat_info->{'auto-contents'}
&& %{$autocompat_info->{'auto-contents'}} ){
verbose_print(" auto-contents: \"",join(', ',sort keys %{$autocompat_info->{'auto-contents'}}),"\"");
}
verbose_print(" auto-compat: \"",join(', ',sort keys %{$autocompat_info->{'auto-compat'}}),"\"");
verbose_print(" auto-hash: \"", join(', ',sort keys %{$autocompat_info->{'auto-hash'}}), "\"");
}
# Install autocompat autoscripts
if ( %{$autocompat_info->{'auto-compat'}} ){
dico_install_autocompat($autocompat_info,\%options);
}
}
# Populate substvars $class:Depends
dico_populate_substvars(\%options);
}
## -- No debconf handling needed for aspell or hunspell --
}
__END__
=head1 NAME
B<installdeb-hunspell> - debhelper-like utility for
maintainers of Debian packages
=head1 SYNOPSIS
installdeb-hunspell [debhelper options]
=head1 DESCRIPTION
B<installdeb-hunspell> is a debhelper like program that is
responsible for installing appropriate debhelper snippets in
a package,
according to the Debian Spell Dictionaries and Tools Policy.
For more details, see
/usr/share/doc/dictionaries-common-dev/dsdt-policy.txt.gz
The actions executed by B<installdeb-hunspell> are the
following:
=over
=item * Maintainer Scripts
B<installdeb-hunspell> installs the necessary
scraps of code in the F<postinst> and F<postrm> scripts.
=item * Language info file
B<installdeb-hunspell> also checks a file containing
information, called
F<debian/info-hunspell> or
F<debian/package.info-hunspell>. If this file is
successfully parsed, it is installed in the
F</var/lib/dictionaries-common/hunspell> directory.
=item * Substvars substitutions
This script will populate a F<substvars> file, so Depends line in
control file can contain
${hunspell:Depends} to
automatically care for dictionaries-common dependencies.
This requires C<Build-Depends> on at least dictionaries-common-dev
1.23.0 and is highly recommended.
=item * Debconf files
As opposed to B<installdeb-ispell> and B<installdeb-wordlist>, neither B<installdeb-aspell>
nor B<installdeb-hunspell> do anything related to debconf files, since both aspell and
hunspell rely on the environment variable C<LANG> for default dictionary selection
instead of using symlinks set after a debconf question on dictionary
installation. For that reason if you need to add debconf stuff with debhelper
to your aspell or hunspell dictionary package do it in the usual way and call
dh_installdebconf(1) as for any other package.
=back
=head1 OPTIONS
The usual dephelper(1) options are accepted.
=head1 NOTES
This program is not part of debhelper, although it is intended to be used
in hunspell dictionary packages using debhelper in its
building.
=head1 SEE ALSO
debhelper(1),
dictionaries-common.checklist,
dsdt-policy.txt
This program is part of the dictionaries-common-dev package. It is
intended to be used by maintainers of
hunspell dictionary
packages for Debian. See the documentation
under /usr/share/doc/dictionaries-common-dev.
=head1 AUTHORS
Rafael Laboissiere, Agustin Martin
=cut
# Local Variables:
# mode: perl
# mode: flyspell-prog
# ispell-local-dictionary: "american"
# End:
# LocalWords: aspell ispell wordlist debconf debhelper Debian config postrm
# LocalWords: debian elanguages installdeb dephelper installdebconf Elanguage
# LocalWords: Laboissiere
|