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>.
13 my $cfh = IO::File->new("debian/control",'r') or
14 die "Unable to open debian/control for reading: $!";
16 my $dfh = IO::File->new("debian/doc_languages.txt",'r') or
17 die "Unable to open debian/doc_languages.txt for reading: $!";
23 my ($type,$short,$long) = split /\s+/;
24 $languages{$type}{$short} = $long;
29 my $discard_stanza = 0;
31 if (/^Package: lilypond-doc-(pdf|html)-.*/) {
35 if ($discard_stanza) {
40 next if $discard_stanza;
41 $new_control_file .= $_;
45 for my $type (sort keys %languages) {
46 my $uc_type = uc($type);
49 if ($type eq 'html') {
51 # this is required because the images are only in the -html
53 $depends = ', lilypond-doc-html'
55 $recommends = "\nRecommends: evince | pdf-viewer";
57 for my $lang (sort keys %{$languages{$type}}) {
58 my $ucfirst_long_lang = ucfirst($languages{$type}{$lang});
59 # write out the control file stanza
60 $new_control_file .= <<EOF;
61 Package: lilypond-doc-$type-$lang
64 Depends: \${misc:Depends}, dpkg (>= 1.15.4) | install-info${depends}${recommends}
65 Suggests: lilypond (>= \${source:Version})
66 Replaces: lilypond-doc (<< 2.16.2-1~exp+1)
67 Breaks: lilypond-doc (<< 2.16.2-1~exp+1)
68 Description: LilyPond $uc_type Documentation in $ucfirst_long_lang
69 LilyPond is a music typesetter, an automated engraving system. It
70 produces beautiful sheet music using a high level description file as input.
72 This package contains the $uc_type documentation in $ucfirst_long_lang for the
73 LilyPond music typesetting software.
76 # write out the package.install file for this example
77 my $install_fh = IO::File->new("debian/lilypond-doc-$type-${lang}.install",'w') or
78 die "Unable to open debian/lilypond-doc-$type-${lang}.install for writing: $!";
79 if ($type eq 'html') {
80 print {$install_fh} <<EOF;
81 usr/share/doc/lilypond/html/*/*/*.${lang}.html
82 usr/share/doc/lilypond/html/*/*.${lang}.html
83 usr/share/doc/lilypond/html/*.${lang}.html
87 print {$install_fh} <<EOF;
88 usr/share/doc/lilypond/html/*/*.${lang}.pdf
92 my $docbase_fh = IO::File->new("debian/lilypond-doc-$type-${lang}.doc-base-special",'w') or
93 die "Unable to open debian/lilypond-doc-$type-${lang}.doc-base-special for writing: $!";
94 print {$docbase_fh} <<EOF;
95 Document: lilypond.${lang}
96 Title: GNU LilyPond, the music typesetter
98 Abstract: This documentation describes LilyPond (the GNU Project music
99 typesetter), the LilyPond music input language, and the Mutopia project,
100 a.k.a. "Music To the People."
104 if ($type eq 'html') {
105 print {$docbase_fh} <<EOF;
107 Index: /usr/share/doc/lilypond/html/index.${lang}.html
108 Files: /usr/share/doc/lilypond/html/*/*/*.${lang}.html /usr/share/doc/lilypond/html/*/*.${lang}.html /usr/share/doc/lilypond/html/*.${lang}.html
112 print {$docbase_fh} <<EOF;
114 Files: /usr/share/doc/lilypond/html/Documentation/*.${lang}.pdf*
121 $cfh = IO::File->new('debian/control','w') or
122 die "Unable to open debian/control for writing: $!";
123 print {$cfh} $new_control_file;