summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <rra@debian.org>2017-06-24 13:41:18 -0700
committerRuss Allbery <rra@debian.org>2017-06-24 13:43:23 -0700
commit56ccc342042d696602a137aeb6b604dd4075ffc9 (patch)
tree9e076686582bf5a002b623c4953844075f1263ca
parent4a0f09e43baeac22c9254c7e1ba70c6f66f25da0 (diff)
Move source to the top level and eliminate recursive make
* Move the autopkgtest, copyright-format, and debconf_specification source files to the top-level directory and the debconf_spec/include files to a debconf directory. Simplify the build system to eliminate recursive make, reuse the same XML version file for all files, and use the same method of embedding a version in Markdown output for all files. * Fix dependencies so that version.xml is generated before XML validation is done on XML source files.
-rw-r--r--.gitignore23
-rw-r--r--Makefile90
-rw-r--r--autopkgtest.md (renamed from autopkgtest/autopkgtest.md)0
-rw-r--r--autopkgtest/Makefile15
-rw-r--r--copyright-format-1.0.xml (renamed from copyright-format/copyright-format-1.0.xml)0
-rw-r--r--copyright-format/Makefile13
-rw-r--r--debconf/commands.xml (renamed from debconf_spec/include/commands.xml)0
-rw-r--r--debconf/priorities.xml (renamed from debconf_spec/include/priorities.xml)0
-rw-r--r--debconf/statuscodes.xml (renamed from debconf_spec/include/statuscodes.xml)0
-rw-r--r--debconf/types.xml (renamed from debconf_spec/include/types.xml)0
-rw-r--r--debconf_spec/Makefile18
-rw-r--r--debconf_specification.xml (renamed from debconf_spec/debconf_specification.xml)10
-rw-r--r--debian/changelog11
-rw-r--r--docbook.mk16
14 files changed, 77 insertions, 119 deletions
diff --git a/.gitignore b/.gitignore
index 964597f..b61df77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,25 +1,28 @@
/Process.html
+/Process.txt
/README.html
-/autopkgtest/version.txt
-/autopkgtest/*.expanded
-/autopkgtest/*.html
-/autopkgtest/*.txt
-/copyright-format/copyright-format-1.0.html
-/copyright-format/version.xml
-/debconf_spec/debconf_specification.html
-/debconf_spec/debconf_specification.txt
-/debconf_spec/include/version.xml
+/README.txt
+/autopkgtest.html
+/autopkgtest.txt
+/copyright-format-1.0.html
+/copyright-format-1.0.txt
+/debconf_specification.html
+/debconf_specification.txt
/debian/*.substvars
/debian/debhelper-build-stamp
/debian/debian-policy/
/debian/files
/menu-policy.html/
+/menu-policy.txt
/perl-policy.html/
+/perl-policy.txt
/policy.html/
+/policy.txt
+/upgrading-checklist.txt
+/version.md
/version.xml
*-1.html
*.html.tar.gz
*.pdf
*.ps
-*.txt
*.validate
diff --git a/Makefile b/Makefile
index fad02a1..c01fe7d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,9 +31,13 @@ docdir = $(datadir)/doc/$(PACKAGE)
INSTALL = install -p -o root -g root -m 644
MKDIR = install -d -o root -g root -m 755
+# Files included by debconf_specification.xml.
+DEBCONF_INCLUDES := debconf/commands.xml debconf/priorities.xml \
+ debconf/statuscodes.xml debconf/types.xml
+
# doc-base description files for the documents we include.
-DESC_FILES := copyright-format-1.0 debian-policy debian-menu-policy \
- debian-perl-policy debconf-spec fhs autopkgtest
+DESC_FILES := autopkgtest copyright-format-1.0 debconf-spec debian-policy \
+ debian-menu-policy debian-perl-policy fhs
# Our local copy of the File Hierarchy Standard. We don't build this from
# source, but we do have a copy of the source in FHS_ARCHIVE.
@@ -42,11 +46,15 @@ FHS_FILES := fhs-2.3.html fhs-2.3.ps.gz fhs-2.3.txt.gz fhs-2.3.pdf.gz
# Markdown source files in the top-level directory. We generate text and
# HTML versions from these.
-MDWN_FILES := Process README
+MDWN_FILES := Process README autopkgtest
# DocBook source files in the top-level directory. We do some common actions
# with each of these: build text, HTML, and one-page HTML output.
-XML_FILES := policy menu-policy perl-policy
+XML_FILES := menu-policy perl-policy policy
+
+# DocBook source files in the top-level directory that should only generate
+# single-page HTML output (no split HTML output).
+XML_SINGLE_FILES := copyright-format-1.0 debconf_specification
# The upgrading-checklist used to be a document of its own, which was merged
# with the conversion to DocBook. Keep backwards compatibility files.
@@ -64,32 +72,30 @@ POLICY_FILES := $(MDWN_FILES:=.html) \
$(MDWN_FILES:=.txt) \
$(XML_FILES:=-1.html) \
$(XML_FILES:=.txt) \
+ $(XML_SINGLE_FILES:=.html) \
+ $(XML_SINGLE_FILES:=.txt) \
$(XML_SPLIT_FILES:=-1.html) \
$(XML_SPLIT_FILES:=.txt) \
README.css \
policy.ps policy.pdf \
virtual-package-names-list.txt
-SUBDIR_FILES := autopkgtest/autopkgtest.html \
- autopkgtest/autopkgtest.txt \
- copyright-format/copyright-format-1.0.html \
- copyright-format/copyright-format-1.0.txt \
- debconf_spec/debconf_specification.html \
- debconf_spec/debconf_specification.txt
# Used by the clean rules. FILES_TO_CLEAN are individual generated files to
# remove. DIRS_TO_CLEAN are entire directories to remove.
DIRS_TO_CLEAN := $(XML_FILES:=.html) fhs
-FILES_TO_CLEAN := $(MDWN_FILES:=.html) \
- $(MDWN_FILES:=.txt) \
- $(XML_FILES:=.html.tar.gz) \
- $(XML_FILES:=-1.html) \
- $(XML_FILES:=.txt) \
- $(XML_FILES:=.validate) \
- $(XML_SPLIT_FILES:=-1.html) \
- $(XML_SPLIT_FILES:=.txt) \
- $(XML_VERSION) \
- policy.pdf policy.ps \
- autopkgtest/version.txt
+FILES_TO_CLEAN := $(MDWN_FILES:=.html) \
+ $(MDWN_FILES:=.txt) \
+ $(XML_FILES:=.html.tar.gz) \
+ $(XML_FILES:=-1.html) \
+ $(XML_FILES:=.txt) \
+ $(XML_FILES:=.validate) \
+ $(XML_SINGLE_FILES:=.html) \
+ $(XML_SINGLE_FILES:=.txt) \
+ $(XML_SINGLE_FILES:=.validate) \
+ $(XML_SPLIT_FILES:=-1.html) \
+ $(XML_SPLIT_FILES:=.txt) \
+ version.md version.xml \
+ policy.pdf policy.ps
#
@@ -97,16 +103,10 @@ FILES_TO_CLEAN := $(MDWN_FILES:=.html) \
# command line, or that are used by the Debian build system.
#
-all: $(XML_FILES:=.validate) $(XML_FILES:=.html.tar.gz) $(POLICY_FILES) \
- $(XML_VERSION) autopkgtest/version.txt
- $(MAKE) -C autopkgtest all
- $(MAKE) -C copyright-format all
- $(MAKE) -C debconf_spec all
+all: $(XML_FILES:=.validate) $(XML_SINGLE_FILES:=.validate) \
+ $(XML_FILES:=.html.tar.gz) $(POLICY_FILES)
clean distclean:
- $(MAKE) -C autopkgtest clean
- $(MAKE) -C copyright-format clean
- $(MAKE) -C debconf_spec clean
rm -f $(FILES_TO_CLEAN)
rm -rf $(DIRS_TO_CLEAN)
@@ -114,7 +114,6 @@ install:
$(MKDIR) $(DESTDIR)$(docdir)
$(MKDIR) $(DESTDIR)$(docdir)/fhs
$(INSTALL) $(POLICY_FILES) $(DESTDIR)$(docdir)
- $(INSTALL) $(SUBDIR_FILES) $(DESTDIR)$(docdir)
$(INSTALL) $(FHS_FILES) $(DESTDIR)$(docdir)/fhs
@set -ex; for file in $(XML_FILES); do \
tar -C $(DESTDIR)$(docdir) -zxf $$file.html.tar.gz; \
@@ -129,24 +128,27 @@ install:
# publication date.
#
-$(XML_VERSION): debian/changelog
- rm -f $@
- echo '<?xml version="1.0" encoding="utf-8"?>' > $@
- echo '<!ENTITY version "$(VERSION)">' >> $@
- echo '<!ENTITY date "$(DATE)">' >> $@
-
-autopkgtest/version.txt: debian/changelog
+version.md: debian/changelog
rm -f $@
echo > $@
echo '---' >> $@
echo 'Debian Policy $(VERSION), $(DATE)' >> $@
+version.xml: debian/changelog
+ rm -f $@
+ echo '<?xml version="1.0" encoding="utf-8"?>' > $@
+ echo '<!ENTITY version "$(VERSION)">' >> $@
+ echo '<!ENTITY date "$(DATE)">' >> $@
+
#
# Individual file and pattern build rules.
#
# There doesn't seem to be a better way of adding this include dependency.
+debconf_specification.html: $(DEBCONF_INCLUDES)
+debconf_specification.txt: $(DEBCONF_INCLUDES)
+debconf_specification.validate: $(DEBCONF_INCLUDES)
policy-1.html: upgrading-checklist.xml
policy.html/index.html: upgrading-checklist.xml
policy.pdf: upgrading-checklist.xml
@@ -154,19 +156,19 @@ policy.ps: upgrading-checklist.xml
policy.txt: upgrading-checklist.xml
policy.validate: upgrading-checklist.xml
-$(MDWN_FILES:=.txt): %.txt: %.md
+$(MDWN_FILES:=.txt): %.txt: %.md version.md
cat $^ > $@
test "$@" != "README.txt" || \
perl -pli -e 's,./Process.md,Process.txt,g' $@
-$(MDWN_FILES:=.html): %.html: %.md
- $(MDWN) $< > $@
+$(MDWN_FILES:=.html): %.html: %.md version.md
+ cat $^ | $(MDWN) > $@
# Suppress the table of contents for the standalone upgrading checklist.
upgrading-checklist-1.html: XSLPARAMS = --stringparam generate.toc ''
upgrading-checklist.txt: XSLPARAMS = --stringparam generate.toc ''
-%.validate: %.xml
+%.validate: %.xml version.xml
$(XMLLINT) $<
touch $@
@@ -176,13 +178,17 @@ upgrading-checklist.txt: XSLPARAMS = --stringparam generate.toc ''
--stringparam base.dir $(@D)/ \
xsl/html-chunk.xsl $<
+$(XML_SINGLE_FILES:=.html): %.html: %.xml xsl/html-single.xsl version.xml
+ $(XSLTPROC) $(XSLPARAMS) xsl/html-single.xsl $< > $@
+
%-1.html: %.xml xsl/html-single.xsl version.xml
$(XSLTPROC) $(XSLPARAMS) xsl/html-single.xsl $< > $@
%.html.tar.gz: %.html/index.html
tar -czf $(<:/index.html=.tar.gz) $(<:/index.html=)
-$(XML_FILES:=.txt) $(XML_SPLIT_FILES:=.txt): %.txt: %.xml version.xml
+$(XML_FILES:=.txt) $(XML_SINGLE_FILES:=.txt) $(XML_SPLIT_FILES:=.txt): \
+%.txt: %.xml version.xml
$(XSLTPROC) $(XSLPARAMS) xsl/text.xsl $< > $@.html
links -codepage utf-8 -dump $@.html | perl -pe 's/[\r\0]//g' > $@
rm -f $@.html
diff --git a/autopkgtest/autopkgtest.md b/autopkgtest.md
index c984a23..c984a23 100644
--- a/autopkgtest/autopkgtest.md
+++ b/autopkgtest.md
diff --git a/autopkgtest/Makefile b/autopkgtest/Makefile
deleted file mode 100644
index 213ab59..0000000
--- a/autopkgtest/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-MDWN ?= multimarkdown
-
-all: autopkgtest.html autopkgtest.txt
-
-autopkgtest.html: autopkgtest.md.expanded
- $(MDWN) $< > $@
-
-autopkgtest.txt: autopkgtest.md.expanded
- cat $< > $@
-
-autopkgtest.md.expanded: autopkgtest.md version.txt
- cat $^ > $@
-
-clean:
- rm -f autopkgtest.html autopkgtest.txt $(wildcard *.expanded)
diff --git a/copyright-format/copyright-format-1.0.xml b/copyright-format-1.0.xml
index ef5487c..ef5487c 100644
--- a/copyright-format/copyright-format-1.0.xml
+++ b/copyright-format-1.0.xml
diff --git a/copyright-format/Makefile b/copyright-format/Makefile
deleted file mode 100644
index b85eb3e..0000000
--- a/copyright-format/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: copyright-format-1.0.validate copyright-format-1.0.txt \
- copyright-format-1.0.html
-
-include ../docbook.mk
-
-copyright-format-1.0.html: version.xml
-copyright-format-1.0.txt: version.xml
-copyright-format-1.0.validate: version.xml
-
-clean:
- rm -f *.html *.txt *.validate
-
-.DELETE_ON_ERROR:
diff --git a/debconf_spec/include/commands.xml b/debconf/commands.xml
index ca73e28..ca73e28 100644
--- a/debconf_spec/include/commands.xml
+++ b/debconf/commands.xml
diff --git a/debconf_spec/include/priorities.xml b/debconf/priorities.xml
index 114a9c7..114a9c7 100644
--- a/debconf_spec/include/priorities.xml
+++ b/debconf/priorities.xml
diff --git a/debconf_spec/include/statuscodes.xml b/debconf/statuscodes.xml
index 060d273..060d273 100644
--- a/debconf_spec/include/statuscodes.xml
+++ b/debconf/statuscodes.xml
diff --git a/debconf_spec/include/types.xml b/debconf/types.xml
index 50b3fe4..50b3fe4 100644
--- a/debconf_spec/include/types.xml
+++ b/debconf/types.xml
diff --git a/debconf_spec/Makefile b/debconf_spec/Makefile
deleted file mode 100644
index 314fc86..0000000
--- a/debconf_spec/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-all: debconf_specification.validate debconf_specification.txt \
- debconf_specification.html
-
-include ../docbook.mk
-
-# The document is divided into separate XML documents, all of which are
-# included by the main XML file.
-INCLUDES = include/commands.xml include/priorities.xml \
- include/statuscodes.xml include/types.xml include/version.xml
-
-debconf_specification.html: $(INCLUDES)
-debconf_specification.txt: $(INCLUDES)
-debconf_specification.validate: $(INCLUDES)
-
-clean:
- rm -f *.html *.txt *.validate
-
-.DELETE_ON_ERROR:
diff --git a/debconf_spec/debconf_specification.xml b/debconf_specification.xml
index 933dd11..e1ea36a 100644
--- a/debconf_spec/debconf_specification.xml
+++ b/debconf_specification.xml
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"dtd/docbook-xml/4.1.2/docbookx.dtd" [
-<!ENTITY statuscodes_table SYSTEM "include/statuscodes.xml">
-<!ENTITY command_list SYSTEM "include/commands.xml">
-<!ENTITY priority_table SYSTEM "include/priorities.xml">
-<!ENTITY type_table SYSTEM "include/types.xml">
-<!ENTITY % versiondata SYSTEM "include/version.xml"> %versiondata;
+<!ENTITY statuscodes_table SYSTEM "debconf/statuscodes.xml">
+<!ENTITY command_list SYSTEM "debconf/commands.xml">
+<!ENTITY priority_table SYSTEM "debconf/priorities.xml">
+<!ENTITY type_table SYSTEM "debconf/types.xml">
+<!ENTITY % versiondata SYSTEM "version.xml"> %versiondata;
]>
<article>
diff --git a/debian/changelog b/debian/changelog
index cb3c8cd..ac1b9ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,19 @@
debian-policy (4.0.0.3) UNRELEASED; urgency=medium
+ [ Sean Whitton ]
* Fix typo 'the' -> 'they' in upgrading checklist (Closes: #865685).
Thanks Sven Joachim for the report.
+ [ Russ Allbery ]
+ * Move the autopkgtest, copyright-format, and debconf_specification
+ source files to the top-level directory and the debconf_spec/include
+ files to a debconf directory. Simplify the build system to eliminate
+ recursive make, reuse the same XML version file for all files, and use
+ the same method of embedding a version in Markdown output for all
+ files.
+ * Fix dependencies so that version.xml is generated before XML
+ validation is done on XML source files.
+
-- Sean Whitton <spwhitton@spwhitton.name> Sat, 24 Jun 2017 21:14:46 +0100
debian-policy (4.0.0.2) unstable; urgency=low
diff --git a/docbook.mk b/docbook.mk
deleted file mode 100644
index b16f91a..0000000
--- a/docbook.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Shared build rules for DocBook files built in subdirectories. Keep these
-# rules consistent with the top-level Makefile.
-
-XSLDIR ?= ../xsl
-
-%.html: %.xml $(XSLDIR)/html-single.xsl
- $(XSLTPROC) $(XSLPARAMS) $(XSLDIR)/html-single.xsl $< > $@
-
-%.txt: %.xml $(XSLDIR)/text.xsl
- $(XSLTPROC) $(XSLPARAMS) $(XSLDIR)/text.xsl $< > $@.html
- links -dump $@.html | perl -pe 's/[\r\0]//g' > $@
- rm -f $@.html
-
-%.validate: %.xml
- $(XMLLINT) $<
- touch $@