#!/usr/bin/perl
# This is an example script to preseed a package using debconf values
# Modify it to your needs.

use strict;
use warnings;

# We use preseed() helper subroutine so we have to include
# its definition
require '/usr/lib/localization-config/common/preseed.pl';

# Define the package name
my $package = "#PACKAGE#";

# If no locale is given as argument, quit
my $lang = $ARGV[0] or die "No language given";

# We define an associative arrays with the debconf keys
# These will be used in combination with the values in the
# next array
my %keynames = ( OPTION1     => 'package/debconf/option1',
                 OPTION2     => 'package/debconf/option2',
               );

# The debconf version map. Fill it with all known locale keys and the resp. debconf values.
# These are most of the supported locales for Debian. You should keep the locale entries
# that you have valid debconf values for. You may remove the rest but better do that after
# you make sure that there is no support for this locale.

my %lang_map = (
                    # entries sorted alphabetically
		    'bs_BA.ISO8859-2' => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'bg_BG'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'ca_ES@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'cs_CZ'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'da_DK'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'de_BE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'de_CH'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'de_DE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'el_GR.UTF-8'  => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'en_AU'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'en_CA'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'en_IE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'ga_IE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'en_GB'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'gd_GB'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'gv_GB'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'kw_GB'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'en_US'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'es_AR'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'es_ES@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'es_MX'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'es_PE'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fa_IR.UTF-8'  => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fi_FI'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fi_FI@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'fr_BE'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fr_BE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fr_CA'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'fr_CH'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'fr_FR@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'he_IL'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'it_IT@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'ja_JP.EUC-JP' => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'ko_KR'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'lv_LV'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'lt_LT'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'nb_NO'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'nds_DE'       => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'nl_BE@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'nl_NL@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'nn_NO'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'no_NO'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'pl_PL'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'pt_BR'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'ru_RU'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'se_NO'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'sk_SK'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
		    'sl_SI'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'sv_SE'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'sv_FI'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'sv_FI@euro'   => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'tr_TR'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                    'uk_UA'        => { OPTION1 => 'value1', OPTION2 => 'value2' },
                   ) ;
                   
sub get_lang_map() {
    return %lang_map;
}

# Print the supported locale entries.
if ("supported" eq $lang) {
    for $lang (sort keys %lang_map) {
        print "$lang\n";
    }
    exit 0;
}

# Call the preseed() subroutine to set the package debconf values.
preseed($package, $lang, \%lang_map, \%keynames);

1;
