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

Re: DDP CVS commit by pmachard: ddp/manuals.sgml/repository-howto/fr



On Wed, Apr 13, 2005 at 07:29:33PM +0200, Pierre Machard wrote:
> On Sun, Apr 03, 2005 at 06:17:57PM +0200, Jens Seidel wrote:
> > Why do you not put this file in the same directory as the English file?
> > Since only one file belongs to each translation this flat style should
> > suffice.
> 
> I did not want to change the whole Makefile. I have not found any
> other clean concept ; This makefile is badly designed.
> 
> propose me a smooth patch for the Makefile ;-)

I attached a new Makefile which still needs to be checked carrefully but
seems to work. English output documents are now named
repository-howto.en.pdf instead of repository-howto.pdf (same for html)
but this should not harm (I first have to check where this document is
used).

> > > The compilation failled on my box (sarge), memory exhausion. Does
> > > somebody manage to compile repository-howto.xml ?
> > 
> > I did!
> > 
> > You're right, this PDF file cannot be created straightaway. The problem
> > is the large directory tree in the document which doesn't fit on one
> > page and causes xmltex to bogusly create hundreds of output pages which
> > stops which an out of memory error. Just remove one line in it and it
> > works!
> 
> Which line ? The lastest ?

Anyone in the range 178-230 of the English version. But it is not
necessary as described in
http://lists.debian.org/debian-doc/2005/04/msg00011.html.

> > It build's now well using CVS's Makefile.
> Which Makefile ?

The current Makefile from CVS. (Please note that only pdf and html
targets are supported at the moment.)
The magic line is:

# workaround to avoid -4pc -4pc on top of each page which is currently
# not fixed (bug #223553)
sed 's/margin-left="1in - -4pc"/margin-left="1in"/g' $@ > $@.tmp && mv $@.tmp $@

to fix the created FO file.

Funny: A few hours ago (before I read your mail) I looked again at the
problem to prepare a bugreport against docbook-xml but noticed that
it's unlikely that the current docbook-xml workaround for passivetex can
be extented, since only another xml (FO) document is created and docbook
doesn't know that this is parsed with pdfxmltex as well.
The proper bug for this problem is still #223553.

Jens
#
# Makefile for DDP documentation generated with xmlto etc
#
# (Repository HOWTO, How software producers can distribute software
# in .deb format, etc)

manual := $(notdir $(CURDIR))

# this can and will be overriden by a higher level makefile
PUBLISHDIR := /org/www.debian.org/www/doc/manuals

LANGS = en fr

sources := $(foreach lang, $(LANGS), $(manual).$(lang).xml)

all: html pdf # dvi ps # god damn dvi and ps don't work

$(manual).en.xml: $(manual).xml
	ln -sf $(manual).xml $@

publish: all
	test -d $(PUBLISHDIR)/$(manual) || install -d -m 755 $(PUBLISHDIR)/$(manual)
	rm -f $(PUBLISHDIR)/$(manual)/*.html
	@$(foreach fmt,.html .pdf .dvi .ps,\
	   $(foreach lang,$(LANGS),\
	     install -p -m 644 $(manual).$(lang).html $(PUBLISHDIR)/$(manual);\
	     install -p -m 644 $(manual).pdf $(PUBLISHDIR)/$(manual);\
	     install -p -m 644 $(manual).dvi $(PUBLISHDIR)/$(manual);\
 	     install -p -m 644 $(manual).ps $(PUBLISHDIR)/$(manual)))

validate:
	xmllint --noout --loaddtd --catalogs $(sources)

html: $(foreach lang,$(LANGS),$(manual).$(lang).html)
$(manual).%.html: $(manual).%.xml
	xsltproc --catalogs -o $@ \
	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
	$<

fo: $(foreach lang,$(LANGS),$(manual).$(lang).fo)
$(manual).%.fo: $(manual).%.xml
	xsltproc --catalogs -o $@ \
	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/docbook.xsl \
	$<
	# workaround to avoid -4pc -4pc on top of each page which is currently
	# not fixed (bug #223553)
	sed 's/margin-left="1in - -4pc"/margin-left="1in"/g' $@ > $@.tmp && mv $@.tmp $@

dvi: $(foreach lang,$(LANGS),$(manual).$(lang).dvi)
$(manual).%.dvi: $(manual).%.fo
	# needs being run twice to generate toc
	xmltex --interaction=batchmode $<
	xmltex --interaction=batchmode $<

ps: $(foreach lang,$(LANGS),$(manual).$(lang).ps)
$(manual).%.ps: $(manual).%.dvi
	dvips $<

pdf: $(foreach lang,$(LANGS),$(manual).$(lang).pdf)
$(manual).%.pdf: $(manual).%.fo
	# needs being run twice to generate toc
	# yes, this is suboptimal but it's the easiest way
	pdfxmltex --interaction=batchmode $<
	pdfxmltex --interaction=batchmode $<

clean_SUFFIXES :=  aux html dvi fo log pdf ps out toc

clean distclean:
	rm -f $(addprefix $(manual).*.,$(clean_SUFFIXES))
	rm -f *~ .*~ core tsa*

.PHONY: all publish clean distclean dvi fo html pdf ps validate

Reply to: