Merge lp:~stefanor/ubuntu/maverick/ghostscript/defoma-removal into lp:ubuntu/maverick/ghostscript

Proposed by Stefano Rivera
Status: Merged
Merge reported by: James Westby
Merged at revision: not available
Proposed branch: lp:~stefanor/ubuntu/maverick/ghostscript/defoma-removal
Merge into: lp:ubuntu/maverick/ghostscript
Diff against target: 1202 lines (+63/-1013)
11 files modified
debian/changelog (+8/-0)
debian/control (+1/-2)
debian/dirs (+4/-3)
debian/ghostscript.links (+1/-1)
debian/ghostscript.postinst (+9/-15)
debian/ghostscript.postrm (+0/-44)
debian/ghostscript.preinst (+9/-2)
debian/ghostscript.prerm (+5/-9)
debian/gs.defoma (+0/-930)
debian/rules (+6/-7)
debian/update-gsfontmap (+20/-0)
To merge this branch: bzr merge lp:~stefanor/ubuntu/maverick/ghostscript/defoma-removal
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Ubuntu branches Pending
Review via email: mp+25850@code.launchpad.net

Description of the change

Ghostscript is missing a defoma removal patch. The accompanying patch in gsfonts made it into Ubuntu already.

Without this, albatross FTBFS

To post a comment you must log in.
70. By Stefano Rivera

