docbook_5/Makefile
Thomas Schraitle c7b04648cc Accepting request 830238 from home:MMuschner:branches:Publishing
- Fix XML catalog to allow both www.docbook.org and docbook.org as URIs.- 
Changes in version 5.2b10a2
	- Added a transform attribute to the resource element (as an alternative to grammar).
	- Removed the grammar attribute from output.
	- Added a danger admonition.
	- Added a legalsection sectioning element. Allow legalsection in legalnotice.
	- Added an otherclass attribute to article as an alternative to the enumerated class values.
	- Added a formalgroup element to contain several formal objects (for example, subfigures in a figure).
	- Relaxed the content model of abstract to include non-paragraph block elements.
	- Added multimediaparams to imagedata.
	- Added a buildtarget inline.
	- Allow funcdef to contain an explicit void.
	- Allow paramdef to contain modifiers.
	- Allow fieldsynopsis, methodsynopsis, and methodparam to contain more than one type.
	- Extended the content model of type so that it can represent union and intersection types. Added a class attribute to type.
	- Allow numbered sections (sect1, sect2, etc.) to contain refentry.
	- Added interface to the enumerated values in the class attribute of systemitem.-

OBS-URL: https://build.opensuse.org/request/show/830238
OBS-URL: https://build.opensuse.org/package/show/Publishing/docbook_5?expand=0&rev=27
2020-08-28 09:40:10 +00:00

158 lines
4.9 KiB
Makefile

