[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: latex-cjk upload to unstable ...



From: Frank Küster <frank@debian.org>

> (Note that I'm changing to the new list)
> 
> Danai SAE-HAN (韓達耐) <danai.sae-han@skynet.be> wrote:
> 
> > So there are two easy solutions:
> > (1) either I won't redirect it anymore, or I will redirect it to the
> >     screen as well (it's not that many people will build the package
> >     themselves, I suspect).   This option carries my favour;
> > (2) or I could redirect the output to a file in /tmp.  If I would
> >     choose this last way, do I need to name the logs with $RANDOM in
> >     the filename (Debian policy doesn't say anything about it, but I
> >     have noticed that quite a few packages do this)?  Or can I call it
> >     anything I like?  And would you suggest to delete the logfile
> >     after the last successful command?
> >
> > A less elegant way would be to put an if clause around every command.
> 
> Hm.  I really don't understand why the Makefile snippet that I posted
> wouldn't work.  Can you upload somewhere your current state of work?
> Then I would try to find a way to do the redirection as I think it
> should be done.

I'll attach the "rules" file.  If you want, I could also host it
somewhere.

Well, the snippet in target "all:" works of course.  But I tried
getting the run_command to work, but to no avail.

cd build; \
  if ./wftodm -FontBase dg wadalab-sym/jis*.ps wadalab-gothic-0-13/goth-*.ps > log 2>&1 && \
  ./wftodm -FontBase dm wadalab-sym/jis*.ps wadalab-mincho-0-12/min-*.ps >> log 2>&1 && \
  ./wftodm -FontBase mc wadalab-sym/jis*.ps wadalab-mincho-0-8/min-*.ps >> log 2>&1 && \
  ./wftodm -FontBase mr wadalab-sym/jis*.ps wadalab-maru-0-8/maru-*.ps >> log 2>&1; then echo "OK"; else echo "Super error!!"; fi

Causes a "bus error" and completely crashes my system every time!  I
suppose it's something to do with the && and || on one line.


I think I better do something like I'm doing right now in another
Makefile to build Korean HLaTeX Unicode fonts for CJK, which you can
also see in attachment hlatex-fonts.Makefile-20060803-5.
That is, to break up the wftodm and makefont commands and use
variables.

(You can find the snippet in the attached "rules" file.)

wftodm = ./wftodm
namestems = dg dm mc mr mc2 mr2
dg_dirs = wadalab-sym/jis*.ps wadalab-gothic-0-13/goth-*.ps
dm_dirs = wadalab-sym/jis*.ps wadalab-mincho-0-12/min-*.ps
mc_dirs = wadalab-sym/jis*.ps wadalab-mincho-0-8/min-*.ps
mr_dirs = wadalab-sym/jis*.ps wadalab-maru-0-8/maru-*.ps
mc2_dirs = mc2 wadalab-mincho-1-8/min*.ps
mr2_dirs = wadalab-maru-1-8/maru*.ps

test2:
	cd build;\
	for i in $(namestems);\
	  do if echo $(wftodm) -FontBase $$i $(shell printf '$$i'_dirs);\
	    then echo OK;\
	    else echo Failed; cat log;\
	  fi;\
	done

But I have a problem expanding '$$i' inside $().  I could also do
something like $(test_font): and use abbrev = $(patsubst ...
like I do in the HLaTeX Makefile.  But if I can do it with $$i, it
would be simpler.
Do you know how I can expand $$i correctly?


> As for the file in /tmp, I don't think that makes sense.  This is a log
> file with no sensitive content, and you do not analyse its content.  I
> see no reason not to just call it ./log, or maybe more descriptive
> ./font-generation.log.  When we use tempfiles in maintainer scripts,
> then it is because we grep for some error or success messages in them,
> and let the script act accordingly.  In this case a predictable filename
> must be avoided, because somebody else could interfere, e.g. with a
> symlink attack, and cause the installation to fail although the output
> contained the success message, or the other way round.  The impact of
> such an attack on a TeX package is not large, but it's a general
> security risk and therefore generally something to be avoided.
> But not for output that is just displayed for the information of the
> human package builder in case the build fails.

IC.  So /tmp is a nono.


Best regards



Danai SAE-HAN
韓達耐

-- 
题目:《春怀示邻里》
作者:陈师道(1053-1101)

断墙着雨蜗成字,老屋无僧燕作家,
剩欲出门追语笑,却嫌归鬓著尘沙。
风翻蛛网开三面,雷动蜂窠趁两衙。
屡失南邻春事约,只今容有未开花。
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

SHELL = /bin/sh

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#CFLAGS = -Wall -g -O2

# RUN = run_command(){ command="$$*" echo -n "Running $$command ..." \
#    if $$command >> log 2>&1; then \
#       echo "Done." \
#    else \
#       echo "Failed!" \
#       echo "Please check out the file 'log' to see what has happened." \
#    fi

# if sh ./makefont >> log 2>&1; then
#    echo done
# else
#    echo "Error running makefont"
#    cat log
# fi

#wftodm = if ./wftodm >> log 2>&1; then;\
	    echo done;\
	   else echo "Error running makefont";\
	    cat log;\
	   fi

wftodm = ./wftodm
namestems = dg dm mc mr mc2 mr2
dg_dirs = wadalab-sym/jis*.ps wadalab-gothic-0-13/goth-*.ps
dm_dirs = wadalab-sym/jis*.ps wadalab-mincho-0-12/min-*.ps
mc_dirs = wadalab-sym/jis*.ps wadalab-mincho-0-8/min-*.ps
mr_dirs = wadalab-sym/jis*.ps wadalab-maru-0-8/maru-*.ps
mc2_dirs = mc2 wadalab-mincho-1-8/min*.ps
mr2_dirs = wadalab-maru-1-8/maru*.ps

test1:
#	if ls $(directory) > log 2>&1; false; then
	if cc -Wall -g -O2 -o build/wftodm wftodm.c ; then echo done; \
	else echo failed; cat log; \
	fi

test2:
# Here's an idea.  I break up the wftodm command into several parts.
# It would become:
	cd build;\
	for i in $(namestems);\
	  do if echo $(wftodm) -FontBase $$i $(shell printf '$$i'_dirs);\
	    then echo OK;\
	    else echo Failed; cat log;\
	  fi;\
	done
#	cd build; $(wftodm) -FontBase dg wadalab-sym/jis*.ps wadalab-gothic-0-13/goth-*.ps

build: build-stamp
build-stamp: patch
	dh_testdir

	mkdir build
	cc -Wall -g -O2 -o build/wftodm wftodm.c

	for i in ./*.tar.gz; do ( cd build && echo "Unpacking $$i." && tar xzf ../$$i ); done

	cp debian/latex-cjk/{fixwada2.pl,makeuniwada.pl,DNP.sfd,makefont} debian/JIS02*.TXT build/

	# You can find a log of what's happening in build/log.
	cd build; \
	  ./wftodm -FontBase dg wadalab-sym/jis*.ps wadalab-gothic-0-13/goth-*.ps > log 2>&1 && \
	  ./wftodm -FontBase dm wadalab-sym/jis*.ps wadalab-mincho-0-12/min-*.ps >> log 2>&1 && \
	  ./wftodm -FontBase mc wadalab-sym/jis*.ps wadalab-mincho-0-8/min-*.ps >> log 2>&1 && \
	  ./wftodm -FontBase mr wadalab-sym/jis*.ps wadalab-maru-0-8/maru-*.ps >> log 2>&1
	@echo

# 	cd build; ./wftodm -FontBase mc2 wadalab-mincho-1-8/min*.ps >> log 2>&1
# 	cd build; ./wftodm -FontBase mr2 wadalab-maru-1-8/maru*.ps >> log 2>&1
	@echo

	cd build; sh makefont >> log 2>&1
	@echo

	cd build; \
		perl fixwada2.pl dgj jis0208 >> log 2>&1; \
		perl fixwada2.pl mrj jis0208 >> log 2>&1; \
		perl fixwada2.pl mr2j jis0212 >> log 2>&1; \
		perl fixwada2.pl dmj jis0208 >> log 2>&1; \
		perl fixwada2.pl mcj jis0208 >> log 2>&1; \
		perl fixwada2.pl mc2j jis0212 >> log 2>&1
	@echo

	cd build; \
		perl makeuniwada.pl dgj udgj >> log 2>&1; \
		perl makeuniwada.pl mrj mr2j umrj >> log 2>&1; \
		perl makeuniwada.pl dmj mc2j udmj >> log 2>&1; \
		perl makeuniwada.pl mcj mc2j umcj >> log 2>&1
	@echo

	touch build-stamp

clean: clean1 unpatch

clean1:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# Add here commands to clean up after the build process.
#	-$(MAKE) clean

	rm -rf build

	dh_clean

install: #build
	dh_testdir
	dh_testroot
#	dh_clean -k 
	dh_installdirs


# Build architecture-independent files here.
binary-indep: #build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_install
	dh_installtex --flavor=map:config_for_all_maps map=Map,wadalab.map
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
# "wftodm" doesn't need to be installed, so there's nothing to do here.
binary-arch: install #build install

# And now the simple things for dpatch. Here we only apply/unapply the patches.
# You can do more things with dpatch, like having patches only applied on
# a special architecture - see the non-dh version of the sample for this!
patch: patch-stamp
patch-stamp:
	dpatch apply-all

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary install patch unpatch clean1
#!/usr/bin/make -f
# -*- makefile -*-

# Copyright (C) 2006  Danai SAE-HAN <danai.sae-han@skynet.be>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in /usr/share/common-licenses/GPL-2;
# if not, write to the Free Software Foundation, Inc., 51 Franklin St,
# Fifth Floor, Boston, MA 02110-1301 USA.
#
# You can find a copy of the GNU General Public License online at
# http://www.gnu.org/licenses/gpl.txt or on Debian systems under
# /usr/share/common-licenses/GPL-2 (part of the "base-files" package).


# General variables:

allfonts = bom dinary gothic graphic gungseo jamo myoungjo pen pilgi pilgia shinmun taza vada yetgul
# Fonts to build
#fonts = bm dn gt gr gs jgt jmj jnv jsr mj ph pn pg pga sh tt vd yt
fonts = bm dn gt gr gs jgt jmj jnv jsr mj ph pn pg pga sh tt vd yt
variants = o c co x xo u uo
texmf = /usr/share/texmf
sfdfile_hangul = UKS-HLaTeX-Hangul.sfd
sfdfile_hangul_symbol = UKS-HLaTeX-Hangul_Symbol.sfd
sfdfile_hangul_hanja = UKS-HLaTeX-Hangul_Hanja.sfd
sfdfile_hangul_symbol_hanja = UKS-HLaTeX.sfd
sfdfile = $(sfdfile_$($(abbrev)_sfd))
hlatex2agl_hangul = hlatex2agl-hangul.pl
hlatex2agl_hangul_symbol = hlatex2agl-hangul_symbol.pl
hlatex2agl_hangul_hanja = hlatex2agl-hangul_hanja.pl
hlatex2agl_hangul_symbol_hanja = hlatex2agl.pl
hlatex2agl = $(hlatex2agl_$($(abbrev)_sfd))
fdfile = $(fontname)/c70$(namestem).fd


# Font options:

# Bom 봄글씨
bm_fontname = bom
bm_namestem = bm
bm_virtual_namestem = wbm
bm_real_namestem = ubm
bm_bold = no
bm_sfd = hangul

# Dinaru 디나루
dn_fontname = dinaru
dn_namestem = dn
dn_virtual_namestem = wdn
dn_real_namestem = udn
dn_bold = yes
#dn_dep_vf = ugt00 ugt01 ugt03 umj04
#dn_bad_vf = 04 05 06 07
dn_sfd = hangul

# Dinaru light
dnl_fontname = dinaru
dnl_namestem = dnl
dnl_virtual_namestem = wdnl
dnl_real_namestem = udnl
dnl_bold = no
#dnl_dep_vf = ugt00 ugt01 ugt03 umj04
#dnl_bad_vf = 04 05 06 07
dnl_sfd = hangul

# Strange, no warnings in the log.  Perhaps because the original .pfb file has CR/LF lines (^M) and the new .pfb just LF lines?
# Or perhaps because the new .pfb names are exactly the same as those in the original UHC directory?
# The new .pfb files below don't have "AGL compliant glyph names added by script hlatex2agl.pl 2005-Jul-27." at the beginning of the file; others, like Myoungjo, have this line.
# EUC-KR codes are changed with Unicode ones.
# dvips: Checksum mismatch in udn10
# dvips: Checksum mismatch in udn11
# dvips: Checksum mismatch in udnbx10
# dvips: Checksum mismatch in udnbx11
# dvips: Checksum mismatch in udno10
# dvips: Checksum mismatch in udno11
# dvips: Checksum mismatch in udnbxo10
# dvips: Checksum mismatch in udnbxo11
# dvips: Checksum mismatch in udnl10
# dvips: Checksum mismatch in udnl11
# dvips: Checksum mismatch in udnlx10
# dvips: Checksum mismatch in udnlx11
# dvips: Checksum mismatch in udnlo10
# dvips: Checksum mismatch in udnlo11
# dvips: Checksum mismatch in udnlxo10
# dvips: Checksum mismatch in udnlxo11

# Graphic 그래픽
gr_fontname = graphic
gr_namestem = gr
gr_virtual_namestem = wgr
gr_real_namestem = ugr
gr_bold = yes
gr_dep_vf = ugt00 ugt01 ugt03 umj04
# ugtb00 ugtb01 ugtb03 umjb04
gr_bad_vf = 04 05 06 07
gr_sfd = hangul_symbol

# Disappeared.  I ran hlatex2agl too many times.
#Creating virtual property list file `wgr07.vf.vpl'...
#Illegal hexadecimal digit 'g' ignored at hlatex2agl-hangul_symbol.pl line 392, <INFILE> line 128.
#Illegal hexadecimal digit 'p' ignored at hlatex2agl-hangul_symbol.pl line 392, <INFILE> line 200.
#Reading `wgr07.vf.vpl'...

#Processing 'ugr00.pfb'...
#Illegal hexadecimal digit 'g' ignored at hlatex2agl-hangul_symbol.pl line 446, <INFILE> line 165.
#Illegal hexadecimal digit 'g' ignored at hlatex2agl-hangul_symbol.pl line 446, <INFILE> line 2520.
#Processing `ugr01.pfb'...
#Illegal hexadecimal digit 'p' ignored at hlatex2agl-hangul_symbol.pl line 446, <INFILE> line 217.
#Illegal hexadecimal digit 'p' ignored at hlatex2agl-hangul_symbol.pl line 446, <INFILE> line 4560.
#Processing `ugr02.pfb'...

# Gothic 고딕
gt_fontname = gothic
gt_namestem = gt
gt_virtual_namestem = wgt
gt_real_namestem = ugt
gt_bold = yes
gt_dep_vf = umj04
gt_bad_vf = 05 06
gt_sfd = hangul_symbol_hanja

# Gungseo 궁서
gs_fontname = gungseo
gs_namestem = gs
gs_virtual_namestem = wgs
gs_real_namestem = ugs
gs_bold = no
gs_dep_vf = umjb00 umjb01 umjb03 umjb04
gs_bad_vf = 04 05 06 07
gs_sfd = hangul_symbol_hanja

# Jamo Gothic 자모 고딕
jgt_fontname = jamo
jgt_namestem = jgt
jgt_virtual_namestem = wjgt
jgt_real_namestem = jgt
jgt_bold = no
jgt_sfd = hangul

# Jamo Myoungjo 자모 명조
jmj_fontname = jamo
jmj_namestem = jmj
jmj_virtual_namestem = wjmj
jmj_real_namestem = jmj
jmj_bold = no
jmj_sfd = hangul

# Jamo 3 자모 노벨
jnv_fontname = jamo
jnv_namestem = jnv
jnv_virtual_namestem = wjnv
jnv_real_namestem = jnv
jnv_bold = no
jnv_sfd = hangul

# Jamo 4 자모 소라
jsr_fontname = jamo
jsr_namestem = jsr
jsr_virtual_namestem = wjsr
jsr_real_namestem = jsr
jsr_bold = no
jsr_sfd = hangul

# /usr/share/texmf/fonts/vf/uhc/jamo/wj*9.vf
# Bad VF file: Character 228 in font 0 will be ignored
# Bad VF file: Character 229 in font 0 will be ignored
# Bad VF file: Character 230 in font 0 will be ignored
# Bad VF file: Character 231 in font 0 will be ignored
# Bad VF file: Character 232 in font 0 will be ignored
# Bad VF file: Character 233 in font 0 will be ignored
# Bad VF file: Character 234 in font 0 will be ignored
# Bad VF file: Character 235 in font 0 will be ignored
# Bad VF file: Character 236 in font 0 will be ignored
# Bad VF file: Character 237 in font 0 will be ignored
# Bad VF file: Character 238 in font 0 will be ignored
# Bad VF file: Character 239 in font 0 will be ignored
# Bad VF file: Character 240 in font 0 will be ignored
# Bad VF file: Character 241 in font 0 will be ignored
# Bad VF file: Character 242 in font 0 will be ignored
# Bad VF file: Character 243 in font 0 will be ignored
# Bad VF file: Character 244 in font 0 will be ignored
# Bad VF file: Character 245 in font 0 will be ignored
# Bad VF file: Character 246 in font 0 will be ignored
# Bad VF file: Character 247 in font 0 will be ignored
# Bad VF file: Character 248 in font 0 will be ignored
# Bad VF file: Character 249 in font 0 will be ignored
# Bad VF file: Character 250 in font 0 will be ignored
# Bad VF file: Character 251 in font 0 will be ignored
# Bad VF file: Character 252 in font 0 will be ignored
# Bad VF file: Character 253 in font 0 will be ignored
# Bad VF file: Character 254 in font 0 will be ignored
# Use of uninitialized value in array element at hlatex2agl-hangul.pl line 341.
# Use of uninitialized value in sprintf at hlatex2agl-hangul.pl line 348.
# Use of uninitialized value in array element at hlatex2agl-hangul.pl line 349.

# Myoungjo 명조
mj_fontname = myoungjo
mj_namestem = mj
mj_virtual_namestem = wmj
mj_real_namestem = umj
mj_bold = yes
mj_sfd = hangul_symbol_hanja

# Pen 펜글씨
pn_fontname = pen
pn_namestem = pn
pn_virtual_namestem = wpn
pn_real_namestem = upn
pn_bold = no
pn_sfd = hangul

# Pen 2 펜흘림
ph_fontname = pen
ph_namestem = ph
ph_virtual_namestem = wph
ph_real_namestem = uph
ph_bold = no
ph_sfd = hangul

# Pilgi 필기
pg_fontname = pilgi
pg_namestem = pg
pg_virtual_namestem = wpg
pg_real_namestem = upg
pg_bold = yes
pg_sfd = hangul

# vftpvp /usr/share/texmf/fonts/vf/uhc/pilgi/wpg*9.vf
# Bad VF file: Character 200 in font 0 will be ignored
# Bad VF file: Character 209 in font 0 will be ignored
# Bad VF file: Character 210 in font 0 will be ignored
# Bad VF file: Character 211 in font 0 will be ignored
# Bad VF file: Character 212 in font 0 will be ignored
# Bad VF file: Character 213 in font 0 will be ignored
# Bad VF file: Character 214 in font 0 will be ignored
# Bad VF file: Character 215 in font 0 will be ignored
# Bad VF file: Character 216 in font 0 will be ignored
# Bad VF file: Character 217 in font 0 will be ignored
# Bad VF file: Character 218 in font 0 will be ignored
# Bad VF file: Character 219 in font 0 will be ignored
# Bad VF file: Character 220 in font 0 will be ignored
# Bad VF file: Character 221 in font 0 will be ignored
# Bad VF file: Character 222 in font 0 will be ignored
# Bad VF file: Character 223 in font 0 will be ignored
# Bad VF file: Character 224 in font 0 will be ignored
# Bad VF file: Character 225 in font 0 will be ignored
# Bad VF file: Character 226 in font 0 will be ignored
# Bad VF file: Character 227 in font 0 will be ignored
# Bad VF file: Character 228 in font 0 will be ignored
# Bad VF file: Character 229 in font 0 will be ignored
# Bad VF file: Character 230 in font 0 will be ignored
# Bad VF file: Character 231 in font 0 will be ignored
# Bad VF file: Character 232 in font 0 will be ignored
# Bad VF file: Character 233 in font 0 will be ignored
# Bad VF file: Character 234 in font 0 will be ignored
# Bad VF file: Character 235 in font 0 will be ignored
# Bad VF file: Character 236 in font 0 will be ignored
# Bad VF file: Character 237 in font 0 will be ignored
# Bad VF file: Character 238 in font 0 will be ignored
# Bad VF file: Character 239 in font 0 will be ignored
# Bad VF file: Character 240 in font 0 will be ignored
# Bad VF file: Character 241 in font 0 will be ignored
# Bad VF file: Character 242 in font 0 will be ignored
# Bad VF file: Character 243 in font 0 will be ignored
# Bad VF file: Character 244 in font 0 will be ignored
# Bad VF file: Character 245 in font 0 will be ignored
# Bad VF file: Character 246 in font 0 will be ignored
# Bad VF file: Character 247 in font 0 will be ignored
# Bad VF file: Character 248 in font 0 will be ignored
# Bad VF file: Character 249 in font 0 will be ignored
# Bad VF file: Character 250 in font 0 will be ignored
# Bad VF file: Character 251 in font 0 will be ignored
# Bad VF file: Character 252 in font 0 will be ignored
# Bad VF file: Character 253 in font 0 will be ignored
# Bad VF file: Character 254 in font 0 will be ignored

# Pilgi A 필기a
pga_fontname = pilgia
pga_namestem = pga
pga_virtual_namestem = wpga
pga_real_namestem = upga
pga_bold = no
pga_sfd = hangul

# No AGL headline.
# type1/uhc/taza/utt10.pfb: refers to Utt10
# type1/taza/utt04.pfb: refers to Umj04
# dvips: Checksum mismatch in upga10
# dvips: Checksum mismatch in upga11
# dvips: Checksum mismatch in upgax10
# dvips: Checksum mismatch in upgax11
# dvips: Checksum mismatch in upgao10
# dvips: Checksum mismatch in upgao11
# dvips: Checksum mismatch in upgaxo10
# dvips: Checksum mismatch in upgaxo11

# Shinmun 신문
sh_fontname = shinmun
sh_namestem = sh
sh_virtual_namestem = wsh
sh_real_namestem = ush
sh_bold = no
sh_dep_vf = umj00 umj01 umj03 umj04
sh_bad_vf = 04 05 06 07
sh_sfd = hangul_symbol_hanja

# /usr/share/texmf/fonts/vf/uhc/shinmun/wsh*04.vf
# Bad VF file: Character 251 in font 0 will be ignored
# Bad VF file: Character 252 in font 0 will be ignored
# Bad VF file: Character 253 in font 0 will be ignored
# Bad VF file: Character 254 in font 0 will be ignored

# Taza 타자
tt_fontname = taza
tt_namestem = tt
tt_virtual_namestem = wtt
tt_real_namestem = utt
tt_bold = no
tt_dep_vf = ugt05 ugt02 ugt03 ugt02 ugt03 ugt01 umj04 ugt05 umj04 ugt01 ugt03 ugt05 ugt01 ugt20 ugt21 ugt22 ugt23 ugt26 ugt27 ugt29 ugt30 ugt31 ugt33 ugt34 ugt35 ugt37 ugt24 ugt32 ugt36 ugt25 ugt28 ugt38 ugt31 ugt32 ugt33 ugt34 ugt35 ugt36 ugt37 ugt20 ugt22 ugt23 ugt24 ugt25 ugt26 ugt27 ugt28 ugt30 ugt21 ugt29 ugt37 ugt38 ugt22 ugt23 ugt33 ugt21 ugt31 ugt32 ugt34 ugt35 ugt36 ugt25 ugt24 ugt20 ugt27 ugt28 ugt30 ugt29 ugt26 ugt32 ugt21 ugt22 ugt24 ugt25 ugt31 ugt23 ugt27 ugt29 ugt30 ugt33 ugt35 ugt37 ugt36 ugt34 ugt28 ugt26 ugt20 ugt31 ugt33 ugt34 ugt36 ugt37 ugt22 ugt25 ugt30 ugt32 ugt35 ugt27 ugt28 ugt29 ugt20 ugt21 ugt23 ugt24 ugt26 ugt38 ugt23 ugt24 ugt26 ugt27 ugt28 ugt29 ugt30 ugt31 ugt32 ugt33 ugt34 ugt36 ugt37 ugt21 ugt35 ugt25 ugt20 ugt22 ugt25 ugt26 ugt27 ugt28 ugt29 ugt32 ugt36 ugt23 ugt34 ugt21 ugt30 ugt31 ugt33 ugt35 ugt37 ugt20 ugt22 ugt24 ugt38 ugt26 ugt28 ugt29 ugt31 ugt32 ugt33 ugt34 ugt35 ugt36 ugt37 ugt21 ugt22 ugt24 ugt25 ugt27 ugt30 ugt20 ugt23 ugt22 ugt23 ugt24 ugt25 ugt26 ugt27 ugt29 ugt31 ugt32 ugt33 ugt34 ugt35 ugt36 ugt37 ugt28 ugt30 ugt20 ugt21 ugt38 ugt37 ugt21 ugt22 ugt23 ugt28 ugt29 ugt30 ugt32 ugt33 ugt24 ugt26 ugt27 ugt31 ugt34 ugt36 ugt25 ugt35 ugt20 ugt38 ugt33 ugt35 ugt20 ugt21 ugt22 ugt23 ugt24 ugt25 ugt26 ugt27 ugt28 ugt29 ugt30 ugt31 ugt32 ugt34 ugt36 ugt37 ugt38 ugt26 ugt27 ugt28 ugt29 ugt31 ugt33 ugt34 ugt37 ugt23 ugt36 ugt30 ugt32 ugt20 ugt22 ugt25 ugt35 ugt24 ugt21 ugt38 ugt20 ugt21 ugt22 ugt23 ugt24 ugt25 ugt26 ugt27 ugt28 ugt29 ugt30 ugt31 ugt32 ugt33 ugt34 ugt35 ugt36 ugt37 ugt28 ugt29 ugt32 ugt33 ugt36 ugt37 ugt23 ugt27 ugt30 ugt26 ugt31 ugt34 ugt20 ugt21 ugt22 ugt24 ugt25 ugt35 ugt38 ugt28 ugt31 ugt32 ugt33 ugt34 ugt35 ugt36 ugt37 ugt20 ugt21 ugt22 ugt24 ugt25 ugt26 ugt27 ugt29 ugt30 ugt23 ugt31 ugt32 ugt33 ugt35 ugt26 ugt20 ugt22 ugt28 ugt36 ugt24 ugt25 ugt21 ugt23 ugt27 ugt30 ugt38 ugt29 ugt34 ugt37 ugt33 ugt34 ugt35 ugt36 ugt37 ugt20 ugt30 ugt31 ugt32 ugt26 ugt27 ugt29 ugt21 ugt24 ugt22 ugt23 ugt28 ugt38 ugt25 ugt37 ugt35 ugt22 ugt24 ugt26 ugt33 ugt34 ugt21 ugt23 ugt32 ugt36 ugt20 ugt25 ugt28 ugt30 ugt29 ugt27 ugt31 ugt28 ugt29 ugt33 ugt34 ugt35 ugt36 ugt37 ugt21 ugt24 ugt26 ugt20 ugt22 ugt23 ugt25 ugt27 ugt30 ugt31 ugt32 ugt28 ugt32 ugt20 ugt21 ugt22 ugt23 ugt24 ugt25 ugt26 ugt29 ugt31 ugt34
tt_bad_vf = 04 05 06 07 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
tt_sfd = hangul_symbol_hanja

# Vada 바다
vd_fontname = vada
vd_namestem = vd
vd_virtual_namestem = wvd
vd_real_namestem = uvd
vd_bold = no
vd_sfd = hangul

# Yetgul 옛글
yt_fontname = yetgul
yt_namestem = yt
yt_virtual_namestem = wyt
yt_real_namestem = uyt
yt_bold = no
#yt_dep_vf = umj00 umj01 umj03 umj04
#yt_bad_vf = 04 05 06 07
yt_sfd = hangul_hanja


# Variable substitutions:

fontname = $($(abbrev)_fontname)
namestem = $($(abbrev)_namestem)
virtual_namestem = $($(abbrev)_virtual_namestem)
real_namestem = $($(abbrev)_real_namestem)
bold = $($(abbrev)_bold)
dep_vf = $($(abbrev)_dep_vf)
bad_vf = $($(abbrev)_bad_vf)
fix_vf_namestems = $(shell for i in $(dep_vf); do printf $$i|cut -c -3 -; done)
sfd = $($(abbrev)_sfd)
build-stamp_fonts = $(addprefix build-stamp.,$(fonts))
clean_fonts = $(addprefix clean_,$(fonts))
fdfile_fonts = $(addprefix fdfile_,$(fonts))
install_fonts = $(addprefix install_,$(fonts))
install2_fonts = $(addprefix install2_,$(fonts))



clean:
	rm -f build-stamp
	@for i in $(allfonts);\
	  do echo "Removing $$i/"; rm -rf $$i; done

build: build-stamp
build-stamp: $(build-stamp_fonts)
	touch build-stamp

$(build-stamp_fonts): abbrev = $(patsubst build-stamp.%,%,$@)
$(build-stamp_fonts):
	# Copying the necessary files to $(fontname)/.
	mkdir -p $(fontname)
	cp $(texmf)/fonts/{afm,tfm,type1}/uhc/$(fontname)/$(real_namestem)* $(fontname)/
	cp $(texmf)/fonts/{tfm,vf}/uhc/$(fontname)/$(virtual_namestem)* $(fontname)/
	cp latex-cjk/{sfd2uni.pl,hlatex2agl*.pl,aglfn13.txt,UKS-HLaTeX*.sfd} $(fontname)/

# vftovp wgt04.vf, wgtb04.vf, wgtbc04.vf, wgtbco04.vf, wgtbo04.vf, wgtbu04.vf, wgtbuo04.vf, wgtbx04.vf, wgtbxo04.vf, wgtc04.vf, wgtco04.vf, wgto04.vf, wgtu04.vf, wgtuo04.vf, wgtx04.vf, wgtxo04.vf  have the following warnings:
#   Bad VF file: Character 251 in font 0 will be ignored
#   Bad VF file: Character 252 in font 0 will be ignored
#   Bad VF file: Character 253 in font 0 will be ignored
#   Bad VF file: Character 254 in font 0 will be ignored
#
# vftovp wgtb05.vf, wgtbc05.vf, wgtbco05.vf, wgtbo05.vf, wgtbu05.vf, wgtbuo05.vf, wgtbx05.vf, wgtbxo05.vf,  have the following warning:
#  Bad VF file: Character 173 in font 1 will be ignored
#
# That's why I use three arguments after vftovp instead of a simple redirect &>.  >> might also be a solution.

	# Make some .vf files refer to one's own font instead of others'.
	@if [[ -n "$(bad_vf)" ]];\
	  then cd $(fontname);\
	  for i in $(dep_vf);\
	    do cp $(texmf)/fonts/{afm,tfm,type1}/uhc/*/$$i* .;\
	      rename -f 's/^u../$(real_namestem)/' $$i*;\
	  done;\
	  for i in $(bad_vf);\
	    do vftovp $(texmf)/fonts/vf/uhc/$(fontname)/$(virtual_namestem)$$i.vf $(virtual_namestem)$$i.tfm $(virtual_namestem)$$i.vpl;\
	    for j in $(fix_vf_namestems);\
	      do sed -i -e 's/'$$j'/$(real_namestem)/g' $(virtual_namestem)$$i.vpl;\
	    done;\
	    vptovf $(virtual_namestem)$$i.vpl $(virtual_namestem)$$i.vf $(virtual_namestem)$$i.tfm;\
	  done;\
	if [[ $(bold) = yes ]];\
	  then cd $(fontname);\
	  for i in $(dep_vf);\
	    do j=`echo $$i|cut -c -3 -`b`echo $$i|cut -c 4- -`;\
	      cp $(texmf)/fonts/{afm,tfm,type1}/uhc/*/$$j* .;\
	      rename -f 's/^u../$(real_namestem)/' $$j*;\
	  done;\
	  for i in $(bad_vf);\
	    do vftovp $(texmf)/fonts/vf/uhc/$(fontname)/$(virtual_namestem)b$$i.vf $(virtual_namestem)b$$i.tfm $(virtual_namestem)b$$i.vpl;\
	    for j in $(fix_vf_namestems);\
	      do sed -i -e 's/'$$j'/$(real_namestem)/g' $(virtual_namestem)b$$i.vpl;\
	    done;\
	    vptovf $(virtual_namestem)b$$i.vpl $(virtual_namestem)b$$i.vf $(virtual_namestem)b$$i.tfm;\
	  done;\
	fi;\
	fi
	@echo

	# sfd -> Unicode
	cd $(fontname);\
	 perl sfd2uni.pl $(sfdfile) $(virtual_namestem) u$(virtual_namestem) HLATEX &> log;\
	 for i in $(variants);\
	  do perl sfd2uni.pl $(sfdfile) $(virtual_namestem)$$i u$(virtual_namestem)$$i HLATEX >> log 2>&1;\
	   if [[ $(bold) = "yes" ]];\
	    then perl sfd2uni.pl $(sfdfile) $(virtual_namestem)b$$i u$(virtual_namestem)b$$i HLATEX >> log 2>&1;\
	  fi;\
	done
	@echo

	# Adding AGL compliant glyph names to fonts from the HLaTeX package.
# 	@cd $(fontname);\
# 	for i in $(variants);\
# 	 do if [[ $(sfd) = hangul ]];\
# 	   then perl hlatex2agl-hangul.pl $(virtual_namestem) $(real_namestem) >> log 2>&1;\
# 	  elif [[ $(sfd) = hangul_hanja ]];\
# 	   then perl hlatex2agl-hangul_hanja.pl $(virtual_namestem) $(real_namestem) >> log 2>&1;\
# 	  elif [[ $(sfd) = hangul_symbol ]];\
# 	   then perl hlatex2agl-hangul_symbol.pl $(virtual_namestem) $(real_namestem) >> log 2>&1;\
# 	  else perl hlatex2agl.pl $(virtual_namestem) $(real_namestem) >> log 2>&1;\
# 	 fi;\
#         done

# 	@cd $(fontname);\
# 	if [[ $(bold) = "yes" ]];\
# 	  then if [[ $(sfd) = hangul ]];\
# 	    then perl hlatex2agl-hangul.pl $(virtual_namestem)b $(real_namestem)b >> log 2>&1;\
# 	  elif [[ $(sfd) = hangul_symbol ]];\
# 	    then perl hlatex2agl-hangul_symbol.pl $(virtual_namestem)b $(real_namestem)b >> log 2>&1;\
# 	  else perl hlatex2agl.pl $(virtual_namestem)b $(real_namestem)b >> log 2>&1;\
# 	  fi;\
# 	fi
# 	@echo

	cd $(fontname);\
	perl $(hlatex2agl) $(virtual_namestem) $(real_namestem) >> log 2>&1;\
	if [[ $(bold) = "yes" ]];\
	  then perl $(hlatex2agl) $(virtual_namestem)b $(real_namestem)b >> log 2>&1;\
	fi
	@echo

# 	for i in $(variants);\
# 	  do perl $(hlatex2agl) $(virtual_namestem)$$i $(real_namestem)$$i >> log 2>&1;\
# 	done;\

# 	  for i in $(variants);\
# 	    do perl $(hlatex2agl) $(virtual_namestem)b$$i $(real_namestem)b$$i >> log 2>&1;\
# 	  done;\
# 	fi
# 	@echo



# Temporary target
fdfile: $(fdfile_fonts)
$(fdfile_fonts): abbrev = $(patsubst fdfile_%,%,$@)
$(fdfile_fonts):
	@echo "Create $(fontname)/c70$(namestem).fd"
	@echo -e "% This is the file c70$(namestem).fd of the CJK package\n\
	%   for using Asian logographs (Chinese/Japanese/Korean) with LaTeX2e\n\
	%\n\
	% created by Werner Lemberg <wl@gnu.org>\n\
	%\n\
	% Version 4.6.0 (11-Aug-2005)\n\n\
	\\def\\\\fileversion{4.6.0}\n\
	\\def\\\\filedate{2005/08/11}\n\
	\\ProvidesFile{c70$(namestem).fd}[\\\\filedate\\space\\\\fileversion]\n\n\n\
	% character set: KS X 1001\n\
	% font encoding: Unicode\n\n\
	\\DeclareFontFamily{C70}{$(namestem)}{\\hyphenchar \\\\font\\m@ne}\n\n" > $(fdfile)

	@echo "\\DeclareFontShape{C70}{$(namestem)}{m}{n}{<-> CJK * u$(virtual_namestem)}{}" >> $(fdfile)
	@if [[ $(bold) = "yes" ]];\
	  then echo "\\DeclareFontShape{C70}{$(namestem)}{b}{n}{<-> CJK * u$(virtual_namestem)b}{}" >> $(fdfile);\
	  else echo "\\DeclareFontShape{C70}{$(namestem)}{b}{n}{<-> CJKb * u$(virtual_namestem)}{\\CJKbold}" >> $(fdfile);\
	fi

	@for i in $(variants);\
	do case $$i in \
		"o") echo "\DeclareFontShape{C70}{$(namestem)}{m}{sl}{<-> CJK * u$(virtual_namestem)o}{}" >> $(fdfile);\
		     if [[ $(bold) = "yes" ]]; then \
		       echo "\\DeclareFontShape{C70}{$(namestem)}{b}{sl}{<-> CJK * u$(virtual_namestem)bo}{}" >> $(fdfile);\
		     else echo "\DeclareFontShape{C70}{$(namestem)}{b}{sl}{<-> CJKb * u$(virtual_namestem)o}{\CJKbold}" >> $(fdfile);\
		     fi;\
		     echo "\DeclareFontShape{C70}{$(namestem)}{m}{it}{<-> CJKssub * $(namestem)/m/sl}{}" >> $(fdfile);\
		     echo "\DeclareFontShape{C70}{$(namestem)}{b}{it}{<-> CJKssub * $(namestem)/b/sl}{}" >> $(fdfile);\
		     echo >> $(fdfile) ;;\
		"c") echo "\DeclareFontShape{C70}{$(namestem)}{c}{n}{<-> CJK * u$(virtual_namestem)c}{}" >> $(fdfile);\
		     if [[ $(bold) = "yes" ]]; then \
		       echo "\\DeclareFontShape{C70}{$(namestem)}{bc}{n}{<-> CJK * u$(virtual_namestem)bc}{}" >> $(fdfile);\
		     else echo "\DeclareFontShape{C70}{$(namestem)}{bc}{n}{<-> CJKb * u$(virtual_namestem)c}{\CJKbold}" >> $(fdfile);\
		     fi ;;\
		"co") echo "\DeclareFontShape{C70}{$(namestem)}{c}{sl}{<-> CJK * u$(virtual_namestem)co}{}" >> $(fdfile);\
		      if [[ $(bold) = "yes" ]]; then \
		        echo "\\DeclareFontShape{C70}{$(namestem)}{bc}{sl}{<-> CJK * u$(virtual_namestem)bco}{}" >> $(fdfile);\
		        else echo "\DeclareFontShape{C70}{$(namestem)}{bc}{sl}{<-> CJKb * u$(virtual_namestem)co}{\CJKbold}" >> $(fdfile);\
		      fi;\
		    echo "\DeclareFontShape{C70}{$(namestem)}{c}{it}{<-> CJKssub * $(namestem)/c/sl}{}" >> $(fdfile);\
		    echo "\DeclareFontShape{C70}{$(namestem)}{bc}{it}{<-> CJKssub * $(namestem)/bc/sl}{}" >> $(fdfile);\
		    echo >> $(fdfile) ;;\
		"x") echo "\DeclareFontShape{C70}{$(namestem)}{x}{n}{<-> CJK * u$(virtual_namestem)x}{}" >> $(fdfile);\
		      if [[ $(bold) = "yes" ]]; then \
		        echo "\\DeclareFontShape{C70}{$(namestem)}{bx}{n}{<-> CJK * u$(virtual_namestem)bx}{}" >> $(fdfile);\
		        else echo "\DeclareFontShape{C70}{$(namestem)}{bx}{n}{<-> CJKb * u$(virtual_namestem)x}{\CJKbold}" >> $(fdfile);\
		      fi ;;\
		"xo") \
		    echo "\DeclareFontShape{C70}{$(namestem)}{x}{sl}{<-> CJK * u$(virtual_namestem)xo}{}" >> $(fdfile);\
		    if [[ $(bold) = "yes" ]]; then \
		        echo "\\DeclareFontShape{C70}{$(namestem)}{bx}{sl}{<-> CJK * u$(virtual_namestem)bxo}{}" >> $(fdfile);\
		    else echo "\DeclareFontShape{C70}{$(namestem)}{bx}{sl}{<-> CJKb * u$(virtual_namestem)xo}{\CJKbold}" >> $(fdfile);\
		    fi;\
		    echo "\DeclareFontShape{C70}{$(namestem)}{x}{it}{<-> CJKssub * $(namestem)/x/sl}{}" >> $(fdfile);\
		    echo "\DeclareFontShape{C70}{$(namestem)}{bx}{it}{<-> CJKssub * $(namestem)/bx/sl}{}" >> $(fdfile);\
		    echo >> $(fdfile) ;;\
		"u") \
		    echo "\DeclareFontShape{C70}{$(namestem)}{ux}{n}{<-> CJK * u$(virtual_namestem)u}{}" >> $(fdfile);\
		    if [[ $(bold) = "yes" ]]; then \
		        echo "\\DeclareFontShape{C70}{$(namestem)}{bux}{n}{<-> CJK * u$(virtual_namestem)bu}{}" >> $(fdfile);\
		    else echo "\DeclareFontShape{C70}{$(namestem)}{bux}{n}{<-> CJKb * u$(virtual_namestem)u}{\CJKbold}" >> $(fdfile);\
		    fi ;;\
		"uo") \
		    echo "\DeclareFontShape{C70}{$(namestem)}{ux}{sl}{<-> CJK * u$(virtual_namestem)uo}{}" >> $(fdfile);\
		    if [[ $(bold) = "yes" ]]; then \
		        echo "\\DeclareFontShape{C70}{$(namestem)}{bux}{sl}{<-> CJK * u$(virtual_namestem)buo}{}" >> $(fdfile);\
		    else echo "\DeclareFontShape{C70}{$(namestem)}{bux}{sl}{<-> CJKb * u$(virtual_namestem)uo}{\CJKbold}" >> $(fdfile);\
		    fi;\
		    echo "\DeclareFontShape{C70}{$(namestem)}{ux}{it}{<-> CJKssub * $(namestem)/ux/sl}{}" >> $(fdfile);\
		    echo "\DeclareFontShape{C70}{$(namestem)}{bux}{it}{<-> CJKssub * $(namestem)/bux/sl}{}" >> $(fdfile);\
		    echo >> $(fdfile) ;;\
		*) \
		    echo "Oops, don't know this variant" ;;\
	    esac;\
	done
	@echo "\endinput" >> $(fdfile)

# Temporary target
install: $(install_fonts)
$(install_fonts): abbrev = $(patsubst install_%,%,$@)
$(install_fonts):
	mkdir -p $(fontname)/{afm,tfm,type1,vf}
	mv $(fontname)/*.afm $(fontname)/afm/
	mv $(fontname)/u$(virtual_namestem)*.tfm $(fontname)/tfm/
	mv $(fontname)/*.pfb $(fontname)/type1/
	mv $(fontname)/u$(virtual_namestem)*.vf $(fontname)/vf/

# Temporary target
install2: $(install2_fonts)
	texhash ~/texmf
$(install2_fonts): abbrev = $(patsubst install2_%,%,$@)
$(install2_fonts):
	# Be careful.  pen and jamo have multiple fonts in their directories.
	# rm -rf ~/texmf/fonts/{afm,tfm,type1,vf}/$(fontname)
	mkdir -p ~/texmf/fonts/{afm,tfm,type1,vf}/uhc/$(fontname)
	cp $(fontname)/$(real_namestem)*.afm ~/texmf/fonts/afm/uhc/$(fontname)
	cp $(fontname)/u$(virtual_namestem)*.tfm ~/texmf/fonts/tfm/uhc/$(fontname)
	cp $(fontname)/$(real_namestem)*.pfb ~/texmf/fonts/type1/uhc/$(fontname)
	cp $(fontname)/u$(virtual_namestem)*.vf ~/texmf/fonts/vf/uhc/$(fontname)
	cp -f $(fontname)/c70$(namestem).fd ~/texmf/tex/latex/CJK/UTF8/
	@echo

# should be copied to uhc/$(fontname).  TODO

.PHONY:	build clean install install2

Reply to: