1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
## ----------------------------------------------------------------------
## Makefile : makefile for docbook-xml
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
## Document definitions
doc_lang := en
# doc_lang := en fr
doc_name := debian-blends
doc_xml := $(shell for l in $(doc_lang); do echo $(doc_name).$$l.xml; done)
doc_xml_source := $(shell find $$l -name "*.xml")
#po_files := $(shell ls *.po)
#mo_files := $(patsubst %.po, %/LC_MESSAGES/blends.mo, $(po_files))
translated := $(shell for l in $$(echo $(doc_lang) | sed 's/en//'); do for f in en/*.xml; do echo $$l/$$(basename $$f); done; done)
sources := $(shell find . -name "*.xml")
doc_pdf := $(shell for l in $(doc_lang); do echo $$l/pdf/$(doc_name).$$l.pdf; done)
doc_ps := $(shell for l in $(doc_lang); do echo $$l/ps/$(doc_name).$$l.ps; done)
doc_dvi := $(shell for l in $(doc_lang); do echo $$l/dvi/$(doc_name).$$l.dvi; done)
doc_txt := $(shell for l in $(doc_lang); do echo $$l/txt/$(doc_name).$$l.txt; done)
#this needed cause xmlto txt does not include section numbering by default
doc_txt_params := --stringparam section.autolabel=1 --stringparam section.label.includes.component.label=1
doc_html := $(shell for l in $(doc_lang); do echo $$l/html/index.html; done)
pkg := blends-doc
doc_html_en := en/html
doc_pdf_en := en/pdf/debian-blends.en.pdf
doc_html_fr := fr/html
doc_pdf_fr := fr/pdf/debian-blends.en.pdf
## ----------------------------------------------------------------------
## General definitions
LN := /bin/ln -sf
RMR := /bin/rm -fr
LOCALE := unset LC_ALL; unset LANG; unset LANGUAGE;
## ----------------------------------------------------------------------
# this can and will be overridden by a higher level makefile
PUBLISHHOST ?= dillon.debian.org
# PUBLISHDIR := alioth.debian.org:/srv/alioth.debian.org/chroot/home/groups/blends/htdocs/blends
PUBLISHDIR := $(PUBLISHHOST):/srv/blends.debian.org/www/blends
# There is no difference between letter and a4, but a2 for instance works
PAPERSIZE := a4
## ----------------------------------------------------------------------
## Targets
all: html
validate: $(doc_xml)
for f in $(doc_xml); do \
xmllint --valid --noout $$f; \
done
# update_po: $(po_files)
blends.pot: $(doc_xml_source)
../devtools/blend-doc-makepot en > $@
$(po_files): blends.pot
@for l in $(doc_lang); do \
[ $$l != "en" ] && echo -n "Updating $$l.po " && \
mkdir -p $$l/LC_MESSAGES && \
msgmerge -U $$l.po blends.pot; \
done
update_mo: $(mo_files)
$(mo_files): $(po_files)
@for l in $$(echo $(doc_lang)| sed 's/en//'); do \
echo "Updating $$l/LC_MESSAGES/blends.mo" && \
msgfmt -o $$l/LC_MESSAGES/blends.mo $$l.po; \
done
translate: $(mo_files)
@for l in $(doc_lang); do \
[ $$l != "en" ] && ../devtools/blend-doc-translate $$l; \
done
html: $(doc_html)
$(doc_html) $(doc_html_en): $(doc_xml) $(sources)
for l in $(doc_lang); do \
f=$(doc_name).$$l.xml; d=$$l/html; \
mkdir -p $$d; \
$(LOCALE) xmlto --skip-validation -o $$d -x $(doc_name).xsl html $$f; \
done
txt $(doc_txt): $(doc_xml)
for l in $(doc_lang); do \
f=$(doc_name).$$l.xml; d=$$l/txt; \
mkdir -p $$d; \
$(LOCALE) xmlto --skip-validation $(doc_txt_params) -o $$d txt $$f; \
done
ps $(doc_ps): $(doc_xml)
for l in $(doc_lang); do \
f=$(doc_name).$$l.xml; d=$$l/ps; \
mkdir -p $$d; \
$(LOCALE) xmlto -o $$d --with-dblatex ps $$f; \
done
pdf $(doc_pdf): $(doc_xml)
for l in $(doc_lang); do \
f=$(doc_name).$$l.xml; d=$$l/pdf; \
mkdir -p $$d; \
$(LOCALE) xmlto --skip-validation -o $$d --with-dblatex pdf $$f; \
done
dvi $(doc_dvi): $(doc_xml)
for l in $(doc_lang); do \
f=$(doc_name).$$l.xml; d=$$l/dvi; \
mkdir -p $$d; \
$(LOCALE) xmlto -o $$d --with-dblatex dvi $$f; \
done
publish: $(doc_html_en) $(doc_pdf_en)
rsync -azult --delete $(doc_html_en)/*.html $(PUBLISHDIR)
rsync -azult $(doc_pdf_en) $(PUBLISHDIR)
# sync to mirrors
ssh $(PUBLISHHOST) "/usr/local/bin/static-update-component blends.debian.org"
clean:
for l in $(doc_lang); do \
for d in html pdf txt ps dvi info; do \
$(RMR) $$l/$$d; \
done; \
done
find . -name "*~" -o -name "*.mo" -exec $(RMR) {} \;
rm -f blends.pot
distclean:
make clean
.PHONY: all publish clean distclean validate # translateu update_mo update_po
|