#
# Makefile to install DocBook 5.x
#
# Author:
# Thomas Schraitle <toms@opensuse.org>
#
ifndef PREFIX
PREFIX := /usr
endif
SHELL := /bin/bash
PACKAGE := docbook_5
VERSION := 5.2b10a2
DB_VERSIONS := 5.0 5.1 5.2b10a2
LAST_VER := $(lastword $(DB_VERSIONS))
CDIR := $(shell pwd)
#
DATADIR := $(DESTDIR)$(PREFIX)/share
#
BINDIR := $(DESTDIR)$(PREFIX)/bin
# Catalog stuff
DB_CATALOG_SRC := $(PACKAGE).xml
XML_CATALOG_DIR := $(DESTDIR)/etc/xml/catalog.d
DB_CATALOG := $(XML_CATALOG_DIR)/$(DB_CATALOG_SRC)
#
DB_XML_PATH := $(DATADIR)/xml/docbook
SCHEMA_PATH := $(DB_XML_PATH)/schema
#
XSLT_PATH := $(DB_XML_PATH)/stylesheet/upgrade
#
DTD_PATH := $(SCHEMA_PATH)/dtd
XSD_PATH := $(SCHEMA_PATH)/xsd
RNG_PATH := $(SCHEMA_PATH)/rng
SCH_PATH := $(SCHEMA_PATH)/sch
NVDL_PATH := $(SCHEMA_PATH)/nvdl
#
DB_DTD_PATHS := $(DTD_PATH)/5.0
DB_XSD_PATHS := $(XSD_PATH)/5.0
DB_RNG_PATHS := $(foreach v,$(DB_VERSIONS),$(RNG_PATH)/$(v))
DB_SCH_PATHS := $(foreach v,$(DB_VERSIONS),$(SCH_PATH)/$(v))
DB_NVDL_PATHS := $(foreach v,$(DB_VERSIONS),$(NVDL_PATH)/$(v))
INST_DIRECTORIES := $(XML_CATALOG_DIR) $(BINDIR) $(XSLT_PATH) \
$(DB_DTD_PATHS) $(DB_XSD_PATHS) $(DB_RNG_PATHS) $(DB_SCH_PATHS) $(DB_NVDL_PATHS)
DTD_SCHEMAS := $(wildcard docbook-5.0/dtd/*.dtd)
DTD_SCHEMAS := $(patsubst docbook-5.0/dtd/%,%,$(DTD_SCHEMAS))
DTD_SCHEMAS := $(addprefix $(DB_DTD_PATHS)/,$(DTD_SCHEMAS))
#
XSD_SCHEMAS := $(wildcard docbook-5.0/xsd/*.xsd)
XSD_SCHEMAS := $(patsubst docbook-5.0/xsd/%,%,$(XSD_SCHEMAS))
XSD_SCHEMAS := $(addprefix $(DB_XSD_PATHS)/,$(XSD_SCHEMAS))
#
NVDL_SCHEMAS := $(wildcard $(foreach v,$(DB_VERSIONS),docbook-$(v)/*.nvdl))
NVDL_SCHEMAS := $(subst docbook-,,$(NVDL_SCHEMAS))
NVDL_SCHEMAS := $(addprefix $(NVDL_PATH)/,$(NVDL_SCHEMAS))
#
SCH_SCHEMAS := $(wildcard $(foreach p,$(DB_VERSIONS),docbook-$(p)/sch/*))
SCH_SCHEMAS := $(patsubst docbook-%,%,$(SCH_SCHEMAS))
SCH_SCHEMAS := $(subst sch/,,$(SCH_SCHEMAS))
SCH_SCHEMAS := $(addprefix $(SCH_PATH)/,$(SCH_SCHEMAS))
#
RNG_SCHEMAS := $(wildcard $(foreach p,$(DB_VERSIONS),docbook-$(p)/rng/*.rn?))
RNG_SCHEMAS := $(patsubst docbook-%,%,$(RNG_SCHEMAS))
RNG_SCHEMAS := $(subst rng/,,$(RNG_SCHEMAS))
RNG_SCHEMAS := $(addprefix $(RNG_PATH)/,$(RNG_SCHEMAS))
#
LINKS := $(foreach v,$(DB_VERSIONS),$(NVDL_PATH)/$(v)/docbook.rng \
$(NVDL_PATH)/$(v)/docbook.sch)
ALL_DB_SCHEMAS := $(DTD_SCHEMAS) $(XSD_SCHEMAS) \
$(RNG_SCHEMAS) $(SCH_SCHEMAS) $(NVDL_SCHEMAS) \
$(LINKS)
#-----------------------------
# Make relative path
define relpath =
$(shell realpath --relative-to $(dir $(2)) $(dir $(1)))
endef
#-----------------------------
.PHONY: install
install: $(DB_CATALOG)
install: $(BINDIR)/db4-entities.pl
install: $(XSLT_PATH)/db4-upgrade.xsl
install: $(ALL_DB_SCHEMAS)
install: | $(INST_DIRECTORIES)
@echo "Ready."
$(DTD_PATH)/5.0/%: docbook-5.0/dtd/% | $(DB_DTD_PATHS)
@echo "### Installing DTD $<"
install -m644 $< $@
$(XSD_PATH)/5.0/%: docbook-5.0/xsd/% | $(DB_XSD_PATHS)
@echo "### Installing XSD $<"
install -m644 $< $@
$(RNG_PATH)/5.0/%: docbook-5.0/rng/% | $(DB_RNG_PATHS)
@echo "### Installing RNG 5.0 $<"
install -m644 $< $@
$(RNG_PATH)/5.1/%: docbook-5.1/rng/% | $(DB_RNG_PATHS)
@echo "### Installing RNG 5.1 $<"
install -m644 $< $@
$(RNG_PATH)/5.2b10a2/%: docbook-$(LAST_VER)/rng/% | $(DB_RNG_PATHS)
@echo "### Installing RNG 5.2b10a2 $<"
install -m644 $< $@
$(SCH_PATH)/5.0/%: docbook-5.0/sch/% | $(DB_SCH_PATHS)
@echo "### Installing Schematron 5.0 $<"
install -m644 $< $@
$(SCH_PATH)/5.1/%: docbook-5.1/sch/% | $(DB_SCH_PATHS)
@echo "### Installing Schematron 5.1 $<"
install -m644 $< $@
$(SCH_PATH)/5.2b10a2/%: docbook-$(LAST_VER)/sch/%| $(DB_SCH_PATHS)
@echo "### Installing Schematron 5.2b10a2 $<"
install -m644 $< $@
$(NVDL_PATH)/5.0/%: docbook-5.0/% | $(DB_NVDL_PATHS)
@echo "### Installing NVDL 5.0 $<"
install -m644 $< $@
$(NVDL_PATH)/5.1/%: docbook-5.1/% | $(DB_NVDL_PATHS)
@echo "### Installing NVDL 5.1 $<"
install -m644 $< $@
$(NVDL_PATH)/5.2b10a2/%: docbook-$(LAST_VER)/% | $(DB_NVDL_PATHS)
@echo "### Installing NVDL 5.2b10a2 $<"
install -m644 $< $@
define NVDL_LINK_tmpl =
$(NVDL_PATH)/$(1)/docbook.$(3): $(2)/$(1)/docbook.$(3)
@echo $$< $$@
ln -s $$(call relpath,$$<,$$@)/$$(notdir $$<) $$@
endef
$(foreach v,$(DB_VERSIONS),$(eval $(call NVDL_LINK_tmpl,$(v),$(RNG_PATH),rng)))
$(foreach v,$(DB_VERSIONS),$(eval $(call NVDL_LINK_tmpl,$(v),$(SCH_PATH),sch)))
$(DB_CATALOG): $(DB_CATALOG_SRC) | $(XML_CATALOG_DIR)
@echo "### Installing XML Catalog..."
install -m644 $< $@
$(BINDIR)/db4-entities.pl: docbook-5.1/tools/db4-entities.pl | $(BINDIR)
@echo "### Installing script db4-entities.pl"
install -m755 $< $@
$(XSLT_PATH)/db4-upgrade.xsl: docbook-5.1/tools/db4-upgrade.xsl | $(XSLT_PATH)
@echo "### Installing upgrade stylesheet..."
install -m644 $< $@
# create needed directories
#
$(INST_DIRECTORIES):
@mkdir -p $@