| 4 |
####################################################################### |
####################################################################### |
| 5 |
### basic parameters (build condition dependent) ALL |
### basic parameters (build condition dependent) ALL |
| 6 |
####################################################################### |
####################################################################### |
| 7 |
|
BUILD_MODE := xml |
| 8 |
# parent dir name of the SVN source checkout location |
# parent dir name of the SVN source checkout location |
| 9 |
# make[1]: Entering directory `/org/www.debian.org/ddp-svn/trunk/quick-reference' |
# make[1]: Entering directory `/org/www.debian.org/ddp-svn/trunk/quick-reference' |
| 10 |
PDIR := $(notdir $(realpath $(CURDIR)/../..)) |
PDIR := $(notdir $(realpath $(CURDIR)/../..)) |
|
# if $(PDIR) is ddp-svn -> DDP build |
|
|
# if $(PDIR) is ddp-svn -> normal build -> scp to ~osamu |
|
|
|
|
| 11 |
ifeq ($(PDIR),ddp-svn) |
ifeq ($(PDIR),ddp-svn) |
| 12 |
|
# Building www.debian.org |
| 13 |
# $(PUBLISHDIR) is set to be: /org/www.debian.org/www/doc/manuals |
# $(PUBLISHDIR) is set to be: /org/www.debian.org/www/doc/manuals |
| 14 |
DRPUBLISHDIR := $(PUBLISHDIR)/debian-reference |
DRPUBLISHDIR := $(PUBLISHDIR)/debian-reference |
| 15 |
else |
else |
| 16 |
DRPUBLISHDIR := $(CURDIR)/html |
# Normally |
| 17 |
|
# if $(PUBLISHDIR) is not set, set it |
| 18 |
|
PUBLISHDIR := $(CURDIR)/html |
| 19 |
|
DRPUBLISHDIR := $(PUBLISHDIR) |
| 20 |
endif |
endif |
| 21 |
|
|
| 22 |
# Please note package build script overides $(PUBLISHDIR) |
# Please note package build script overides $(PUBLISHDIR) |
| 23 |
|
|
| 24 |
####################################################################### |
####################################################################### |
| 39 |
THRESHOLD:= 0 |
THRESHOLD:= 0 |
| 40 |
TRANSLATE:= po4a-translate -M utf-8 --format docbook --keep $(THRESHOLD) |
TRANSLATE:= po4a-translate -M utf-8 --format docbook --keep $(THRESHOLD) |
| 41 |
GETTEXT := po4a-gettextize -M utf-8 -L utf-8 --format docbook |
GETTEXT := po4a-gettextize -M utf-8 -L utf-8 --format docbook |
| 42 |
UPDATEPO:= po4a-updatepo -M utf-8 --format docbook |
UPDATEPO:= msgmerge --update --previous |
| 43 |
# # note: the URL is used as identifier, no HTTP is used! |
# # note: the URL is used as identifier, no HTTP is used! |
| 44 |
# DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current |
# DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current |
| 45 |
VERBOSE := |
VERBOSE := |
| 52 |
CODE := sid |
CODE := sid |
| 53 |
ARCH := amd64 |
ARCH := amd64 |
| 54 |
UDEBA := $(DEBM)/$(CODE) |
UDEBA := $(DEBM)/$(CODE) |
| 55 |
|
# language defaults |
| 56 |
|
LANGALL := en ja fr it es de pt-br pl zh-tw zh-cn |
| 57 |
|
LANGPO := ja |
| 58 |
|
LANGNEW := |
| 59 |
|
LANGSGML = $(filter-out en $(LANGPO), $(LANGALL)) |
| 60 |
|
|
| 61 |
# AsciiDoc source files in $(ADOC) directories |
# AsciiDoc source files in $(ADOC) directories |
| 62 |
ASCSRC := 00_preface.txt 01_tutorial.txt 02_package.txt \ |
ASCSRC := 00_preface.txt 01_tutorial.txt 02_package.txt \ |
| 63 |
03_sysinit.txt 04_auth.txt 05_network.txt 06_netapp.txt \ |
03_sysinit.txt 04_auth.txt 05_network.txt 06_netapp.txt \ |
| 64 |
07_xwindow.txt 08_i18nl10ntxt 09_systips.txt 10_datamngt.txt \ |
07_xwindow.txt 08_i18nl10ntxt 09_systips.txt 10_datamngt.txt \ |
| 65 |
11_dataconv.txt 12_program.txt 99_appendix.txt |
11_dataconv.txt 12_program.txt 99_appendix.txt \ |
| 66 |
# source files |
copyright.txt header.txt $(DOCNAME).txt |
| 67 |
ASCSRCS := $(ADOC)/$(DOCNAME).txt $(addprefix $(ADOC)/, $(ASCSRC)) |
# source files (local update requires these) |
| 68 |
|
ASCSRCS := $(addprefix $(ADOC)/, $(ASCSRC)) |
| 69 |
|
RAWSRCS := $(DOCNAME).raw.xml all-popcon-results.txt packages.txt |
| 70 |
|
# source files (build prcess requires these) |
| 71 |
ENTSRCS := urls.ent datadatepop.ent datadatesize.ent popcon.ent pkgsize.ent common.ent |
ENTSRCS := urls.ent datadatepop.ent datadatesize.ent popcon.ent pkgsize.ent common.ent |
| 72 |
XMLSRCS := $(DOCNAME).en.xml $(ENTSRCS) |
XMLSRCS = $(DOCNAME).en.xml $(addsuffix .po, $(addprefix $(PODOC)/$(DOCNAME)., $(LANGPO))) $(ENTSRCS) |
|
LANGALL := en ja fr it es de pt-br pl zh-tw zh-cn |
|
|
LANGPO := ja |
|
|
LANGNEW := |
|
|
LANGSGML:= $(filter-out en $(LANGPO), $(LANGALL)) |
|
| 73 |
|
|
| 74 |
######################################################################### |
######################################################################### |
| 75 |
# Local raw XML files and base data LOCAL |
# Local raw XML files and base data created from asciidoc in lenny LOCAL |
| 76 |
######################################################################### |
######################################################################### |
| 77 |
ifneq ($(PDIR),ddp-svn) |
#=======================================================================# |
| 78 |
|
ifeq ($(BUILD_MODE),asciidoc) |
| 79 |
|
#=======================================================================# |
| 80 |
|
|
| 81 |
|
.SECONDARY: $(XMLSRCS) |
| 82 |
|
|
| 83 |
# ----------------------------------------------------------------------- |
# ----------------------------------------------------------------------- |
| 84 |
# This is cleaned after "make clean" |
# This is cleaned after "make clean" |
| 119 |
echo "<!ENTITY pkgsize-date \"$(shell date -u +'%F %T %Z')\">" >> datadatesize.ent |
echo "<!ENTITY pkgsize-date \"$(shell date -u +'%F %T %Z')\">" >> datadatesize.ent |
| 120 |
rm packages.main packages.contrib packages.non-free |
rm packages.main packages.contrib packages.non-free |
| 121 |
|
|
|
# package name list for popcon and size ent file generation |
|
|
# This file is not part of source |
|
|
pkg.lst: $(DOCNAME).raw.xml |
|
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/pkg.xsl $< > $@ |
|
|
|
|
|
# ----------------------------------------------------------------------- |
|
|
# Create final XML sources |
|
|
# This is not cleaned after "make clean" but cleaned by "make distclean" |
|
|
|
|
|
# replace table contents with @@@popcon*@@@ and @@@psize*@@@ and |
|
|
# fix URL referencees and table ID. |
|
|
$(DOCNAME).en.xml: $(DOCNAME).raw.xml $(ADOC)/header.txt |
|
|
|
|
|
# use asciidoc generated xml file as main contents |
|
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/table.xsl $(DOCNAME).raw.xml |\ |
|
|
$(PBIN)/colspec.py |\ |
|
|
sed -e '/<!DOCTYPE /d' -e "1r $(ADOC)/header.txt" |\ |
|
|
sed -f bin/replace > $@ |
|
|
|
|
|
# trick to allow building source w/o regenerating urls.ent unneededly |
|
|
urls.ent: $(ASCSRCS) |
|
|
if ! [ -f $(DOCNAME).raw.xml ]; then $(MAKE) $(DOCNAME).raw.xml ; fi |
|
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/urls.xsl $(DOCNAME).raw.xml | sort | uniq | sed -f bin/replace > $@ |
|
|
|
|
| 122 |
# trick to allow building source w/o all-popcon-results.txt |
# trick to allow building source w/o all-popcon-results.txt |
| 123 |
datadatepop.ent: |
datadatepop.ent: |
| 124 |
$(MAKE) all-popcon-results.txt |
$(MAKE) all-popcon-results.txt |
| 153 |
echo "<!ENTITY codename-unstable \"sid\">" >> $@ |
echo "<!ENTITY codename-unstable \"sid\">" >> $@ |
| 154 |
|
|
| 155 |
# ----------------------------------------------------------------------- |
# ----------------------------------------------------------------------- |
| 156 |
# Create new PO file in $(PODOC) |
# Create final XML sources |
| 157 |
# Use with "make LANGNEW=<language> newpo" while <language>= ja, fr, ... |
# This is not cleaned after "make clean" but cleaned by "make distclean" |
|
.PHONY: xml |
|
|
xml: $(XMLSRCS) $(addsufix, .xml, $(addprefix $(DOCNAME)., $(LANGPO))) |
|
|
.PHONY: newpo |
|
|
newpo: $(DOCNAME).en.xml |
|
|
if [ -z "$(LANGNEW)" ] || [ -f "$(PODOC)/$(DOCNAME).$(LANGNEW).po" ] ; then exit 1; fi |
|
|
$(GETTEXT) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).$(LANGNEW).po |
|
| 158 |
|
|
| 159 |
# ----------------------------------------------------------------------- |
# replace table contents with @@@popcon*@@@ and @@@psize*@@@ and |
| 160 |
# Update PO files and translate English XML file |
# fix URL referencees and table ID. |
| 161 |
.PHONY: updatepo |
$(DOCNAME).en.xml: $(DOCNAME).raw.xml $(ADOC)/header.txt |
| 162 |
updatepo: $(DOCNAME).en.xml |
# $$ in following becomes $ under make: 5.0.2 -> 5.0 |
| 163 |
$(UPDATEPO) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).ja.po |
if [ $$(sed -n "s/^\([^.]*\.[^.]*\).*$$/\1/p" < /etc/debian_version) != "5.0" ]; then \ |
| 164 |
|
echo "You must be running lenny">&2 ; exit 1 ; fi |
| 165 |
|
# use asciidoc generated xml file as main contents |
| 166 |
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/table.xsl $(DOCNAME).raw.xml |\ |
| 167 |
|
$(PBIN)/colspec.py |\ |
| 168 |
|
sed -e '/<!DOCTYPE /d' -e "1r $(ADOC)/header.txt" |\ |
| 169 |
|
sed -f bin/replace > $@ |
| 170 |
|
|
| 171 |
# create translated XML file while updating PO file |
# trick to allow building source w/o regenerating urls.ent unneededly |
| 172 |
$(DOCNAME).%.xml: $(PODOC)/$(DOCNAME).%.po $(DOCNAME).en.xml |
urls.ent: $(ASCSRCS) |
| 173 |
$(UPDATEPO) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).$*.po |
# $$ in following becomes $ under make: 5.0.2 -> 5.0 |
| 174 |
$(TRANSLATE) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).$*.po -l $(DOCNAME).$*.xml |
if [ $$(sed -n "s/^\([^.]*\.[^.]*\).*$$/\1/p" < /etc/debian_version) != "5.0" ]; then \ |
| 175 |
|
echo "You must be running lenny">&2 ; exit 1 ; fi |
| 176 |
|
if ! [ -f $(DOCNAME).raw.xml ]; then $(MAKE) $(DOCNAME).raw.xml ; fi |
| 177 |
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/urls.xsl $(DOCNAME).raw.xml | sort | uniq | sed -f bin/replace > $@ |
| 178 |
|
|
| 179 |
|
# package name list for popcon and size ent file generation |
| 180 |
|
# This file is not part of source |
| 181 |
|
pkg.lst: $(DOCNAME).raw.xml |
| 182 |
|
xsltproc --novalid $(VERBOSE) $(PXSLT)/pkg.xsl $< > $@ |
| 183 |
|
|
| 184 |
|
|
| 185 |
|
#=======================================================================# |
| 186 |
|
else |
| 187 |
|
#=======================================================================# |
| 188 |
|
# To avoid circular dependency |
| 189 |
|
$(DOCNAME).en.xml: |
| 190 |
|
echo "You need to run \"make xml\" in lenny environment" |
| 191 |
|
exit |
| 192 |
|
|
| 193 |
|
#=======================================================================# |
| 194 |
endif |
endif |
| 195 |
|
#=======================================================================# |
| 196 |
|
|
| 197 |
|
######################################################################### |
| 198 |
|
# POT/PO file operations LOCAL |
| 199 |
|
######################################################################### |
| 200 |
|
# Create new POT file in $(PODOC) matching $(DOCNAME).en.xml |
| 201 |
|
.PHONY: pot |
| 202 |
|
pot: $(PODOC)/$(DOCNAME).pot |
| 203 |
|
$(PODOC)/$(DOCNAME).pot: $(DOCNAME).en.xml |
| 204 |
|
$(GETTEXT) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).pot |
| 205 |
|
|
| 206 |
|
# Update new PO file in $(PODOC) by POT file |
| 207 |
|
$(PODOC)/$(DOCNAME).%.po: $(PODOC)/$(DOCNAME).pot |
| 208 |
|
$(UPDATEPO) $(PODOC)/$(DOCNAME).$*.po $(PODOC)/$(DOCNAME).pot |
| 209 |
|
|
| 210 |
|
# Update new PO file in $(PODOC) by POT file for English typo fix |
| 211 |
|
.PHONY: typo |
| 212 |
|
typo: |
| 213 |
|
-rm -f $(PODOC)/$(DOCNAME).pot.old |
| 214 |
|
cp $(PODOC)/$(DOCNAME).pot $(PODOC)/$(DOCNAME).pot.old |
| 215 |
|
$(MAKE) BUILD_MODE=asciidoc $(DOCNAME).en.xml |
| 216 |
|
$(GETTEXT) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).pot |
| 217 |
|
# repeat for all languages |
| 218 |
|
for $$xx in $(LANGPO) ; do \ |
| 219 |
|
msguntypot -o $(PODOC)/$(DOCNAME).pot.old -n $(PODOC)/$(DOCNAME).pot $(PODOC)/$(DOCNAME).$$xx.po ;\ |
| 220 |
|
done |
| 221 |
|
|
| 222 |
|
######################################################################### |
| 223 |
|
# Translate XML files ALL |
| 224 |
|
######################################################################### |
| 225 |
|
$(DOCNAME).%.xml: $(PODOC)/$(DOCNAME).%.po $(DOCNAME).en.xml |
| 226 |
|
$(TRANSLATE) -m $(DOCNAME).en.xml -p $(PODOC)/$(DOCNAME).$*.po -l $(DOCNAME).$*.xml |
| 227 |
|
|
| 228 |
######################################################################### |
######################################################################### |
| 229 |
# Create HTML files ALL |
# Create HTML files ALL |
| 230 |
######################################################################### |
######################################################################### |
| 283 |
@sed -ne "s/<\!ENTITY [^ ]* \"\(.*\)\">$$/\"\1\"/p" < $< | uniq | xargs -n 1 wget -O /dev/null -nv |
@sed -ne "s/<\!ENTITY [^ ]* \"\(.*\)\">$$/\"\1\"/p" < $< | uniq | xargs -n 1 wget -O /dev/null -nv |
| 284 |
@echo "----- URL check (end) -----" |
@echo "----- URL check (end) -----" |
| 285 |
|
|
|
.PHONY: test |
|
|
test: guide-line.en.html |
|
|
guide-line.xml: guide-line.txt |
|
|
asciidoc -a 'newline=\n' -b docbook -d book -o - $< > $@ |
|
|
|
|
|
guide-line.en.html: guide-line.xml |
|
|
$(XP) --stringparam root.filename guide-line \ |
|
|
--stringparam base.dir $(DRPUBLISHDIR)/ \ |
|
|
--stringparam html.ext .en.html \ |
|
|
--stringparam html.stylesheet xslt/$(DOCNAME).css \ |
|
|
xslt/style-onehtml.xsl $< |
|
|
|
|
| 286 |
####################################################################### |
####################################################################### |
| 287 |
# Update source using remotely fetched data ALL |
# Update source using remotely fetched data ALL |
| 288 |
####################################################################### |
####################################################################### |
| 289 |
.PHONY: update |
.PHONY: update |
| 290 |
update: |
update: |
| 291 |
$(MAKE) distclean |
$(MAKE) distclean |
| 292 |
$(MAKE) $(ENTSRCS) |
$(MAKE) xml |
| 293 |
endif$(MAKE) clean |
$(MAKE) clean |
| 294 |
|
|
| 295 |
####################################################################### |
####################################################################### |
| 296 |
# Build html for web (DDP or alioth) ALL |
# Build html for web (DDP or alioth) ALL |
| 298 |
.PHONY: publish |
.PHONY: publish |
| 299 |
|
|
| 300 |
publish: |
publish: |
| 301 |
# rm -rf $(DRPUBLISHDIR) |
-mkdir -p $(DRPUBLISHDIR) |
| 302 |
# rm -rf $(PUBLISHDIR)/reference |
# -rm -rf $(DRPUBLISHDIR)/debian-reference |
| 303 |
mkdir -p $(DRPUBLISHDIR) |
-rm -f $(PUBLISHDIR)/reference |
| 304 |
ln -sf $(DRPUBLISHDIR) $(PUBLISHDIR)/reference |
-ln -sf $(DRPUBLISHDIR) $(PUBLISHDIR)/reference |
| 305 |
$(MAKE) html txt css |
$(MAKE) html txt css PUBLISHDIR=$(PUBLISHDIR) "LANGPO=$(LANGPO)" |
| 306 |
$(MAKE) -C sgml all PUBLISHDIR=$(DRPUBLISHDIR) "LANG_ALL=$(LANGSGML)" |
$(MAKE) -C sgml all PUBLISHDIR=$(DRPUBLISHDIR) "LANG_ALL=$(LANGSGML)" |
| 307 |
ls -lR $(PUBLISHDIR) |
# ls -lR $(PUBLISHDIR) |
| 308 |
|
|
| 309 |
.PHONY: all |
####################################################################### |
| 310 |
|
# Build xml/html for testing source (local) ALL |
| 311 |
|
####################################################################### |
| 312 |
|
.PHONY: xml |
| 313 |
|
xml: |
| 314 |
|
# making sure to rebuild all |
| 315 |
|
touch asciidoc/00_preface.txt |
| 316 |
|
$(MAKE) BUILD_MODE=asciidoc $(XMLSRCS) "LANGPO=$(LANGPO)" |
| 317 |
|
|
| 318 |
|
.PHONY: all |
| 319 |
all: |
all: |
| 320 |
$(MAKE) html txt css |
# making sure to rebuild all |
| 321 |
|
touch asciidoc/00_preface.txt |
| 322 |
|
$(MAKE) BUILD_MODE=asciidoc html txt css "LANGPO=$(LANGPO)" |
| 323 |
$(MAKE) -C sgml all PUBLISHDIR=$(DRPUBLISHDIR) "LANG_ALL=$(LANGSGML)" |
$(MAKE) -C sgml all PUBLISHDIR=$(DRPUBLISHDIR) "LANG_ALL=$(LANGSGML)" |
| 324 |
# skip if DDP |
# # skip if DDP |
| 325 |
export HTMLROOT=$(PUBLISHDIR) ; bin/mkindexhtml |
# export HTMLROOT=$(PUBLISHDIR) ; bin/mkindexhtml |
| 326 |
$(MAKE) rsync |
# if [ $$USER = "osamu" ]; then $(MAKE) rsync ; fi |
| 327 |
|
|
| 328 |
####################################################################### |
####################################################################### |
| 329 |
# Clean targets ALL |
# Clean targets ALL |
| 332 |
|
|
| 333 |
clean: |
clean: |
| 334 |
-rm -f *.swp *~ *.tmp |
-rm -f *.swp *~ *.tmp |
| 335 |
|
-rm -rf html |
| 336 |
|
-rm -f $(PODOC)/*~ |
| 337 |
ifneq ($(PDIR),ddp-svn) |
ifneq ($(PDIR),ddp-svn) |
| 338 |
-rm -f all-popcon-results.txt packages.txt pkg.lst |
-rm -f all-popcon-results.txt packages.txt pkg.lst |
| 339 |
-rm -f $(DOCNAME).ja.xml |
-rm -f $(addsuffix .xml, $(addprefix $(DOCNAME)., $(LANGPO))) |
| 340 |
-rm -f $(DOCNAME).raw.xml |
-rm -f $(DOCNAME).raw.xml |
| 341 |
$(MAKE) -C sgml clean "LANG_ALL=$(LANGSGML)" |
$(MAKE) -C sgml clean "LANG_ALL=$(LANGSGML)" PUBLISHDIR=$(DRPUBLISHDIR) |
| 342 |
endif |
endif |
| 343 |
|
|
| 344 |
distclean: clean |
distclean: clean |
| 347 |
ifeq ($(PDIR),ddp-svn) |
ifeq ($(PDIR),ddp-svn) |
| 348 |
-rm -f all-popcon-results.txt packages.txt pkg.lst |
-rm -f all-popcon-results.txt packages.txt pkg.lst |
| 349 |
-rm -f $(DOCNAME).*.xml |
-rm -f $(DOCNAME).*.xml |
| 350 |
$(MAKE) -C sgml clean "LANG_ALL=$(LANGSGML)" |
$(MAKE) -C sgml distclean "LANG_ALL=$(LANGSGML)" PUBLISHDIR=$(DRPUBLISHDIR) |
| 351 |
endif |
endif |
| 352 |
|
|