diff --git a/.gitignore b/.gitignore
index 295e59c9..089c0de2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,29 @@
+*.po.*
+*.po-*
*.mo
*.swp
*.tmp
*~
.git
-.gitignore
+all-popcon-date.txt
all-popcon-pkgs.txt
all-popcon-results.txt
all-popcon-submissions.txt
+build
+common.ent
debian-reference.*.xml
debian-reference.*.xmlt
+debian-reference.rawxml
+fuzzy.log
header.rawxml
-packages.bkup.txt
packages.contrib
+packages.experimental.txt
packages.main
packages.non-free
+packages.oldstable.txt
+packages.stable.txt
packages.txt
pkg.lst
-rawxml/debian-reference.rawxml
+templates.pot
tmp
-fuzzy.log
-po/templates.pot
diff --git a/Makefile b/Makefile
index 904c1f37..43594762 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,9 @@
# Build debian-reference (v2)
# vim: set ts=8:
#######################################################################
-### key adjustable parameters
-#######################################################################
+#======================================================================
+# ===== Adjustable parameters =========================================
+#======================================================================
# base file name excluding file extension
MANUAL := debian-reference
# languages translated with PO files
@@ -14,21 +15,33 @@ NOPDF :=
# languages to build document
LANGALL = en $(LANGPO)
-# Change at the last moment (this package is part of web page)
+# Packages uploaded to unstable repo generate official Debian web pages
+# Change these to post-release state when Debian is under soft freeze
+#
+# current "stable" release name
+RELEASE_NAME0L := bullseye
+RELEASE_NAME0C := Bullseye
+# next "stable" / "testing" release name
+RELEASE_NAME1L := bookworm
+RELEASE_NAME1C := Bookworm
+# next next "stable" / next "testing" release name
+RELEASE_NAME2L := trixie
+RELEASE_NAME2C := Trixie
+# release name considered outdated (Release_Date-EOL_for_LTS)
+RELEASE_NAMEXX := Jessie 8 (2015-2020)
+# release names when this document was last updated
+RELEASE_DOC_1 := Bullseye (=stable)
+RELEASE_DOC_2 := Bookworm (=testing)
-# "stable" release name in document matches current "stable" release name
-# * This is used for unstable upload well before almost freeze
-# * This is used for post *.2 release updates
-#RELEASE_STATE := normal
+# version in changelog
+DR_VERSION := $(shell dpkg-parsechangelog --show-field Version)
+# set SOURCE_DATE_EPOCH if unset (when not called from debhelper)
+SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
+# date in changelog
+SOURCE_DATE := $(shell date -u +'%F %T %Z' --date=@$(SOURCE_DATE_EPOCH))
-# "stable" release name in document matches current "testing" release name
-# * This is used for unstable upload after almost freeze before *.1 release
-RELEASE_STATE := freeze
-
-# TMP_DIR_DR is not mean to be set to generic TMPDIR like /tmp ~/.tmp
-ifndef TMP_DIR_DR
-TMP_DIR_DR := $(CURDIR)/tmp
-endif
+# BUILD_DIR is not mean to be set to generic TMPDIR
+BUILD_DIR := $(CURDIR)/build
# Change $(DRAFTMODE) from "yes" to "maybe" when this document
# should go into production mode
@@ -59,9 +72,19 @@ GETTEXT := po4a-gettextize -M utf-8 -L utf-8 --format docbook
UPDATEPO:= msgmerge --update --previous
MSGATTR := msgattrib
MSGCAT := msgcat
+MSGUNIQ := msguniq --use-first
DBLATEX := dblatex
+SED := sed
-# Debian package archive URL
+# Source files
+SRC_XML := $(wildcard $(DRAW)/*_*.rawxml)
+SRC_ENT:= remote.ent common.ent
+# source PO files for all languages (build prcess requires these)
+SRC_PO := $(addsuffix .po, $(addprefix $(DPO)/, $(LANGPO)))
+# sed script for replace
+SEDF ?= $(DBIN)/replace0
+
+# Remote file source (related to Debian package archive URLs)
#DEBM := http://ftp.us.debian.org/debian/dists
#DEBM := http://ftp.jp.debian.org/debian/dists
DEBM := http://deb.debian.org/debian/dists
@@ -74,7 +97,17 @@ UDEBA := $(DEBM)/$(CODE)
UDEBB := $(DEBM)/experimental
UDEBC := $(DEBM)/stable
UDEBD := $(DEBM)/oldstable
-DR_VERSION := $(shell dpkg-parsechangelog --show-field Version)
+# processed remote data
+PACKAGES_DATA := packages.main packages.contrib packages.non-free \
+ packages.txt packages.experimental.txt \
+ packages.stable.txt packages.oldstable.txt
+POPCON_DATA := all-popcon-results.txt \
+ all-popcon-date.txt \
+ all-popcon-submissions.txt \
+ all-popcon-pkgs.txt
+PKG_LIST := pkg.lst
+REMOTE_DATA := $(PACKAGES_DATA) $(POPCON_DATA)
+
#######################################################################
# Used as $(call check-command, , )
@@ -84,6 +117,16 @@ set -e; if ! which $(1) >/dev/null; then \
false; \
fi
endef
+# Used as $(call check-file, )
+define check-file
+set -e; if ! [ -r $(1) ]; then \
+ echo "Missing file: $(1)"; \
+ false; \
+fi
+endef
+#======================================================================
+# ===== Build targets =================================================
+#======================================================================
#######################################################################
# $ make all # build all
#######################################################################
@@ -97,19 +140,27 @@ all: css html txt epub pdf
#######################################################################
.PHONY: test
test: html css
+ cat fuzzy.log
+
+#######################################################################
+# $ make entity # refresh remote.ent (Need remote access)
+#######################################################################
+# For major English update, run this and commit updated data
+.PHONY: entity
+entity:
+ $(MAKE) entityclean
+ $(MAKE) remote.ent
+#######################################################################
+# $ make en # build html for testing (for English)
+#######################################################################
+.PHONY: en
+en:
+ $(MAKE) entity
+ $(MAKE) html css LANGPO=
#######################################################################
# Phase 1 (pre-build): Debian archive stat data
#######################################################################
-# fetch remote data (not for every build) and cached these data
-PACKAGES_DATA := packages.main packages.contrib packages.non-free \
- packages.txt packages.bkup.txt \
- packages.stable.txt packages.oldstable.txt
-POPCON_DATA := all-popcon-results.txt \
- all-popcon-submissions.txt \
- all-popcon-pkgs.txt pkg.lst
-REMOTE_DATA := $(PACKAGES_DATA) $(POPCON_DATA)
-
.PHONY: remote
remote: $(REMOTE_DATA)
@@ -137,17 +188,17 @@ packages.non-free:
grep-dctrl -e -sPackage,Installed-Size -P "." packages.non-free.tmp > packages.non-free
rm packages.non-free.tmp
-packages.txt: packages.main packages.contrib packages.non-free
- # FETCH PACKAGE (sid)
- cat packages.main packages.contrib packages.non-free >packages.txt
-
-packages.bkup.txt:
+packages.experimental.txt:
# FETCH PACKAGE (experimental main)
@$(call check-command, wget, wget)
@$(call check-command, grep-dctrl, dctrl-tools)
- wget -O - $(UDEBB)/main/binary-$(ARCH)/Packages.xz | xzcat - > packages.bkup.tmp
- grep-dctrl -e -sPackage,Installed-Size -P "." packages.bkup.tmp > packages.bkup.txt
- rm packages.bkup.tmp
+ wget -O - $(UDEBB)/main/binary-$(ARCH)/Packages.xz | xzcat - > packages.experimental.tmp
+ grep-dctrl -e -sPackage,Installed-Size -P "." packages.experimental.tmp > packages.experimental.txt
+ rm packages.experimental.tmp
+
+packages.txt: packages.main packages.contrib packages.non-free
+ # FETCH PACKAGE (sid)
+ cat packages.main packages.contrib packages.non-free >packages.txt
packages.stable.txt:
# FETCH PACKAGE (stable main)
@@ -173,10 +224,13 @@ all-popcon-results.txt:
wget -O - $(UPOPC) | zcat - > all-popcon-results.txt
all-popcon-submissions.txt: all-popcon-results.txt
- sed -n -e 's/^Submissions: *\([^ ]*\) *$$/\1/p' < all-popcon-results.txt >all-popcon-submissions.txt
+ sed -n -e 's/^Submissions: *\([^ ]*\) *$$/\1/p' < all-popcon-results.txt > all-popcon-submissions.txt
+
+all-popcon-date.txt: all-popcon-results.txt
+ echo "" > all-popcon-date.txt
all-popcon-pkgs.txt: all-popcon-results.txt
- grep --binary-files=text -e '^Package: [a-z0-9][-+a-z0-9.]*[ 0-9]*$$' < all-popcon-results.txt >all-popcon-pkgs.txt
+ grep --binary-files=text -e '^Package: [a-z0-9][-+a-z0-9.]*[ 0-9]*$$' < all-popcon-results.txt > all-popcon-pkgs.txt
# RAWXML (with @emacs@ etc.) to PACKAGE LIST
pkg.lst: $(DRAW)/$(MANUAL).rawxml
@@ -185,88 +239,52 @@ pkg.lst: $(DRAW)/$(MANUAL).rawxml
$(XPNO) $(DXSL)/pkg.xsl $(DRAW)/$(MANUAL).rawxml > pkg.lst
# ENTITY DATA
-# source XML inclusion files (excluding common.ent)
-ENT_STAT:= datadatepop.ent datadatesize.ent popcon.ent pkgsize.ent common.ent
+# source XML inclusion file (pre-commited since this needs remote access)
+remote.ent:
+ $(MAKE) $(REMOTE_DATA) $(PKG_LIST)
+ cat all-popcon-date.txt > remote.ent
+ echo "" >> remote.ent
+ echo "" >> remote.ent
+ echo "" >> remote.ent
+ echo "" >> remote.ent
+ sort pkg.lst | uniq | $(DBIN)/sizeent packages.txt packages.experimental.txt packages.stable.txt packages.oldstable.txt >> remote.ent
+ echo "" >> remote.ent
+ echo "" >> remote.ent
+ echo "" >> remote.ent
+ grep -e '^Package:' all-popcon-pkgs.txt | grep -f pkg.lst | $(DBIN)/popconent `cat all-popcon-submissions.txt` >> remote.ent
-datadatesize.ent: packages.txt packages.main packages.contrib packages.non-free
- # GENERATE datesize.ent
- echo "" > datadatesize.ent
- echo "" >> datadatesize.ent
- echo "" >> datadatesize.ent
- echo "" >> datadatesize.ent
- echo "" >> datadatesize.ent
-
-
-datadatepop.ent:
- # GENERATE datadatepop.ent
- echo "" > datadatepop.ent
-
-popcon.ent: all-popcon-results.txt all-popcon-pkgs.txt all-popcon-submissions.txt pkg.lst
- # GENERATE datadatepop.ent
- echo "" > popcon.ent
- echo "" >> popcon.ent
- echo "" >> popcon.ent
- grep -e '^Package:' all-popcon-pkgs.txt | grep -f pkg.lst | $(DBIN)/popconent `cat all-popcon-submissions.txt` >> popcon.ent
-
-pkgsize.ent: pkg.lst packages.txt packages.bkup.txt packages.stable.txt packages.oldstable.txt
- # GENERATE pkgsize.ent
- sort pkg.lst | uniq | $(DBIN)/sizeent packages.txt packages.bkup.txt packages.stable.txt packages.oldstable.txt > pkgsize.ent
-
- # POPCON
- wget -O - $(UPOPC) | zcat - > all-popcon-results.txt
- sed -n -e 's/^Submissions: *\([^ ]*\) *$$/\1/p' < all-popcon-results.txt >all-popcon-submissions.txt
- grep --binary-files=text -e '^Package: [a-z0-9][-+a-z0-9.]*[ 0-9]*$$' < all-popcon-results.txt >all-popcon-pkgs.txt
-
-common.ent:
- # GENERATE common.ent
- # Release for package match with actual situation
- echo "" > common.ent
- echo "" >> common.ent
+# GENERATE
+# source XML inclusion file updated for normal build (no remote access)
+common.ent: Makefile debian/changelog
+ echo "" > common.ent
echo "" >> common.ent
-ifeq ($(RELEASE_STATE),normal)
- # Build for web to match current reality
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
-else
- # For post-almost-freeze upload to match post-release reality
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
- echo "" >> common.ent
-endif
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
echo "" >> common.ent
echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
+ echo "" >> common.ent
-# For major English update, run this and commit data
-.PHONY: entity
-entity:
- $(MAKE) distclean
- $(MAKE) $(ENT_STAT)
- $(MAKE) clean
- # PLEASE MAKE SURE TO COMMIT TO VCS
#######################################################################
-# Phase 2(build): RAWXML (template) -> XML -> All formats
+# Phase 2(build): RAWXML (template) -> English XML
#######################################################################
-.PHONY: rawxml
-rawxml: $(DRAW)/$(MANUAL).rawxml
-
-$(DRAW)/$(MANUAL).rawxml: $(wildcard $(DRAW)/*_*.rawxml)
+$(DRAW)/$(MANUAL).rawxml: $(SRC_XML)
#echo $^
cd $(DRAW) ; ./merge.sh
# Update URL list header from $(MANUAL).rawxml
-$(DRAW)/header.rawxml: $(DRAW)/header1.rawxml $(DRAW)/header2.rawxml
+$(DRAW)/header.rawxml: $(DRAW)/header1.rawxml $(DRAW)/header2.rawxml $(DRAW)/$(MANUAL).rawxml
cat $(DRAW)/header1.rawxml > $(DRAW)/header.rawxml
$(XPNO) $(DXSL)/urls.xsl $(DRAW)/$(MANUAL).rawxml | sort | uniq |\
- sed -e "s/&/\&/g" >> $(DRAW)/header.rawxml
+ sed -e "s/&/\&/g" | fgrep -v -e '' >> $(DRAW)/header.rawxml
cat $(DRAW)/header2.rawxml >> $(DRAW)/header.rawxml
# Replace table contents with @-@popcon*@-@ and @@@psize*@-@ and
@@ -279,7 +297,7 @@ $(MANUAL).en.xml: $(DRAW)/$(MANUAL).rawxml $(DRAW)/header.rawxml
sed -e 's/@-@amp@-@/\&/g' -e 's/@-@\([^@]\+\)@-@/\&\1;/g' > $@
# Replace table contents with dummy text and
-# fix URL referencees and table ID as the template for translation.
+# fix URL references and table ID as the template for translation.
# This avoids bloated PO/POT files. (tablet.xsl used instead of table.xsl)
$(MANUAL).en.xmlt: $(DRAW)/$(MANUAL).rawxml $(DRAW)/header.rawxml
# GENERATE $(MANUAL).en.xmlt (TEMPLATE to avoid bloated PO/POT files)
@@ -291,10 +309,8 @@ $(MANUAL).en.xmlt: $(DRAW)/$(MANUAL).rawxml $(DRAW)/header.rawxml
sed -e 's/@-@amp@-@/\&/g' -e 's/@-@\([^@]\+\)@-@/\&\1;/g' > $@
#######################################################################
-# Phase 7 build : POT/PO/XML non-ENGLISH (with template XML)
+# Phase 3 build : English XML -> POT/PO/XML non-ENGLISH
#######################################################################
-# source PO files for all languages (build prcess requires these)
-SRC_PO := $(addsuffix .po, $(addprefix $(DPO)/, $(LANGPO)))
.PHONY: po pot
pot: $(DPO)/templates.pot
po: $(SRC_PO)
@@ -324,89 +340,88 @@ $(DPO)/%.po: $(DPO)/templates.pot FORCE
$(DBIN)/fuzzypo $(DPO)/$*.po >>fuzzy.log
FORCE:
+ @: "FORCE target"
-# source XML files for all languages (build prcess requires these)
-SRC_XML := $(addsuffix .xml, $(addprefix $(MANUAL)., $(LANGALL)))
+# base XML files for all languages
.PHONY: xml
-xml: $(SRC_XML)
+xml: $(addsuffix .xml, $(addprefix $(MANUAL)., $(LANGALL)))
$(MANUAL).%.xml: $(DPO)/%.po $(MANUAL).en.xml
@$(call check-command, po4a-translate, po4a)
@$(call check-command, msgcat, gettext)
$(DBIN)/genxml $*
-
#######################################################################
-# Phase 8 build : Formatted conversion from XML
+# Phase 4 build : Formatted conversion from XML
#######################################################################
#######################################################################
-# $ make css # update CSS and DIMG in $(TMP_DIR_DR)
+# $ make css # update CSS and DIMG in $(BUILD_DIR)
#######################################################################
.PHONY: css
css:
- -rm -rf $(TMP_DIR_DR)/images
- mkdir -p $(TMP_DIR_DR)/images
- cp -f $(DXSL)/$(MANUAL).css $(TMP_DIR_DR)/$(MANUAL).css
- echo "AddCharset UTF-8 .txt" > $(TMP_DIR_DR)/.htaccess
- #cd $(DIMG) ; cp caution.png home.png important.png next.png note.png prev.png tip.png up.gif warning.png $(TMP_DIR_DR)/images
- cd $(DIMG) ; cp caution.png important.png note.png tip.png up.gif warning.png $(TMP_DIR_DR)/images
- cd png ; cp home.png next.png prev.png $(TMP_DIR_DR)/images
+ -rm -rf $(BUILD_DIR)/images
+ mkdir -p $(BUILD_DIR)/images
+ cp -f $(DXSL)/$(MANUAL).css $(BUILD_DIR)/$(MANUAL).css
+ echo "AddCharset UTF-8 .txt" > $(BUILD_DIR)/.htaccess
+ #cd $(DIMG) ; cp caution.png home.png important.png next.png note.png prev.png tip.png up.gif warning.png $(BUILD_DIR)/images
+ cd $(DIMG) ; cp caution.png important.png note.png tip.png up.gif warning.png $(BUILD_DIR)/images
+ cd png ; cp home.png next.png prev.png $(BUILD_DIR)/images
#######################################################################
-# $ make html # update all HTML in $(TMP_DIR_DR)
+# $ make html # update all HTML in $(BUILD_DIR)
#######################################################################
.PHONY: html
-html: $(foreach LX, $(LANGALL), $(TMP_DIR_DR)/index.$(LX).html)
+html: $(foreach LX, $(LANGALL), $(BUILD_DIR)/index.$(LX).html)
-$(TMP_DIR_DR)/index.%.html: $(MANUAL).%.xml
+$(BUILD_DIR)/index.%.html: $(MANUAL).%.xml $(SRC_ENT)
@$(call check-command, xsltproc, xsltproc)
- -mkdir -p $(TMP_DIR_DR)
- $(XPINC) --stringparam base.dir $(TMP_DIR_DR)/ \
+ -mkdir -p $(BUILD_DIR)
+ $(XPINC) --stringparam base.dir $(BUILD_DIR)/ \
--stringparam html.ext .$*.html \
$(DXSL)/style-html.xsl $<
#######################################################################
-# $ make txt # update all Plain TEXT in $(TMP_DIR_DR)
+# $ make txt # update all Plain TEXT in $(BUILD_DIR)
#######################################################################
.PHONY: txt
-txt: $(foreach LX, $(LANGALL), $(TMP_DIR_DR)/$(MANUAL).$(LX).txt.gz)
+txt: $(foreach LX, $(LANGALL), $(BUILD_DIR)/$(MANUAL).$(LX).txt.gz)
# style-txt.xsl provides work around for hidden URL links by appending them explicitly.
-$(TMP_DIR_DR)/$(MANUAL).%.txt.gz: $(MANUAL).%.xml
+$(BUILD_DIR)/$(MANUAL).%.txt.gz: $(MANUAL).%.xml $(SRC_ENT)
@$(call check-command, w3m, w3m)
@$(call check-command, xsltproc, xsltproc)
- -mkdir -p $(TMP_DIR_DR)
+ -mkdir -p $(BUILD_DIR)
@test -n "`which w3m`" || { echo "ERROR: w3m not found. Please install the w3m package." ; false ; }
$(XPINC) $(DXSL)/style-txt.xsl $< | LC_ALL=en_US.UTF-8 \
w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html | \
gzip -n -9 - > $@
#######################################################################
-# $ make pdf # update all PDF in $(TMP_DIR_DR)
+# $ make pdf # update all PDF in $(BUILD_DIR)
#######################################################################
.PHONY: pdf
-pdf: $(foreach LX, $(LANGALL), $(TMP_DIR_DR)/$(MANUAL).$(LX).pdf)
+pdf: $(foreach LX, $(LANGALL), $(BUILD_DIR)/$(MANUAL).$(LX).pdf)
-nopdf: $(TMP_DIR_DR)/nopdf.pdf
+nopdf: $(BUILD_DIR)/nopdf.pdf
-$(TMP_DIR_DR)/nopdf.pdf: nopdf.tex
+$(BUILD_DIR)/nopdf.pdf: nopdf.tex
-mkdir -p $(CURDIR)/tmp
cd "$(CURDIR)/tmp/"; \
xelatex ../nopdf.tex
-$(foreach LX, $(NOPDF), $(TMP_DIR_DR)/$(MANUAL).$(LX).pdf): $(TMP_DIR_DR)/nopdf.pdf
- -mkdir -p $(TMP_DIR_DR)
- cp $(TMP_DIR_DR)/nopdf.pdf $@
+$(foreach LX, $(NOPDF), $(BUILD_DIR)/$(MANUAL).$(LX).pdf): $(BUILD_DIR)/nopdf.pdf
+ -mkdir -p $(BUILD_DIR)
+ cp $(BUILD_DIR)/nopdf.pdf $@
# dblatex.xsl provide work around for hidden URL links by appending them explicitly.
-$(TMP_DIR_DR)/$(MANUAL).%.pdf: $(MANUAL).%.xml
+$(BUILD_DIR)/$(MANUAL).%.pdf: $(MANUAL).%.xml $(SRC_ENT)
@$(call check-command, dblatex, dblatex)
@$(call check-command, xsltproc, xsltproc)
-mkdir -p $(CURDIR)/tmp
@test -n "`which $(DBLATEX)`" || { echo "ERROR: dblatex not found. Please install the dblatex package." ; false ; }
export TEXINPUTS=".:"; \
- export TMP_DIR_DR="$(CURDIR)/tmp/"; \
+ export BUILD_DIR="$(CURDIR)/tmp/"; \
$(XPINC) $(DXSL)/dblatex.xsl $< | \
$(DBLATEX) --style=native \
--debug \
@@ -418,17 +433,17 @@ $(TMP_DIR_DR)/$(MANUAL).%.pdf: $(MANUAL).%.xml
--output=$@ - || { echo "OMG!!!!!! XXX_CHECK_XXX ... Do not worry ..."; true ; }
#######################################################################
-# $ make tex # update all TeX source in $(TMP_DIR_DR)
+# $ make tex # update all TeX source in $(BUILD_DIR)
#######################################################################
.PHONY: tex
-tex: $(foreach LX, $(LANGALL), $(TMP_DIR_DR)/$(MANUAL).$(LX).tex)
+tex: $(foreach LX, $(LANGALL), $(BUILD_DIR)/$(MANUAL).$(LX).tex)
# dblatex.xsl provide work around for hidden URL links by appending them explicitly.
-$(TMP_DIR_DR)/$(MANUAL).%.tex: $(MANUAL).%.xml
+$(BUILD_DIR)/$(MANUAL).%.tex: $(MANUAL).%.xml $(SRC_ENT)
-mkdir -p $(CURDIR)/tmp
@test -n "`which $(DBLATEX)`" || { echo "ERROR: dblatex not found. Please install the dblatex package." ; false ; }
export TEXINPUTS=".:"; \
- export TMP_DIR_DR="$(CURDIR)/tmp/"; \
+ export BUILD_DIR="$(CURDIR)/tmp/"; \
$(XPINC) $(DXSL)/dblatex.xsl $< | \
$(DBLATEX) --style=native \
--debug \
@@ -441,54 +456,71 @@ $(TMP_DIR_DR)/$(MANUAL).%.tex: $(MANUAL).%.xml
--output=$@ - || { echo "OMG!!!!!! XXX_CHECK_XXX ... Do not worry ..."; true ; }
#######################################################################
-# $ make epub # update all epub in $(TMP_DIR_DR)
+# $ make epub # update all epub in $(BUILD_DIR)
#######################################################################
.PHONY: epub
-epub: $(foreach LX, $(LANGALL), $(TMP_DIR_DR)/$(MANUAL).$(LX).epub)
+epub: $(foreach LX, $(LANGALL), $(BUILD_DIR)/$(MANUAL).$(LX).epub)
-$(TMP_DIR_DR)/$(MANUAL).%.epub: $(MANUAL).%.xml
+$(BUILD_DIR)/$(MANUAL).%.epub: $(MANUAL).%.xml $(SRC_ENT)
@$(call check-command, xsltproc, xsltproc)
- -mkdir -p $(TMP_DIR_DR)/$*/
- cd $(TMP_DIR_DR)/$*/ ; $(XPINC) $(CURDIR)/$(DXSL)/style-epub.xsl $(CURDIR)/$<
- cp -f $(DXSL)/mimetype $(TMP_DIR_DR)/$*/mimetype
- cp -f $(DXSL)/debian-reference.css $(TMP_DIR_DR)/$*/OEBPS/debian-reference.css
- cp -f $(DXSL)/debian-openlogo.png $(TMP_DIR_DR)/$*/OEBPS/debian-openlogo.png
- cd $(TMP_DIR_DR)/$*/ ; zip -r $@ ./
+ -mkdir -p $(BUILD_DIR)/$*/
+ cd $(BUILD_DIR)/$*/ ; $(XPINC) $(CURDIR)/$(DXSL)/style-epub.xsl $(CURDIR)/$<
+ cp -f $(DXSL)/mimetype $(BUILD_DIR)/$*/mimetype
+ cp -f $(DXSL)/debian-reference.css $(BUILD_DIR)/$*/OEBPS/debian-reference.css
+ cp -f $(DXSL)/debian-openlogo.png $(BUILD_DIR)/$*/OEBPS/debian-openlogo.png
+ cd $(BUILD_DIR)/$*/ ; zip -r $@ ./
#######################################################################
-# Phase 9 post/pre build: clean and distclean
+# Phase 5 cleans
#######################################################################
#######################################################################
# $ make clean # clean files ready for tar
+# (override_dh_auto_clean call this)
#######################################################################
.PHONY: clean
-clean:
- # CLEAN
- -rm -f *.swp *~ *.tmp
- -rm -f $(DPO)/*~ $(DPO)/*.mo $(DPO)/*.po.*
- -rm -rf tmp debian/tmp $(PUBLISHDIR)/$(MANUAL)
- -rm -f $(addsuffix .xml, $(addprefix $(MANUAL)., $(LANGALL)))
- -rm -f $(MANUAL).en.xml $(MANUAL).en.xmlt header.rawxml
- -rm -f $(REMOTE_DATA)
-
-#######################################################################
-# $ make distclean # clean files to reset RAWXML/ENT/POT
-#######################################################################
+clean: localclean remoteclean
.PHONY: distclean
distclean: clean
- # DISTCLEAN
- -rm -f $(ENT_STAT)
+#######################################################################
+# $ make localclean # clean locally generated files
+#######################################################################
+.PHONY: localclean
+localclean:
+ # CLEAN
+ -rm -rf $(BUILD_DIR)
+ -rm -rf debian/tmp
+ -rm -f *.swp *~ *.tmp
+ -rm -f $(DPO)/*~ $(DPO)/*.mo $(DPO)/*.po.*
+ -rm -f common.ent
+ -rm -f $(addsuffix .xml, $(addprefix $(MANUAL)., $(LANGALL)))
+ -rm -f $(addsuffix .xmlt, $(addprefix $(MANUAL)., $(LANGALL)))
+ -rm -f $(DRAW)/$(MANUAL).rawxml
+ -rm -f $(DRAW)/header.rawxml
-rm -f $(DPO)/*.pot
-rm -f fuzzy.log
#######################################################################
-### Utility targets
+# $ make remoteclean # clean remote data to generate entity files
#######################################################################
+.PHONY: remoteclean
+remoteclean:
+ -rm -f $(REMOTE_DATA)
+
+#######################################################################
+# $ make entityclean # clean entity files generated from remote data
+#######################################################################
+.PHONY: entityclean
+entityclean:
+ -rm -f remote.ent
+
+#======================================================================
+# ===== Utility targets ===============================================
+#======================================================================
#######################################################################
# $ make wrap # wrap all PO
#######################################################################
-.PHONY: wrap nowrap wip
+.PHONY: wrap nowrap wip replace
wrap:
@$(call check-command, msgcat, gettext)
for XX in $(foreach LX, $(LANGPO), $(DPO)/$(LX).po); do \
@@ -500,6 +532,22 @@ nowrap:
$(MSGCAT) -o $$XX --no-wrap $$XX ;\
done
+replace:
+ @$(call check-file, $(SEDF))
+ @$(call check-command, msgcat, gettext)
+ @$(call check-command, msguniq, gettext)
+ for XX in $(foreach LX, $(LANGPO), $(DPO)/$(LX).po); do \
+ $(MSGCAT) -o $$XX --no-wrap $$XX ;\
+ done
+ for XX in $(foreach LX, $(LANGPO), $(DPO)/$(LX).po); do \
+ cat $$XX >$$XX.sed ;\
+ $(SED) -f $(SEDF) <$$XX | sed -n -e '/^msgid "[^"]/,$$p' >>$$XX.sed ;\
+ $(MSGUNIQ) -o $$XX.uniq $$XX.sed ;\
+ done
+ for XX in $(foreach LX, $(LANGPO), $(DPO)/$(LX).po); do \
+ $(MSGCAT) -o $$XX $$XX.uniq ;\
+ done
+
wip:
@$(call check-command, msgattrib, gettext)
for XX in $(foreach LX, $(LANGPO), $(DPO)/$(LX).po); do \
@@ -513,7 +561,7 @@ wip:
#######################################################################
.PHONY: rsync
rsync: all
- rsync -avz $(TMP_DIR_DR)/ osamu@people.debian.org:public_html/debian-reference/
+ rsync -avz $(BUILD_DIR)/ osamu@people.debian.org:public_html/debian-reference/
#######################################################################
# $ make url # check duplicate URL references
@@ -524,14 +572,3 @@ url: $(MANUAL).en.xml
-sed -ne "/^<\!ENTITY/s/<\!ENTITY \([^ ]*\) .*$$/\" \1 \"/p" < $< | uniq -d | xargs -n 1 grep $< -e | grep -e "^<\!ENTITY"
@echo "----- Duplicate URL references (end) -----"
-#######################################################################
-# Translate all
-#######################################################################
-$(DPO)/wikipedia.%.pot: $(DPO)/wikipedia.list
- $(DBIN)/interwiki $* "PRINT" < $< > $@
-
-#######################################################################
-# Translate untranslated
-#######################################################################
-$(DPO)/wikipedia.%.po: $(DPO)/wikipedia.%.list
- $(DBIN)/interwiki $* "NO" < $< > $@
diff --git a/README.md b/README.md
index 82ad7dbf..dea98102 100644
--- a/README.md
+++ b/README.md
@@ -82,10 +82,9 @@ this debian-reference salsa repository. If you are a non-Debian Developer
with `*-guest` account on salsa who needs write access to this
debian-reference salsa repository, you can inform your `*-guest` account to me
(or any DD) with clear intent and reasonable rationale and let me (or any DD)
-invite you to the write access with the "Developer" status from [the main
-debian-reference project
-page](https://salsa.debian.org/debian/debian-reference) via Setting-Member
-menu.
+invite you to the write access with the "Developer" status from
+[the main debian-reference project page](https://salsa.debian.org/debian/debian-reference)
+via Setting-Member menu.
See https://wiki.debian.org/Salsa/Doc for how to use this site.
@@ -358,43 +357,88 @@ The English source is kept as rawxml/*_*.rawxml files under rawxml/.
The translation source is kept as PO files under po/.
```
- >>> rawxml/*_*.rawxml
- |
- >>> debian-reference.rawxml ------> (make entity) <=> remotely fetched
- | | | : data files (+)
- | | +---------------------+ :
- | | | :
- | v v v
- | debian-reference.en.xml common.ent url.ent and *.ent files
- | : (**) | | |
- v v | | |
- debian-reference.en.xmlt | | |
- | | | |
- v | | |
- templates.pot | | |
- | | | |
- v (make po) | | |
- >>> ja.po | | |
- | fuzzy.log (++) | | |
- v | | |
- debian-reference.ja.xml | | |
- | | | |
- v v v v
- +----------+-------------+-----------+--------+
- |(make all), (make test),
- |(make html), (make txt), (make pdf), ...
- v
+ >>> rawxml/*_*.rawxml remotely fetched data files
+ $(RAWXML) $(REMOTE_DATA)
+ ========= ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | :
+ | :
+ debian-reference.rawxml :
+ | :
+ | :
+ +---> pkg.lst -------------------> pkgsize.ent, popcon.ent, common.ent
+ | $(RAWENT) (+)
+ | ========
+ | |
+ +---> $(DRAW)/header.rawxml |
+ | | |
+ +<--------+ |
+ | |
+ | |
+ +---------------------------+ |
+ | | |
+ | | |
+ debian-reference.en.xmlt debian-reference.en.xml |
+ | (**) | | |
+ | | | |
+ templates.pot | | |
+ | | | |
+ | | | |
+ ja.po | | |
+ $(PO) | | |
+ ===== | | |
+ | | | |
+ | | | |
+ +---------------------------+ | |
+ | | |
+ | | |
+ debian-reference.ja.xml | |
+ | (fuzzy.log) (++) | |
+ | | |
+ | | |
+ +----------------------------------------------+----------+
+ |(make all), (make test),
+ |(make html), (make txt), (make pdf), ...
+ v
all documents (*.*.html *.*.txt *.*.pdf)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
+```
+# RAWXML updated with reference to new packages
+ $ make entity # update all RAWENT with REMOTE_DATA (NET)
+# RAWXML updated without reference to new packages
+ $ # no action needed
+# before PO update for LANGPO=XX
+ $ make po LANGPO=XX # update all PO in sync with RAWXML and RAWENT
+# after PO update for LANGPO=XX
+ $ make po LANGPO=XX # normalize PO
+# clean source for commit (except ===== data)
+ $ make clean
+# clean source for commit (except ===== and ^^^^^^^ data) (Keep remote data)
+ $ make localclean
+# clean source including entity (except ===== and ^^^^^^^ data) (Keep remote data)
+ $ make entityclean
+# build package
+ $ make all # build all documents
+# test build English html (keep REMOTE_DATA)
+ $ make en
+# test build LANGPO=XX html
+ $ make test LANGPO=XX
+# no wrap po file for LANGPO=XX
+ $ make nowrap LANGPO=XX
+# wrap po file for LANGPO=XX
+ $ make wrap LANGPO=XX
+# replace string with 'sed -f foo' over po file for LANGPO=XX
+ $ make replace LANGPO=XX SEDF=foo
+```
* (`+`) When the English source changes URL link location or packages
- mentioned in the package list table, you need to update `*.ent` files in the
- source by running "`make entity`" with remote file access.
+ mentioned in the package list table, you need to update `*.ent` files in the
+ source by running "`make entity`" with remote file access.
* (`**`) `debian-reference.en.xmlt` effectively replaces untranslatable
- contents in `debian-reference.en.xml` with "DUMMY" to reduce clutter in PO
- files.
+ contents in `debian-reference.en.xml` with "DUMMY" to reduce clutter in PO
+ files.
* (`++`) `fuzzy.log` file contains number of fuzzy translation. If not zero,
- please update PO file.
+ please manually update PO file contents.
### Build failure due to po/*.add
@@ -408,32 +452,6 @@ rename `po/foo.add-keep` back to `po/foo.add` and update the matching string.
It's tricky. (This should be less problematic after recent po4a updates)
-### List of make targets
-
-```
- $ make all # build all
- $ make test # build html for testing (for Translator)
- $ make package # build html and text from RAWXML/PO for DDP
- $ make publish # build html text pdf from RAWXML/PO for DDP
- $ make clean # clean files ready for tar
- $ make distclean # clean files to reset ENT/POT
- $ make rawxml # update debian-reference.rawxml from split-RAWXML
- $ make entity # update ENT and local cache data from RAWXML/REMOTE
- $ make po # update all PO from RAWXML
- $ make wrap # wrap all PO
- $ make xml # update all XML from RAWXML/ENT/PO/ADD
- $ make css # update CSS and IMAGES in $(PUBLISHDIR)
- $ make html # update all HTML in $(PUBLISHDIR)
- $ make txt # update all Plain TEXT in $(PUBLISHDIR)
- $ make pdf # update all PDF in $(PUBLISHDIR)
- $ make tex # update all TeX source in $(PUBLISHDIR)
- $ make url # check duplicate URL references
-```
-
-Wikipedia URLs:
-
-`bin/interwiki` script can be used to check translated URLs.
-
## Publication to the www.debian.org servers
The contents of `debian-reference` are published to the www.debian.org servers
@@ -451,10 +469,7 @@ www.debian.org servers.
## Is there easier way to edit XML source
-For now, asciidoc source in asciidoc branch is in sync with XML source in this
-master branch. You need to run script in buster environment where python2 is
-available. We may convert this XML source to easier format such as Sphinx in
-future.
+Unfortunately, no.
## Reminder
diff --git a/bin/colspec.py b/bin/colspec.py
index a891d4a0..a7eb3545 100755
--- a/bin/colspec.py
+++ b/bin/colspec.py
@@ -40,6 +40,8 @@ if __name__ == '__main__':
colwidth = (20,12,6,12,12,38)
elif tgroup_cols == 7:
colwidth = (20,12,6,12,12,12,26)
+ elif tgroup_cols == 8:
+ colwidth = (20,12,6,6,6,6,6,26)
# List of exceptions
if table_id == "thenumericmodefoinchmodbcommands":
colwidth = (20,80)
diff --git a/bin/docbook.conf b/bin/docbook.conf
deleted file mode 100644
index 771d393c..00000000
--- a/bin/docbook.conf
+++ /dev/null
@@ -1,601 +0,0 @@
-#
-# docbook.conf
-#
-# Asciidoc configuration file.
-# Default docbook backend.
-#
-
-[miscellaneous]
-outfilesuffix=.xml
-# Printable page width in pts.
-pagewidth=380
-pageunits=pt
-
-[attributes]
-basebackend=docbook
-basebackend-docbook=
-
-[replacements]
-# Line break markup is dropped (there is no DocBook line break tag).
-(?m)^(.*)\s\+$=\1
-ifdef::asciidoc7compatible[]
-# Superscripts.
-\^(.+?)\^=\1
-# Subscripts.
-~(.+?)~=\1
-endif::asciidoc7compatible[]
-
-[ruler-blockmacro]
-# Only applies to HTML so don't output anything.
-
-[image-inlinemacro]
-
-
-
-
- {1={target}}
-
-
-[image-blockmacro]
-{title}
-{title%}
-
-
-
-
- {1={target}}
-
-{title#}
-{title%}
-
-[indexterm-inlinemacro]
-# Inline index term.
-# Generate separate index entries for primary, secondary and tertiary
-# descriptions.
-# Primary only.
-{2%}
-{2%} {1}
-{2%}
-# Primary and secondary.
-{2#}{3%}
-{2#}{3%} {1}{2}
-{2#}{3%}
-{2#}{3%}
-{2#}{3%} {2}
-{2#}{3%}
-# Primary, secondary and tertiary.
-{3#}
- {1}{2}{3}
-{3#}
-{3#}
- {2}{3}
-{3#}
-{3#}
- {3}
-{3#}
-
-[indexterm2-inlinemacro]
-# Inline index term.
-# Single entry index term that is visible in the primary text flow.
-
- {1}
-
-{1}
-
-[footnote-inlinemacro]
-# Inline footnote.
-{0}
-
-[callout-inlinemacro]
-# Inline callout.
-
-
-[tags]
-# Bulleted, numbered and labeled list tags.
-ilist={title?{title}}|
-ilistitem=|
-ilisttext=|
-olist={title?{title}}|
-olist2=|
-olistitem=|
-olisttext=|
-vlist={title?{title}}|
-vlistentry=|
-vlistterm=|
-vlisttext=|
-vlistitem=|
-# Horizontal labeled list (implemented with two column table).
-# Hardwired column widths to 30%,70% because the current crop of PDF
-# generators do not auto calculate column widths.
-hlist=<{title?table}{title!informaltable}{id? id="{id}"} tabstyle="{style=hlabeledlist}" pgwide="0" frame="none" colsep="0" rowsep="0">{title?{title}}|<{title?/table}{title!/informaltable}>
-hlistentry=|
-hlisttext=|
-hlistterm=|
-hlistitem=|
-
-# Question and Answer list.
-qlist={title?{title}}|
-qlistentry=|
-qlistterm=|
-qlistitem=|
-qlisttext=|
-# Bibliography list.
-blist=|
-blistitem=|
-blisttext=|
-# Glossary list.
-glist=|
-glistentry=|
-glistterm=|
-glistitem=|
-glisttext=|
-# Callout list.
-colist={title?{title}}|
-colistitem=|
-colisttext=|
-
-# Quoted text
-emphasis='|'
-strong=|
-monospaced=|
-quoted={amp}#8220;|{amp}#8221;
-unquoted=|
-subscript=|
-superscript=|
-
-# $$ inline passthrough.
-$$passthrough=|
-
-# Inline macros
-[http-inlinemacro]
-{0={name}:{target}}
-[https-inlinemacro]
-{0={name}:{target}}
-[ftp-inlinemacro]
-{0={name}:{target}}
-[file-inlinemacro]
-{0={name}:{target}}
-[mailto-inlinemacro]
-{0={target}}
-[callto-inlinemacro]
-{0={target}}
-[link-inlinemacro]
-{0={target}}
-# anchor:id[text]
-[anchor-inlinemacro]
-
-# [[id,text]]
-[anchor2-inlinemacro]
-
-# [[[id]]]
-[anchor3-inlinemacro]
-[{1}]
-# xref:id[text]
-[xref-inlinemacro]
-{0}
-{2%}
-# <>
-[xref2-inlinemacro]
-{2}
-{2%}
-
-
-# Special word macros
-[emphasizedwords]
-{words}
-[monospacedwords]
-{words}
-[strongwords]
-{words}
-
-# Paragraph substitution.
-[paragraph]
-{title}
-{title%}
-|
-{title%}
-{title#}
-{empty}
-
-[admonitionparagraph]
-<{name}{id? id="{id}"}>|{name}>
-
-[literalparagraph]
-# The literal block employs the same markup.
-template::[literalblock]
-
-[verseparagraph]
-template::[verseblock]
-
-# Delimited blocks.
-[literalblock]
-{title}
-
-|
-
-{title#}
-
-[listingblock]
-{title}
-
-|
-
-{title#}
-
-[sidebarblock]
-
-{title}
-|
-
-
-[passthroughblock]
-|
-
-[quoteblock]
-
-{title}
-# Include attribution only if either {attribution} or {citetitle} are defined.
-{attribution#}
-{attribution%}{citetitle#}
-{attribution}
-{citetitle}
-{attribution#}
-{attribution%}{citetitle#}
-|
-
-
-[verseblock]
-
-{title}
-# Include attribution only if either {attribution} or {citetitle} are defined.
-{attribution#}
-{attribution%}{citetitle#}
-{attribution}
-{citetitle}
-{attribution#}
-{attribution%}{citetitle#}
-
-|
-
-