11 my $cfh = IO::File->new("debian/control",'r') or
12 die "Unable to open $cf for reading: $!";
14 my $dfh = IO::File->new("debian/doc_languages.txt",'r') or
15 die "Unable to open $df for reading: $!";
21 my ($type,$short,$long) = split /\s+/;
22 $languages{$type}{$short} = $long;
27 my $discard_stanza = 0;
29 if (/^Package: lilypond-doc-(pdf|html)-.*/) {
33 if ($discard_stanza) {
38 next if $discard_stanza;
39 $new_control_file .= $_;
43 for my $type (sort keys %languages) {
44 my $uc_type = uc($type);
47 if ($type eq 'html') {
49 # this is required because the images are only in the -html
51 $depends = ', lilypond-doc-html'
53 $recommends = "\nRecommends: evince | pdf-viewer";
55 for my $lang (sort keys %{$languages{$type}}) {
56 my $ucfirst_long_lang = ucfirst($languages{$type}{$lang});
57 # write out the control file stanza
58 $new_control_file .= <<EOF;
59 Package: lilypond-doc-$type-$lang
62 Depends: \${misc:Depends}, dpkg (>= 1.15.4) | install-info${depends}${recommends}
63 Suggests: lilypond (>= \${source:Version})
64 Description: LilyPond $uc_type Documentation in $ucfirst_long_lang
65 LilyPond is a music typesetter, an automated engraving system. It
66 produces beautiful sheet music using a high level description file as input.
68 This package contains the $uc_type documentation in $ucfirst_long_lang for the
69 LilyPond music typesetting software.
72 # write out the package.install file for this example
73 my $install_fh = IO::File->new("debian/lilypond-doc-$type-${lang}.install",'w') or
74 die "Unable to open debian/lilypond-doc-$type-${lang}.install for writing: $!";
75 if ($type eq 'html') {
76 print {$install_fh} <<EOF;
77 usr/share/doc/lilypond/html/*/*/*.${lang}.html
78 usr/share/doc/lilypond/html/*/*.${lang}.html
79 usr/share/doc/lilypond/html/*.${lang}.html
83 print {$install_fh} <<EOF;
84 usr/share/doc/lilypond/html/*/*.${lang}.pdf
85 usr/share/doc/lilypond/html/*.${lang}.pdf
92 $cfh = IO::File->new('debian/control','w') or
93 die "Unable to open debian/control for writing: $!";
94 print {$cfh} $new_control_file;