2 # update_doc_packages updates debian/control for the lilypond debian
3 # package, and is released under the terms of the GPL version 2, or
4 # any later version, at your option. See the file README and COPYING
5 # for more information.
6 # Copyright 2012 by Don Armstrong <don@debian.org>.
16 my $cfh = IO::File->new("debian/control",'r') or
17 die "Unable to open $cf for reading: $!";
19 my $dfh = IO::File->new("debian/doc_languages.txt",'r') or
20 die "Unable to open $df for reading: $!";
26 my ($type,$short,$long) = split /\s+/;
27 $languages{$type}{$short} = $long;
32 my $discard_stanza = 0;
34 if (/^Package: lilypond-doc-(pdf|html)-.*/) {
38 if ($discard_stanza) {
43 next if $discard_stanza;
44 $new_control_file .= $_;
48 for my $type (sort keys %languages) {
49 my $uc_type = uc($type);
52 if ($type eq 'html') {
54 # this is required because the images are only in the -html
56 $depends = ', lilypond-doc-html'
58 $recommends = "\nRecommends: evince | pdf-viewer";
60 for my $lang (sort keys %{$languages{$type}}) {
61 my $ucfirst_long_lang = ucfirst($languages{$type}{$lang});
62 # write out the control file stanza
63 $new_control_file .= <<EOF;
64 Package: lilypond-doc-$type-$lang
67 Depends: \${misc:Depends}, dpkg (>= 1.15.4) | install-info${depends}${recommends}
68 Suggests: lilypond (>= \${source:Version})
69 Description: LilyPond $uc_type Documentation in $ucfirst_long_lang
70 LilyPond is a music typesetter, an automated engraving system. It
71 produces beautiful sheet music using a high level description file as input.
73 This package contains the $uc_type documentation in $ucfirst_long_lang for the
74 LilyPond music typesetting software.
77 # write out the package.install file for this example
78 my $install_fh = IO::File->new("debian/lilypond-doc-$type-${lang}.install",'w') or
79 die "Unable to open debian/lilypond-doc-$type-${lang}.install for writing: $!";
80 if ($type eq 'html') {
81 print {$install_fh} <<EOF;
82 usr/share/doc/lilypond/html/*/*/*.${lang}.html
83 usr/share/doc/lilypond/html/*/*.${lang}.html
84 usr/share/doc/lilypond/html/*.${lang}.html
88 print {$install_fh} <<EOF;
89 usr/share/doc/lilypond/html/*/*.${lang}.pdf
90 usr/share/doc/lilypond/html/*.${lang}.pdf
97 $cfh = IO::File->new('debian/control','w') or
98 die "Unable to open debian/control for writing: $!";
99 print {$cfh} $new_control_file;