Merge Debian's defoma-removal patch from Deb Bug #582113

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2010-04-29 09:43:23 +0000
+++ debian/changelog 2010-05-23 18:44:26 +0000
@@ -1,3 +1,11 @@
1ghostscript (8.71.dfsg.1-0ubuntu5.2) maverick; urgency=low
2
3 * Merge changes from 8.71~dfsg2-1.1 (LP: #584597):
4 - Drop defoma.
5 - Add update-gsfontmap to provide cidfmap and Fontmap.
6
7 -- Stefano Rivera <stefano@rivera.za.net> Sun, 23 May 2010 18:13:43 +0200
8
1ghostscript (8.71.dfsg.1-0ubuntu5.1) lucid-proposed; urgency=low9ghostscript (8.71.dfsg.1-0ubuntu5.1) lucid-proposed; urgency=low
210
3 * debian/patches/pdf-interpreter-segfault-fixes.dpatch,11 * debian/patches/pdf-interpreter-segfault-fixes.dpatch,
412
=== modified file 'debian/control'
--- debian/control 2010-02-11 11:31:23 +0000
+++ debian/control 2010-05-23 18:44:26 +0000
@@ -15,9 +15,8 @@
15Conflicts: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-cjk-resource (<< 1.20010910-1), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts15Conflicts: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-cjk-resource (<< 1.20010910-1), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts
16Replaces: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts16Replaces: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts
17Provides: gs-pdfencrypt, postscript-viewer, gs-common17Provides: gs-pdfencrypt, postscript-viewer, gs-common
18Recommends: psfontmgr
19Suggests: ghostscript-cups, ghostscript-x, hpijs18Suggests: ghostscript-cups, ghostscript-x, hpijs
20Depends: ${shlibs:Depends}, gsfonts (>= 6.0-1), defoma, debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= ${binary:Version}), ${misc:Depends}19Depends: ${shlibs:Depends}, gsfonts (>= 6.0-1), debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= ${binary:Version}), ${misc:Depends}
21Description: The GPL Ghostscript PostScript/PDF interpreter20Description: The GPL Ghostscript PostScript/PDF interpreter
22 Ghostscript is used for PostScript/PDF preview and printing. Usually as21 Ghostscript is used for PostScript/PDF preview and printing. Usually as
23 a back-end to a program such as ghostview, it can display PostScript and PDF22 a back-end to a program such as ghostview, it can display PostScript and PDF
2423
=== modified file 'debian/dirs'
--- debian/dirs 2007-05-21 13:00:21 +0000
+++ debian/dirs 2010-05-23 18:44:26 +0000
@@ -1,5 +1,6 @@
1usr/bin1usr/bin
2usr/share/defoma/scripts2usr/share/defoma/scripts
3etc/defoma/config3etc/ghostscript/cidfmap.d
4var/lib/defoma/gs.d/dirs/fonts4etc/ghostscript/fontmap.d
5var/lib/defoma/gs.d/dirs/CMap5var/lib/ghostscript/CMap
6var/lib/ghostscript/fonts
67
=== modified file 'debian/ghostscript.links'
--- debian/ghostscript.links 2010-02-11 11:31:23 +0000
+++ debian/ghostscript.links 2010-05-23 18:44:26 +0000
@@ -1,4 +1,4 @@
1var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/8.71/Resource/CMap1var/lib/ghostscript/CMap usr/share/ghostscript/8.71/Resource/CMap
2var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/CMap2var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/CMap
3usr/bin/ps2ascii usr/bin/ps2txt3usr/bin/ps2ascii usr/bin/ps2txt
4usr/share/man/de/man1/ps2ps.1.gz usr/share/man/de/man1/eps2eps.1.gz4usr/share/man/de/man1/ps2ps.1.gz usr/share/man/de/man1/eps2eps.1.gz
55
=== modified file 'debian/ghostscript.postinst'
--- debian/ghostscript.postinst 2009-05-18 23:19:49 +0000
+++ debian/ghostscript.postinst 2010-05-23 18:44:26 +0000
@@ -19,21 +19,15 @@
1919
20case "$1" in20case "$1" in
21 configure)21 configure)
22 # /usr/bin/ps2pdf is now controlled by update-alternatives22 # /usr/bin/ps2pdf is now controlled by update-alternatives
23 update-alternatives --install /usr/bin/ps2pdf \23 update-alternatives --install /usr/bin/ps2pdf \
24 ps2pdf /usr/bin/ps2pdf14 5024 ps2pdf /usr/bin/ps2pdf14 50
25 update-alternatives --install /usr/bin/ps2pdf \25 update-alternatives --install /usr/bin/ps2pdf \
26 ps2pdf /usr/bin/ps2pdf12 3026 ps2pdf /usr/bin/ps2pdf12 30
27 update-alternatives --install /usr/bin/ps2pdf \27 update-alternatives --install /usr/bin/ps2pdf \
28 ps2pdf /usr/bin/ps2pdf13 4028 ps2pdf /usr/bin/ps2pdf13 40
2929
30 # Make sure the substitution file for Ghostscript exists30 update-gsfontmap
31 if ! defoma-subst check-rule ghostscript; then
32 defoma-subst new-rule ghostscript
33 fi
34
35 defoma-app -t update gs
36
37 ;;31 ;;
3832
39 abort-upgrade|abort-remove|abort-deconfigure)33 abort-upgrade|abort-remove|abort-deconfigure)
4034
=== removed file 'debian/ghostscript.postrm'
--- debian/ghostscript.postrm 2007-05-21 13:00:21 +0000
+++ debian/ghostscript.postrm 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1#! /bin/sh
2# postrm script for ghostscript
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <postrm> `remove'
10# * <postrm> `purge'
11# * <old-postrm> `upgrade' <new-version>
12# * <new-postrm> `failed-upgrade' <old-version>
13# * <new-postrm> `abort-install'
14# * <new-postrm> `abort-install' <old-version>
15# * <new-postrm> `abort-upgrade' <old-version>
16# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20
21case "$1" in
22 remove)
23 # Remove defoma directory
24 rm -rf /var/lib/defoma/gs.d
25 ;;
26 purge)
27 # Remove defoma-related files
28 rm -f /etc/defoma/ghostscript.subst-rule
29 rm -f /etc/defoma/ghostscript.subst-rule~
30 ;;
31 upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
32 ;;
33 *)
34 echo "postrm called with unknown argument \`$1'" >&2
35 exit 1
36
37esac
38
39# dh_installdeb will replace this with shell code automatically
40# generated by other debhelper scripts.
41
42#DEBHELPER#
43
44exit 0
450
=== modified file 'debian/ghostscript.preinst'
--- debian/ghostscript.preinst 2009-01-05 12:21:45 +0000
+++ debian/ghostscript.preinst 2010-05-23 18:44:26 +0000
@@ -17,13 +17,20 @@
1717
18case "$1" in18case "$1" in
19 install|upgrade)19 install|upgrade)
20 # Do away with update-alternative for /usr/bin/gs, we have one20 # Do away with update-alternative for /usr/bin/gs, we have one
21 # grand unified Ghostscript now!21 # grand unified Ghostscript now!
22 if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then22 if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then
23 update-alternatives --remove-all gs || true23 update-alternatives --remove-all gs || true
24 update-alternatives --remove-all gs.1 || true24 update-alternatives --remove-all gs.1 || true
25 fi25 fi
2626
27 # Remove obsolete defoma files
28 if dpkg --compare-versions "$2" lt-nl "8.71~dfsg1.0ubuntu5.1"; then
29 rm -rf /var/lib/defoma/gs.d
30 rm -f /etc/defoma/ghostscript.subst-rule
31 rm -f /etc/defoma/ghostscript.subst-rule~
32 rm -f /var/lib/defoma/ghostscript.subst-cache
33 fi
27 ;;34 ;;
2835
29 abort-upgrade)36 abort-upgrade)
3037
=== modified file 'debian/ghostscript.prerm'
--- debian/ghostscript.prerm 2007-05-22 21:38:21 +0000
+++ debian/ghostscript.prerm 2010-05-23 18:44:26 +0000
@@ -20,16 +20,12 @@
20case "$1" in20case "$1" in
21 remove)21 remove)
22# install-info --quiet --remove /usr/info/ghostscript.info.gz22# install-info --quiet --remove /usr/info/ghostscript.info.gz
23 if type defoma-app >/dev/null 2>&1; then23 rm -f /var/lib/ghostscript/fonts/cidfmap \
24 defoma-app -t purge gs24 /var/lib/ghostscript/fonts/Fontmap
25 fi25 update-alternatives --remove-all ps2pdf
26 update-alternatives --remove-all ps2pdf26 ;;
27 ;;
28 upgrade)27 upgrade)
29 if type defoma-app >/dev/null 2>&1; then28 update-alternatives --remove-all ps2pdf
30 defoma-app -t clean gs
31 update-alternatives --remove-all ps2pdf
32 fi
33 ;;29 ;;
34 deconfigure)30 deconfigure)
35# install-info --quiet --remove /usr/info/ghostscript.info.gz31# install-info --quiet --remove /usr/info/ghostscript.info.gz
3632
=== removed file 'debian/gs.defoma'
--- debian/gs.defoma 2007-05-21 13:00:21 +0000
+++ debian/gs.defoma 1970-01-01 00:00:00 +0000
@@ -1,930 +0,0 @@
1#
2# gs.defoma: Defoma support for Ghostscripts
3#
4
5@ACCEPT_CATEGORIES = qw(type1 type3 gsfontderivative truetype cid
6 cmap psprint);
7
8package gs;
9use strict;
10use POSIX;
11
12use vars qw($DEFOMA_TEST_DIR $ROOTDIR);
13
14use Debian::Defoma::Common;
15use Debian::Defoma::Font;
16use Debian::Defoma::Id;
17use Debian::Defoma::Subst;
18import Debian::Defoma::Font;
19import Debian::Defoma::Id;
20import Debian::Defoma::Subst;
21import Debian::Defoma::Common;
22
23my $Id;
24my $IdCmap;
25my $Sb1;
26my $Sb2;
27
28my $PkgDir = "$ROOTDIR/gs.d";
29my $CidDir = "$PkgDir/dirs/CIDFont";
30my $CMapDir = "$PkgDir/dirs/CMap";
31my $TTCidDir = "$PkgDir/dirs/TTCIDFont";
32my $FontDir = "$PkgDir/dirs/fonts";
33my $FontMap = "$FontDir/Fontmap"; # F
34my $CIDFontMap = "$FontDir/CIDFnmap"; # FF
35my $Subst4psprint = 0;
36# For Ghostscript 8 or later
37my $FAPIfmap = "$FontDir/FAPIfontmap"; # FFF
38my $Cidfmap = "$FontDir/cidfmap"; # FFFF
39
40sub init {
41 unless ($Id) {
42 $Id = defoma_id_open_cache();
43 }
44 unless ($IdCmap) {
45 $IdCmap = defoma_id_open_cache('cmap');
46 }
47 unless ($Sb1) {
48 $Sb1 = defoma_subst_open(rulename => 'psprint', threshold => 50,
49 idobject => $Id, private => 1);
50 }
51 unless ($Sb2) {
52 $Sb2 = defoma_subst_open(rulename => 'ghostscript', threshold => 30,
53 idobject => $Id);
54 }
55
56 return 0;
57}
58
59sub term {
60 my @list;
61 my $i;
62
63 if ($Id) {
64 if (open(F, '>' . $FontMap) && open(FF, '>' . $CIDFontMap) &&
65 open(FFF, '>' . $FAPIfmap) && open(FFFF, '>' . $Cidfmap)) {
66 @list = defoma_id_get_font($Id, 'installed');
67
68 foreach $i (@list) {
69 next if ($Id->{2}->[$i] ne 'SrI');
70 my $c = $Id->{4}->[$i];
71 my $f;
72 my @h;
73 my $cmap;
74 my @cmaplist;
75 my $j;
76 my @ch;
77 my %hh;
78
79 if ($c =~ /^(type1|type3|gsfontderivative)$/) {
80 $f = $Id->{1}->[$i];
81 $f =~ s/^.*\///;
82 #
83 # Spit out $FontDir/Fontmap
84 #
85 print F '/', $Id->{0}->[$i], ' (', $f, ") ;\n";
86 } elsif ($c =~ /^truetype$/) {
87 $f = $Id->{1}->[$i];
88 #
89 # Spit out $FontDir/FAPIfontmap
90 #
91 # FIXME: need to support the sub font id for the collection.
92 print FFF '/', $Id->{0}->[$i], ' << /Path (', $f, ') /FontType 1 /FAPI /FreeType /SubfontId ', '0' , " >> ;\n"
93 } elsif ($c =~ /^(truetype-cjk|cid)$/) {
94 $f = $Id->{1}->[$i];
95 @h = split(/ +/, $Id->{7}->[$i]);
96 #
97 # Spit out $FontDir/CIDFnmap
98 #
99 print FF '/', $Id->{0}->[$i], ' (', $f, ') ';
100 if ($c eq 'truetype-cjk') {
101 print FF '/', $h[0], '-', $h[1], '-', $h[2];
102 }
103 print FF " ;\n";
104 # For Ghostscript 8 or later
105 if ($c eq 'truetype-cjk') {
106 my @hints = defoma_id_get_hints( $Id, $i );
107 my $cidsupplement;
108 while (@hints) {
109 my $var = shift @hints;
110 if ($var eq "--CIDSupplement") {
111 $cidsupplement = shift @hints;
112 last;
113 }
114 }
115 unless (defined $cidsupplement) {
116 print STDERR "No CIDSupplement specified for $Id->{0}->[$i], defaulting to 0.\n";
117 $cidsupplement = 0;
118 }
119 #
120 # Spit out $FontDir/cidfmap
121 #
122 # FIXME: need to support the sub font id for the collection.
123 print FFFF '/', $Id->{0}->[$i], ' << /FileType /TrueType /Path (', $f, ') /SubfontID ', '0', ' /CSI [(', $h[6], ') ', $cidsupplement, "] >> ;\n";
124 }
125 }
126 }
127
128 @list = defoma_id_get_font($Id, 'installed');
129
130 foreach $i (@list) {
131 next if ($Id->{2}->[$i] !~ /^.[aS]/);
132
133 my $c = $Id->{4}->[$i];
134 #
135 # Spit out aliases
136 #
137 if ($c =~ /^(truetype|type1|type3|gsfontderivative)$/) {
138 print F '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n";
139 print FFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n";
140 } elsif ($c =~ /^(truetype-cjk|cid)$/) {
141 print FF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n";
142 print FFFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n";
143 }
144
145 }
146
147 close F;
148 close FF;
149 close FFF;
150 close FFFF;
151 unlink($FontMap) unless(-s $FontMap);
152 unlink($CIDFontMap) unless(-s $CIDFontMap);
153 unlink($FAPIfmap) unless(-s $FAPIfmap);
154 unlink($Cidfmap) unless(-s $Cidfmap);
155 }
156
157 defoma_id_close_cache($Id);
158 $Id = 0;
159 }
160 if ($IdCmap) {
161 defoma_id_close_cache($IdCmap);
162 $IdCmap = 0;
163 }
164 if ($Sb1) {
165 defoma_subst_close($Sb1);
166 $Sb1 = 0;
167 }
168 if ($Sb2) {
169 defoma_subst_close($Sb2);
170 $Sb2 = 0;
171 }
172
173 return 0;
174}
175
176sub create_symlink {
177 my $font = shift;
178 my $dir = shift || $FontDir;
179
180 if ($font =~ /^(.*)\/(.+)$/) {
181 my $fontpath = $1;
182 my $fontfile = $2;
183 my $newfile = $dir . '/' . $fontfile;
184
185 return 1 if (-e $newfile);
186
187 symlink($font, $newfile) || return 1;
188 } else {
189 return 1;
190 }
191
192 return 0;
193}
194
195sub remove_symlink {
196 my $font = shift;
197 my $dir = shift || $FontDir;
198
199 if ($font =~ /^(.*)\/(.+)$/) {
200 my $fontpath = $1;
201 my $fontfile = $2;
202 my $newfile = $dir . '/' . $fontfile;
203
204 return 1 unless (-l $newfile);
205
206 unlink($newfile);
207 } else {
208 return 1;
209 }
210
211 return 0;
212}
213
214sub register_ps {
215 my $id = shift;
216
217 defoma_font_register('postscript', '<gs>/' . $id, @_);
218}
219
220sub unregister_ps {
221 my $id = shift;
222
223 if (defoma_font_if_register('postscript', '<gs>/' . $id)) {
224 defoma_font_unregister('postscript', '<gs>/' . $id);
225 }
226}
227
228sub t1_register {
229 my $type = shift;
230 my $font = shift;
231 my $h = parse_hints_start(@_);
232
233 my $fontname = $h->{FontName};
234 return 1 unless ($fontname);
235 $fontname =~ s/ .*//;
236
237 my $priority = $h->{Priority} || 0;
238
239 my %add;
240 $add{hints} = join(' ', @_);
241
242 if ($type eq 'gsfontderivative') {
243 my $ofont = $h->{'GSF-OriginFont'};
244 my $oid = $h->{'GSF-OriginID'};
245
246 if ($ofont && $oid) {
247 $add{depend} = $ofont.' '.$oid;
248 } else {
249 return 2;
250 }
251 }
252
253 return 3 if (create_symlink($font));
254
255 defoma_id_register($Id, type => 'real', font => $font, id => $fontname,
256 priority => $priority, %add);
257
258 my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : ();
259 my $i;
260
261 foreach $i (@alias) {
262 defoma_id_register($Id, type => 'alias', font => $font, id => $i,
263 priority => $priority, origin => $fontname);
264 }
265
266 defoma_subst_register($Sb1, $font, $fontname);
267 defoma_subst_register($Sb2, $font, $fontname);
268
269 return 0;
270}
271
272sub t1_unregister {
273 my $font = shift;
274
275 defoma_subst_unregister($Sb1, $font);
276 defoma_subst_unregister($Sb2, $font);
277 defoma_id_unregister($Id, type => 'alias', font => $font);
278 defoma_id_unregister($Id, type => 'real', font => $font);
279
280 remove_symlink($font);
281
282 return 0;
283}
284
285sub t1_install {
286 my $type = shift;
287 my $font = shift;
288 my $id = shift;
289 my $depfont = shift;
290 my $depid = shift;
291 my @add = ();
292
293 if ($type eq 'real') {
294 return 0 if (grep($_ eq '--Alias', @_));
295
296 $add[0] = '--RealName';
297 }
298
299 register_ps($id, @_, @add);
300
301 return 0;
302}
303
304sub t1_remove {
305 my $type = shift;
306 my $font = shift;
307 my $id = shift;
308 my $depfont = shift;
309 my $depid = shift;
310
311 unregister_ps($id);
312
313 return 0;
314}
315
316sub type1 {
317 my $com = shift;
318
319 if ($com eq 'register') {
320 return t1_register('type1', @_);
321 } elsif ($com eq 'unregister') {
322 return t1_unregister(@_);
323 } elsif ($com =~ /^do-install-(.*)$/) {
324 return t1_install($1, @_);
325 } elsif ($com =~ /^do-remove-(.*)$/) {
326 return t1_remove($1, @_);
327 } elsif ($com eq 'init') {
328 return init();
329 } elsif ($com eq 'term') {
330 return term();
331 }
332
333 return 0;
334}
335
336sub type3 {
337 return type1(@_);
338}
339
340sub gsfontderivative {
341 my $com = shift;
342
343 if ($com eq 'register') {
344 return t1_register('gsfontderivative', @_);
345 } else {
346 return type1($com, @_);
347 }
348}
349
350sub tt_register_cjk {
351 my %addstr = ('Japanese' => '-Ja',
352 'Korean' => '-Ko',
353 'Chinese-China' => '-GB',
354 'Chinese-Taiwan' => '-CNS');
355 my %ordering = ('Japanese' => 'Japan1',
356 'Korean' => 'Korea1',
357 'Chinese-China' => 'GB1',
358 'Chinese-Taiwan' => 'CNS1');
359 my %coding = ('Unicode' => 'Unicode',
360 'BIG5' => 'Big5',
361 'ShiftJIS' => 'ShiftJIS',
362 'WanSung' => 'WanSung',
363 'Johab' => 'Johab');
364
365 my $cnt = shift;
366 my $loc = shift;
367 my $font = shift;
368 my $fontname = shift;
369 my $alias = shift;
370 my $charset = shift;
371 my $encoding = shift;
372 my $priority = shift;
373
374 return $cnt unless (exists($addstr{$loc}) && exists($ordering{$loc}) &&
375 exists($coding{$encoding}));
376 my $ord = $ordering{$loc};
377 my $enc = $coding{$encoding};
378
379 my $add = '';
380 $add = $addstr{$loc} if ($cnt > 0);
381
382 my @hints = ('Adobe', $ord, $enc,
383 '--CIDRegistry', 'Adobe', '--CIDOrdering', $ord);
384
385 defoma_id_register($Id, type => 'real', font => $font,
386 id => $fontname . $add, priority => $priority,
387 category => 'truetype-cjk',
388 hints => join(' ', @hints, @_));
389
390 foreach my $i (@{$alias}) {
391 defoma_id_register($Id, type => 'alias', font => $font,
392 id => $i . $add, priority => $priority,
393 category => 'truetype-cjk',
394 origin => $fontname . $add);
395 }
396
397 defoma_subst_register($Sb1, $font, $fontname . $add);
398 defoma_subst_register($Sb2, $font, $fontname . $add);
399
400 $cnt++;
401 return $cnt unless ($charset =~ /JISX0212/ && $loc eq 'Japanese' &&
402 $encoding eq 'Unicode');
403
404 $add = '-JaH';
405 @hints = ('Adobe', 'Japan2', 'Unicode',
406 '--CIDRegistry', 'Adobe', '--CIDOrdering', 'Japan2');
407
408 defoma_id_register($Id, type => 'real', font => $font,
409 id => $fontname . $add, priority => $priority,
410 category => 'truetype-cjk',
411 hints => join(' ', @hints, @_));
412
413 foreach my $i (@{$alias}) {
414 defoma_id_register($Id, type => 'alias', font => $font,
415 id => $i . $add, priority => $priority,
416 category => 'truetype-cjk',
417 origin => $fontname . $add);
418 }
419
420 defoma_subst_register($Sb1, $font, $fontname . $add);
421 defoma_subst_register($Sb2, $font, $fontname . $add);
422
423 $cnt++;
424 return $cnt;
425}
426
427sub tt_register {
428 my $font = shift;
429 my $h = parse_hints_start(@_);
430 my $i;
431
432 my $fontname = $h->{FontName};
433 my $location = $h->{Location};
434 my $encoding = $h->{Encoding};
435 my $priority = $h->{Priority} || 0;
436 my $charset = $h->{Charset};
437
438 return 1 unless ($fontname && $location && $encoding);
439 $fontname =~ s/ .*//;
440 my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : ();
441
442 return 2 if (create_symlink($font));
443
444 parse_hints_cut($h, 'Encoding', 'Location', 'FontName');
445 my @hints;
446
447 if ($location !~ /Japanese|Korean|Chinese/) {
448 @hints = parse_hints_build($h);
449
450 defoma_id_register($Id, type => 'real', font => $font, id => $fontname,
451 priority => $priority, hints => join(' ', @hints));
452
453 foreach $i (@alias) {
454 defoma_id_register($Id, type => 'alias', font => $font, id => $i,
455 priority => $priority, origin => $fontname);
456 }
457
458 defoma_subst_register($Sb1, $font, $fontname);
459 defoma_subst_register($Sb2, $font, $fontname);
460 } else {
461 parse_hints_cut($h, 'Charset');
462 @hints = parse_hints_build($h);
463
464 my $loc;
465 my @locs = split(/ /, $location);
466 my $cnt = 0;
467
468 foreach $loc (@locs) {
469 $cnt = tt_register_cjk($cnt, $loc, $font, $fontname, \@alias,
470 $charset, $encoding, $priority, @hints);
471 }
472 }
473
474 return 0;
475}
476
477sub tt_unregister {
478 my $font = shift;
479
480 defoma_subst_unregister($Sb1, $font);
481 defoma_subst_unregister($Sb2, $font);
482 defoma_id_unregister($Id, type => 'alias', font => $font);
483 defoma_id_unregister($Id, type => 'real', font => $font);
484
485 remove_symlink($font);
486
487 return 0;
488}
489
490sub tt_install {
491 my $type = shift;
492 my $font = shift;
493 my $id = shift;
494 my $depfont = shift;
495 my $depid = shift;
496
497 my @add = ();
498
499 $add[0] = '--RealName' if ($type eq 'real');
500
501 register_ps($id, @_, @add);
502
503 return 0;
504}
505
506sub tt_remove {
507 my $type = shift;
508 my $font = shift;
509 my $id = shift;
510 my $depfont = shift;
511 my $depid = shift;
512
513 unregister_ps($id);
514
515 return 0;
516}
517
518sub truetype {
519 my $com = shift;
520
521 if ($com eq 'register') {
522 return tt_register(@_);
523 } elsif ($com eq 'unregister') {
524 return tt_unregister(@_);
525 } elsif ($com =~ /^do-install-(.*)$/) {
526 return tt_install($1, @_);
527 } elsif ($com =~ /^do-remove-(.*)$/) {
528 return tt_remove($1, @_);
529 } elsif ($com eq 'init') {
530 return init();
531 } elsif ($com eq 'term') {
532 return term();
533 }
534
535 return 0;
536}
537
538sub truetype_cjk {
539 my $com = shift;
540
541 if ($com =~ /^do-install-(.*)$/) {
542 return cid_install($1, @_);
543 } elsif ($com =~ /^do-remove-(.*)$/) {
544 return cid_remove($1, @_);
545 } elsif ($com eq 'init') {
546 return init();
547 } elsif ($com eq 'term') {
548 return term();
549 }
550
551 return 0;
552}
553
554sub cid_register {
555 my $type = shift;
556 my $font = shift;
557 my $h = parse_hints_start(@_);
558
559 my $fontname = $h->{FontName};
560 my $registry = $h->{CIDRegistry};
561 my $ordering = $h->{CIDOrdering};
562 my $priority = $h->{Priority} || 0;
563
564 return 1 unless($fontname && $registry && $ordering);
565 $fontname =~ s/ .*//;
566 $registry =~ s/ .*//;
567 $ordering =~ s/ .*//;
568 my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : ();
569
570 return 2 if (create_symlink($font));
571
572 parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding');
573 my @hints = parse_hints_build($h);
574 @hints = ($registry, $ordering, '.', @hints);
575
576 defoma_id_register($Id, type => 'real', font => $font,
577 id => $fontname, priority => $priority,
578 category => $type, hints => join(' ', @hints));
579
580 my $i;
581 foreach $i (@alias) {
582 defoma_id_register($Id, type => 'alias', font => $font, id => $i,
583 priority => $priority, origin => $fontname,
584 category => $type);
585 }
586
587 defoma_subst_register($Sb1, $font, $fontname);
588 defoma_subst_register($Sb2, $font, $fontname);
589
590 return 0;
591}
592
593sub cid_unregister {
594 my $font = shift;
595
596 defoma_subst_unregister($Sb1, $font);
597 defoma_subst_unregister($Sb2, $font);
598 defoma_id_unregister($Id, type => 'alias', font => $font);
599 defoma_id_unregister($Id, type => 'real', font => $font);
600
601 remove_symlink($font);
602
603 return 0;
604}
605
606sub cid_install_all {
607 my $type = shift;
608 my $id = shift;
609 my $registry = shift;
610 my $ordering = shift;
611
612 my @cmaps = defoma_id_get_font($IdCmap, 'installed');
613 foreach my $c (@cmaps) {
614 my @chs = split(/ +/, $IdCmap->{7}->[$c]);
615
616 next if ($chs[0] ne $registry);
617 next if ($chs[1] ne $ordering && $chs[1] ne 'Identity');
618
619 shift(@chs);
620 shift(@chs);
621
622 my $psname = $id . '-' . $IdCmap->{0}->[$c];
623
624 my @add = ();
625 $add[0] = '--RealName' if ($type eq 'real');
626
627 register_ps($psname, @_, @add, @chs);
628 }
629
630 return 0;
631}
632
633sub cid_remove_all {
634 my $type = shift;
635 my $id = shift;
636 my $registry = shift;
637 my $ordering = shift;
638
639 my @cmaps = defoma_id_get_font($IdCmap, 'installed');
640 foreach my $c (@cmaps) {
641 my @chs = split(/ +/, $IdCmap->{7}->[$c]);
642
643 next if ($chs[0] ne $registry);
644 next if ($chs[1] ne $ordering && $chs[1] ne 'Identity');
645
646 my $psname = $id . '-' . $IdCmap->{0}->[$c];
647
648 unregister_ps($psname);
649 }
650
651 return 0;
652}
653
654sub cid_install {
655 my $type = shift;
656 my $font = shift;
657 my $id = shift;
658 my $depfont = shift;
659 my $depid = shift;
660 my $registry = shift;
661 my $ordering = shift;
662 my $encoding = shift;
663
664 cid_install_all($type, $id, $registry, $ordering, @_);
665
666 return 0;
667}
668
669sub cid_remove {
670 my $type = shift;
671 my $font = shift;
672 my $id = shift;
673 my $depfont = shift;
674 my $depid = shift;
675 my $registry = shift;
676 my $ordering = shift;
677 my $encoding = shift;
678
679 cid_remove_all($type, $id, $registry, $ordering);
680
681 return 0;
682}
683
684sub cid {
685 my $com = shift;
686
687 if ($com eq 'register') {
688 return cid_register('cid', @_);
689 } elsif ($com eq 'unregister') {
690 return cid_unregister(@_);
691 } elsif ($com =~ /^do-install-(.*)$/) {
692 return cid_install($1, @_);
693 } elsif ($com =~ /^do-remove-(.*)$/) {
694 return cid_remove($1, @_);
695 } elsif ($com eq 'init') {
696 return init();
697 } elsif ($com eq 'term') {
698 return term();
699 }
700
701 return 0;
702}
703
704sub cmap_register {
705 my $font = shift;
706
707 if ($font =~ /\/gs-cjk-resource\//) {
708 return 2 if (create_symlink($font, $CMapDir));
709 return 0;
710 }
711
712 my $h = parse_hints_start(@_);
713
714 my $cmap = $h->{CMapName};
715 my $reg = $h->{CIDRegistry};
716 my $ord = $h->{CIDOrdering};
717
718 return 1 unless ($cmap && $reg && $ord);
719 $reg =~ s/ .*//;
720 $ord =~ s/ .*//;
721 $cmap =~ s/ .*//;
722
723 my @hints = ($reg, $ord, @_);
724
725 defoma_id_register($IdCmap, type => 'real', font => $font, id => $cmap,
726 priority => 0, hints => join(' ', @hints));
727
728 return 0;
729}
730
731sub cmap_unregister {
732 my $font = shift;
733
734 if ($font =~ /\/gs-cjk-resource\//) {
735 remove_symlink($font, $CMapDir);
736 return 0;
737 }
738
739 defoma_id_unregister($IdCmap, type => 'real', font => $font);
740
741 return 0;
742}
743
744sub cmap_install {
745 my $font = shift;
746 my $cmap = shift;
747 my $df = shift;
748 my $di = shift;
749 my $reg = shift;
750 my $ord = shift;
751 my %hash;
752 my @nonreal = ();
753
754 return 1 if (create_symlink($font, $CMapDir));
755
756 my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'),
757 defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk'));
758
759 foreach my $i (@list) {
760 my $type = $Id->{2}->[$i];
761 my $id = $Id->{0}->[$i];
762
763 if ($type ne 'SrI') {
764 push(@nonreal, $i);
765 next;
766 }
767
768 my @hints = split(/ +/, $Id->{7}->[$i]);
769
770 next if ($hints[0] ne $reg);
771 next if ($hints[1] ne $ord && $ord ne 'Identity');
772
773 $hash{$id} = $i;
774
775 shift(@hints);
776 shift(@hints);
777 shift(@hints);
778
779 my $psname = $id . '-' . $cmap;
780
781 register_ps($psname, @hints, '--RealName', @_);
782 }
783
784 foreach my $i (@nonreal) {
785 my $depid = $Id->{5}->[$i];
786 next unless (exists($hash{$depid}));
787
788 my @hints = split(/ +/, $Id->{7}->[$hash{$depid}]);
789
790 next if ($hints[0] ne $reg);
791 next if ($hints[1] ne $ord && $ord ne 'Identity');
792
793 shift(@hints);
794 shift(@hints);
795 shift(@hints);
796
797 my $psname = $Id->{0}->[$i] . '-' . $cmap;
798
799 register_ps($psname, @hints, @_);
800 }
801
802 return 0;
803}
804
805sub cmap_remove {
806 my $font = shift;
807 my $cmap = shift;
808 my $df = shift;
809 my $di = shift;
810 my $reg = shift;
811 my $ord = shift;
812 my %hash;
813
814 remove_symlink($font, $CMapDir);
815
816 my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'),
817 defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk'));
818
819 foreach my $i (@list) {
820 my @hints = split(/ +/, $Id->{7}->[$i]);
821
822 if (@hints > 0) {
823 next if ($hints[0] ne $reg);
824 next if ($hints[1] ne $ord && $ord ne 'Identity');
825 }
826
827 my $psname = $Id->{0}->[$i] . '-' . $cmap;
828
829 unregister_ps($psname);
830 }
831
832 return 0;
833}
834
835sub cmap {
836 my $com = shift;
837
838 if ($com eq 'register') {
839 return cmap_register(@_);
840 } elsif ($com eq 'unregister') {
841 return cmap_unregister(@_);
842 } elsif ($com eq 'do-install-real') {
843 return cmap_install(@_);
844 } elsif ($com eq 'do-remove-real') {
845 return cmap_remove(@_);
846 } elsif ($com eq 'init') {
847 return init();
848 } elsif ($com eq 'term') {
849 return term();
850 }
851
852 return 0;
853}
854
855sub psprint_register {
856 my $font = shift;
857 return 0 unless ($Subst4psprint);
858 return 1 if ($font !~ /(.+)\/(.+)/);
859
860 return 0 if ($1 eq '<gs>');
861 my $fontname = $2;
862
863 return 2 if ($Sb1->grep_rule('', $fontname));
864
865 my @hints;
866 my $h = parse_hints_start(@_);
867 my $cset = $h->{PSCharset};
868 my $enc = $h->{PSEncoding};
869
870 if ($cset && $enc && $cset =~ /^Adobe-([^-]+).*$/) {
871 my $ord = $1;
872 $fontname =~ s/-$enc$//;
873
874 parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding',
875 'Direction');
876 @hints = parse_hints_build($h);
877 push(@hints, '--CIDRegistry,*', 'Adobe', '--CIDOrdering,*', $ord);
878 } else {
879 @hints = @_;
880 }
881
882 for my $i (@hints) {
883 $i = '--Charset,*' if ($i eq '--Charset');
884 $i = '--Encoding,*' if ($i eq '--Encoding');
885 $i = '--Direction,*' if ($i eq '--Direction');
886 $i = '--Shape,2' if ($i eq '--Shape');
887 }
888
889 defoma_subst_add_rule($Sb1, $fontname, @hints);
890
891 return 0;
892}
893
894sub psprint_unregister {
895 my $font = shift;
896 return 0 if ($font !~ /(.+)\/(.+)/);
897
898 return 0 if ($1 eq '<gs>');
899 my $fontname = $2;
900
901 my $h = parse_hints_start(@_);
902 my $cset = $h->{PSCharset};
903 my $enc = $h->{PSEncoding};
904
905 if ($cset && $enc && $cset =~ /^Adobe-.*$/) {
906 $fontname =~ s/-$enc$//;
907 }
908
909 defoma_subst_remove_rule($Sb1, $fontname);
910
911 return 0;
912}
913
914sub psprint {
915 my $com = shift;
916
917 if ($com eq 'register') {
918 return psprint_register(@_);
919 } elsif ($com eq 'unregister') {
920 return psprint_unregister(@_);
921 } elsif ($com eq 'init') {
922 return init();
923 } elsif ($com eq 'term') {
924 return term();
925 }
926
927 return 0;
928}
929
9301;
9310
=== modified file 'debian/rules'
--- debian/rules 2009-09-18 15:37:23 +0000
+++ debian/rules 2010-05-23 18:44:26 +0000
@@ -27,7 +27,7 @@
27 --with-ijs --with-jbig2dec --with-jasper --with-x --disable-gtk \27 --with-ijs --with-jbig2dec --with-jasper --with-x --disable-gtk \
28 --enable-dynamic --with-omni --enable-cups --disable-compile-inits \28 --enable-dynamic --with-omni --enable-cups --disable-compile-inits \
29 --disable-cairo --with-drivers=ALL \29 --disable-cairo --with-drivers=ALL \
30 --with-fontpath=/var/lib/defoma/gs.d/dirs/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts30 --with-fontpath=/var/lib/ghostscript/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts
31DEB_MAKE_BUILD_TARGET := STDDIRS $(FT_OPTS)31DEB_MAKE_BUILD_TARGET := STDDIRS $(FT_OPTS)
32DEB_MAKE_INSTALL_TARGET := soinstall install-shared install-cups install-contrib-extras \32DEB_MAKE_INSTALL_TARGET := soinstall install-shared install-cups install-contrib-extras \
33 DESTDIR=$(CURDIR)/debian/ghostscript \33 DESTDIR=$(CURDIR)/debian/ghostscript \
@@ -52,7 +52,7 @@
52 -cd jasper && $(MAKE) distclean52 -cd jasper && $(MAKE) distclean
53 [ ! -f Makefile ] || $(MAKE) soclean53 [ ! -f Makefile ] || $(MAKE) soclean
54 [ ! -f Makefile ] || $(MAKE) distclean54 [ ! -f Makefile ] || $(MAKE) distclean
55 # These are somehow left...55 # These are somehow left...
56 -rm -rf sobin soobj cups/pstopxl cups/pstoraster56 -rm -rf sobin soobj cups/pstopxl cups/pstoraster
5757
58build/ghostscript::58build/ghostscript::
@@ -76,9 +76,6 @@
76 rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc/cups76 rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc/cups
77 rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc77 rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc
7878
79 # Install Defoma script
80 install -m 644 $(CURDIR)/debian/gs.defoma $(CURDIR)/debian/ghostscript/usr/share/defoma/scripts
81
82 # Remove some of the scripts79 # Remove some of the scripts
83 rm $(CURDIR)/debian/ghostscript/usr/bin/unix-lpr.sh $(CURDIR)/debian/ghostscript/usr/bin/lprsetup.sh $(CURDIR)/debian/ghostscript/usr/bin/pv.sh $(CURDIR)/debian/ghostscript/usr/bin/fixmswrd.pl80 rm $(CURDIR)/debian/ghostscript/usr/bin/unix-lpr.sh $(CURDIR)/debian/ghostscript/usr/bin/lprsetup.sh $(CURDIR)/debian/ghostscript/usr/bin/pv.sh $(CURDIR)/debian/ghostscript/usr/bin/fixmswrd.pl
8481
@@ -89,14 +86,16 @@
89 rm -f $(CURDIR)/debian/ghostscript/usr/bin/gsx86 rm -f $(CURDIR)/debian/ghostscript/usr/bin/gsx
9087
91 # Do not include the shipped Fontmaps, since Fontmaps will be88 # Do not include the shipped Fontmaps, since Fontmaps will be
92 # automatically generated by Defoma. 89 # automatically generated by update-gsfontmap.
93 # You may find them in /var/lib/defoma/gs.d/dirs/fonts/90 # You may find them in /var/lib/ghostscript/fonts/
94 GSVERSION=`ls -1 $(CURDIR)/debian/ghostscript/usr/share/ghostscript/ | head -1`; \91 GSVERSION=`ls -1 $(CURDIR)/debian/ghostscript/usr/share/ghostscript/ | head -1`; \
95 rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/Fontmap*; \92 rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/Fontmap*; \
96 rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/cidfmap93 rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/cidfmap
9794
98 # Rename /usr/bin/gsc, to not conflict with gambc95 # Rename /usr/bin/gsc, to not conflict with gambc
99 mv $(CURDIR)/debian/ghostscript/usr/bin/gsc $(CURDIR)/debian/ghostscript/usr/bin/gs96 mv $(CURDIR)/debian/ghostscript/usr/bin/gsc $(CURDIR)/debian/ghostscript/usr/bin/gs
97 mkdir -p $(CURDIR)/debian/ghostscript/usr/sbin/
98 install -m 755 debian/update-gsfontmap $(CURDIR)/debian/ghostscript/usr/sbin/
10099
101 # Some convenience links100 # Some convenience links
102 ln -s /usr/bin/gs $(CURDIR)/debian/ghostscript/usr/bin/ghostscript101 ln -s /usr/bin/gs $(CURDIR)/debian/ghostscript/usr/bin/ghostscript
103102
=== added file 'debian/update-gsfontmap'
--- debian/update-gsfontmap 1970-01-01 00:00:00 +0000
+++ debian/update-gsfontmap 2010-05-23 18:44:26 +0000
@@ -0,0 +1,20 @@
1#!/bin/sh
2# update-gsfontmap
3# Copyright 2010 Kenshi Muto <kmuto@debian.org>
4# License: GPL
5
6CIDFMAP=/var/lib/ghostscript/fonts/cidfmap
7FONTMAP=/var/lib/ghostscript/fonts/Fontmap
8CIDFDIR=/etc/ghostscript/cidfmap.d/
9FONTMDIR=/etc/ghostscript/fontmap.d/
10
11rm -f $CIDFMAP $FONTMAP
12touch $CIDFMAP $FONTMAP
13
14for i in $CIDFDIR/*.conf; do
15 cat $i >> $CIDFMAP
16done 2>/dev/null
17
18for i in $FONTMDIR/*.conf; do
19 cat $i >> $FONTMAP
20done 2>/dev/null

Subscribers

People subscribed via source and target branches

to all changes: