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

Re: latex-cjk upload to unstable ...



'ello!


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

> Danai SAE-HAN (韓達耐) <danai.sae-han@skynet.be> wrote:
> 
> > Hmmm, I didn't think about that: the user can't sniff the logs if
> > pbuilder fails.  Bummer.
> >
> > There are two reasons why I first redirected the output into log files
> > instead of on-screen.  First was that there is so much information
> > that it makes it difficult to follow what's happening exactly.
> > Secondly and more importantly, when the scripts are bursting out so
> > much information, it would slow (my) computer even more because my
> > terminal couldn't follow, temporarily hijacking my CPU.
> 
> Yes, I agree.  I think we should not display the log when the build is
> successful. 

I have experimented with the expansion of $$i, but I couldn't solve
it.  So I use pattern substitution now and it works.  Not that it is
so important, but I always prefer flexible commands where changing one
variable will automagically change everything. =)

One last thing remaining, is: how do you want to end the Debian build
when an error has occurred?

command >> log 2>&1 || ( cat log; echo "Error!  Please have a look at \
build/log."; exit 1 )

This is what I have used in debian/rules.  Is that OK?
You can find the latest debian/rules attached.


Best regards



Danai SAE-HAN
韓達耐

-- 
题目:《春日登楼怀旧》
作者:寇准(961-1023)

高楼聊引望,杳杳一川平。
远水无人渡,孤舟尽日横。
荒村生断霭,深树语流莺。
旧业遥清渭,沉思忽自惊。
#!/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

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

dirs = $($(abbrev)_dirs)
jis = $($(abbrev)_jis)

wftodm_namestems = $(addprefix wftodm.,$(namestems))
fixwada_namestems = $(addprefix fixwada.,$(namestems))

#ERR = $(error Error! You can find the log in build/log.)
ERR = cat log; echo "Error! Please have a look at build/log."; exit 1

wftodm: $(wftodm_namestems)

$(wftodm_namestems): abbrev = $(patsubst wftodm.%,%,$@)
$(wftodm_namestems):
	@echo Create .afm and .pfa fonts from $(abbrev).
	@cd build;\
	  $(wftodm) -FontBase $(abbrev) $(dirs) || \
	    echo "$(wftodm) -FontBase $(abbrev) $(dirs)" failed miserably.
	@echo


build: build-stamp wftodm makefont fixwada makeuniwada
	touch 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/

	@echo

makefont:
	@echo Converting PFA to PFB and AFM to TFM.
	@cd build; sh makefont > log 2>&1 || ( $(ERR) )
	@echo

fixwada: $(fixwada_namestems)
$(fixwada_namestems): abbrev = $(patsubst fixwada.%,%,$@)
$(fixwada_namestems):
	@echo "Correct the glyph names of $(abbrev)."
	@cd build; \
	  perl fixwada2.pl $(abbrev)j $(jis) >> log 2>&1 || \
	  ( $(ERR) )
	@echo

makeuniwada:
	@echo "Create virtual fonts for Unicode input encoding."
	@cd build; \
	  perl makeuniwada.pl dgj udgj >> log 2>&1 || \
	  ( $(ERR) ) && \
	  perl makeuniwada.pl mrj mr2j umrj >> log 2>&1 || \
	  ( $(ERR) ) && \
	  perl makeuniwada.pl dmj mc2j udmj >> log 2>&1 || \
	  ( $(ERR) ) && \
	  perl makeuniwada.pl mcj mc2j umcj >> log 2>&1 || \
	  ( $(ERR) )
	@echo

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 wftodm fixwada makefont

Reply to: