summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-26 21:42:30 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-26 21:42:30 +0000
commit591d499964ab6a413f087f872f7be861bb7b559e (patch)
tree2c26457ac1bd87aa89733709bee7455e5972983f
parent3c6e772b32fae895fdc4585009747b20943205bd (diff)
downloadfedora-doc-utils-591d499964ab6a413f087f872f7be861bb7b559e.tar.gz
fedora-doc-utils-591d499964ab6a413f087f872f7be861bb7b559e.tar.xz
fedora-doc-utils-591d499964ab6a413f087f872f7be861bb7b559e.zip
Added "set-locale-${LANG}" target to change the local symlink
"locale-entities.xml" to point to the "docs-common/common/entities/entities-${LANG}.ent" file. The locale gets reset automatically as needed each time the XML is rendered via xmlto(1).
-rw-r--r--Makefile.common98
1 files changed, 63 insertions, 35 deletions
diff --git a/Makefile.common b/Makefile.common
index c52446a..47c9685 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -104,6 +104,7 @@ XMLFOPTS=-f $(FDPDIR)/docs-common/bin/xmlformat-fdp.conf
XMLLINT =xmllint
XML2PO =xml2po
MSGMERGE=msgmerge
+LN =ln
#########################################################################
#########################################################################
@@ -176,8 +177,8 @@ TARGETS=all clean distclean fdp-info html html-nochunks pdf po showvars \
all:: html html-nochunks tarball # pdf
-help targets::
- @printf ${TFMT} 'targets' 'Outputs target summaries'
+help::
+ @printf ${TFMT} 'help' 'Outputs target summaries'
@printf ${TFMT} 'text' 'Same as "txt" target'
@printf ${TFMT} 'txt' 'Renders XML into ASCII text file'
@printf ${TFMT} 'src-tarball' 'FIXME'
@@ -220,7 +221,8 @@ distclean:: clean
#
define HTML_template
.PHONY: html-${1}
-html-$(1) ${DOCBASE}-$(1)/index.html:: ${XMLFILES-${1}} $(1)/fdp-info.xml
+html-$(1):: ${DOCBASE}-$(1)/index.html
+${DOCBASE}-$(1)/index.html:: ${XMLFILES-${1}} $(1)/fdp-info.xml set-locale-${1}
LANG=$(1).UTF-8 ${XMLTO} html -x $(XSLHTML) -o $(DOCBASE)-$(1) $(1)/$(DOCBASE).xml
mkdir -p $(DOCBASE)-$(1)/stylesheet-images/
cp ${FDPDIR}/docs-common/stylesheet-images/*.png $(DOCBASE)-$(1)/stylesheet-images
@@ -235,7 +237,7 @@ endif
distclean::
${RM} -r ${DOCBASE}-${1}
-targets::
+help::
@printf ${TFMT} 'html-${1}' 'Renders XML into locale ${1}'
@printf ${TFMT} '${1}/index.html' 'Renders XML into locale ${1}'
endef
@@ -253,7 +255,8 @@ html:: $(foreach L,${LANGUAGES},html-${L})
define HTMLNOCHUNK_template
.PHONY: html-nochunks-${1}
-html-nochunks-$(1) ${DOCBASE}-$(1).html:: ${XMLFILES-${1}} $(1)/fdp-info.xml
+html-nochunks-$(1):: ${DOCBASE}-$(1).html
+${DOCBASE}-$(1).html:: ${XMLFILES-${1}} $(1)/fdp-info.xml set-locale-${1}
${XMLTO} html-nochunks -x $(XSLHTMLNOCHUNKS) $(1)/$(DOCBASE).xml
mv $(DOCBASE).html $(DOCBASE)-$(1).html
mkdir -p stylesheet-images/
@@ -269,7 +272,7 @@ distclean::
${RM} fedora.css
${RM} watermark.png
-targets::
+help::
@printf ${TFMT} 'html-nochunks-${1}' 'Renders XML into locale ${1} HTML'
@printf ${TFMT} '${DOCBASE}-${1}.html' 'Renders XML into locale ${1} HTML'
endef
@@ -293,7 +296,7 @@ ${DOCBASE}-$(1).tar.gz:: ${DOCBASE}-$(1)/index.html
distclean::
${RM} ${DOCBASE}-${1}.tar.gz
-targets::
+help::
@printf ${TFMT} '${DOCBASE}-${1}.tar.gz' 'Tar archive of HTML and images'
endef
@@ -311,13 +314,14 @@ tarball:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG).tar.gz)
define PDF_template
.PHONY: pdf-${1}
-pdf-$(1) ${DOCBASE}-$(1).pdf:: ${XMLFILES-${1}} ${1}/fdp-info.xml
+pdf-$(1):: ${DOCBASE}-$(1).pdf
+${DOCBASE}-$(1).pdf:: ${XMLFILES-${1}} ${1}/fdp-info.xml set-locale-${1}
${XMLTO} pdf -x $(XSLPDF) $(1)/$(DOCBASE)-$(1).xml
distclean::
${RM} ${DOCBASE}-${1}.pdf
-targets::
+help::
@printf ${TFMT} 'pdf-${1}' 'Renders XML into PDF file for locale ${1}'
@printf ${TFMT} '${DOCBASE}-${1}.pdf' 'Renders XML into PDF file'
@@ -333,7 +337,8 @@ pdf:: $(foreach LANG,${LANGUAGES},pdf-$(LANG))
define TXT_template
.PHONY: txt-${1} text-${1}
-txt-$(1) text-$(1) ${DOCBASE}-$(1).txt:: ${XMLFILES-${1}} ${1}/fdp-info.xml
+txt-$(1) text-$(1):: ${DOCBASE}-$(1).txt
+${DOCBASE}-$(1).txt:: ${XMLFILES-${1}} ${1}/fdp-info.xml set-locale-${1}
${XMLLINT} ${XMLLINTOPT} $(1)/$(DOCBASE).xml > $(1)/$(DOCBASE).lint.xml
${XSLTPROC} $(FDPDIR)/docs-common/packaging/strip-for-txt.xsl \
$(1)/$(DOCBASE).lint.xml > $(1)/$(DOCBASE).stripped.xml
@@ -345,7 +350,7 @@ txt-$(1) text-$(1) ${DOCBASE}-$(1).txt:: ${XMLFILES-${1}} ${1}/fdp-info.xml
distclean::
${RM} ${DOCBASE}-${1}.txt
-targets::
+help::
@printf ${TFMT} 'txt-${1}' 'Renders XML into ASCII text for locale ${1}'
@printf ${TFMT} 'text-${1}' 'Renders XML into ASCII text for locale ${1}'
@printf ${TFMT} '${DOCBASE}-${1}.txt' 'Renders XML into ASCII text for locale ${1}'
@@ -370,7 +375,7 @@ po/${DOCBASE}.pot:: ${XMLFILES-${PRI_LANG}}
[ -d po ] || (echo ADD po/ TO CVS >&2; exit 1)
${XML2PO} -o $@ $^
-targets::
+help::
@printf ${TFMT} 'po' 'Writes one ${PRI_LANG} PO file for all XML'
@printf ${TFMT} 'po/${DOCBASE}.pot' 'Writes one PO file for all XML'
@@ -387,7 +392,7 @@ ${1}::
distclean::
${RM} -r ${1}
-targets::
+help::
@printf ${TFMT} '${1}' 'Creates translated XML working directory'
endef
@@ -415,7 +420,7 @@ xml-${1}:: ${XMLFILES-${1}}
distclean::
${RM} -r ${1}
-targets::
+help::
@printf ${TFMT} 'xml-${1}' 'Produces translated XML for locale ${1}'
endef
@@ -424,7 +429,7 @@ endef
xml-${PRI_LANG}:: ${XMLFILES-${PRI_LANG}}
-targets::
+help::
@printf ${TFMT} 'xml-${PRI_LANG}' 'Comfirms primary language XML files.'
$(foreach L,${OTHERS},$(eval $(call XMLTARGET_template,${L})))
@@ -433,7 +438,7 @@ $(foreach L,${OTHERS},$(eval $(call XMLTARGET_template,${L})))
xml-all:: $(foreach L,${LANGUAGES},xml-${L})
-targets::
+help::
@printf ${TFMT} 'xml-all' 'Creates all XML locale files'
distclean::
@@ -457,7 +462,7 @@ po/${1}.po:: ${XMLFILES-${PRI_LANG}} po/${DOCBASE}.pot
.PHONY: po-${1}
po-${1}:: po/${1}.po
-targets::
+help::
@printf ${TFMT} 'po-${1}' 'Creates or updates locale ${1} .PO file'
@printf ${TFMT} 'po/${1}.po' 'Creates or updates locale ${1} .PO file'
@@ -492,7 +497,7 @@ DIFFS =-u
diff::
xmldiff ${DIFFS} ${OLD} ${NEW}
-targets::
+help::
@printf ${TFMT} 'diff' 'Compares XML files'
#
@@ -516,7 +521,7 @@ $(1)/fdp-info.xml:: $(RPMINFO)
clean::
${RM} ${1}/fdp-info.xml
-targets::
+help::
@printf ${TFMT} '${1}/fdp-info.xml' 'Locale ${1} packaging information'
endef
@@ -527,7 +532,7 @@ $(foreach L,${LANGUAGES},$(eval $(call fdp-info_template,${L})))
fdp-info:: $(foreach LANG,${LANGUAGES},$(LANG)/fdp-info.xml)
-targets::
+help::
@printf ${TFMT} 'fdp-info' 'Outputs all locale-specific packaging info'
#
@@ -544,7 +549,7 @@ clog:: $(RPMINFO)
insert-changelog $(RPMINFO).tmp && \
move-if-change $(RPMINFO).tmp $(RPMINFO)
-targets::
+help::
@printf ${TFMT} 'clog' 'Adds changelog entry to rpm-info.xml file'
#
@@ -555,7 +560,7 @@ colophon:: $(RPMINFO)
insert-colophon $(RPMINFO).tmp && \
move-if-change $(RPMINFO).tmp $(RPMINFO)
-targets::
+help::
@printf ${TFMT} 'colophon' 'Adds colophon entry to rpm-info.xml file'
#########################################################################
@@ -566,7 +571,7 @@ ${DOCBASE}-$(1)-distclean::
${RM} *-$(1).omf
${RM} *-$(1).desktop
-targets::
+help::
@printf ${TFMT} '${DOCBASE}-${1}-distclean' 'Removes locale ${1} product files'
endef
@@ -590,12 +595,12 @@ distclean::
${RM} fedora-doc-$(DOCBASE)*.spec
${RM} $(DOCBASE)*.src.tar.gz
-targets::
+help::
@printf ${TFMT} 'spec' 'Creates RPM spec file from rpm-info.xml'
spec:: ${SPECFILE}
-targets::
+help::
@printf ${TFMT} '${SPECFILE}' 'Creates RPM spec file from rpm-info.xml'
${SPECFILE}:: ${RPMINFO}
@@ -603,12 +608,12 @@ ${SPECFILE}:: ${RPMINFO}
${FDPDIR}/docs-common/packaging/spec.xsl ${RPMINFO} \
>$@.tmp && move-if-change $@.tmp $@
-targets::
+help::
@printf ${TFMT} 'gnome-desktop' 'Outputs Gnome desktop description'
gnome.desktop:: fedora-doc-${DOCBASE}-gnome.desktop
-targets::
+help::
@printf ${TFMT} 'fedora-doc-${DOCBASE}-gnome.desktop' 'Gnome Desktop Files'
fedora-doc-${DOCBASE}-gnome.desktop:: ${RPMINFO}
@@ -616,12 +621,12 @@ fedora-doc-${DOCBASE}-gnome.desktop:: ${RPMINFO}
${FDPDIR}/docs-common/packaging/gnome-desktop.xsl \
${RPMINFO} >$@.tmp && move-if-change $@.tmp $@
-targets::
+help::
@printf ${TFMT} 'kde.desktop' 'Generates KDE desktop files'
kde.desktop:: fedora-doc-${DOCBASE}-kde.desktop
-targets::
+help::
@printf ${TFMT} 'fedora-doc-${DOCBASE}-kde.desktop' 'KDE desktop files'
fedora-doc-${DOCBASE}-kde.desktop:: ${RPMINFO}
@@ -629,12 +634,12 @@ fedora-doc-${DOCBASE}-kde.desktop:: ${RPMINFO}
${FDPDIR}/docs-common/packaging/kde-desktop.xsl \
${RPMINFO} >$@.tmp && move-if-change $@.tmp $@
-targets::
+help::
@printf ${TFMT} 'khelp.desktop' 'KDE Help desktop files'
khelp.desktop:: fedora-doc-${DOCBASE}-khelp.desktop
-targets::
+help::
@printf ${TFMT} 'fedora-doc-${DOCBASE}-khelp.desktop' 'KDE Help files'
fedora-doc-${DOCBASE}-khelp.desktop:: ${RPMINFO}
@@ -652,12 +657,12 @@ fedora-doc-${DOCBASE}-$(1).omf:: ${RPMINFO}
$(XMLFORMAT) $(XMLFOPTS) >fedora-doc-${DOCBASE}-$(1).omf.tmp && \
move-if-change fedora-doc-${DOCBASE}-$(1).omf.tmp fedora-doc-${DOCBASE}-$(1).omf
-targets::
+help::
@printf ${TFMT} 'omf-${1}' 'OMF file for locale ${1}'
@printf ${TFMT} 'fedora-doc-${DOCBASE}-${1}.omf' 'OMF file for locale ${1}'
endef
-targets::
+help::
@printf ${TFMT} 'fedora-doc-${DOCBASE}-C.omf' 'Locale "EN" not the C locale'
fedora-doc-${DOCBASE}-C.omf:: fedora-doc-${DOCBASE}-en.omf
@@ -665,12 +670,12 @@ fedora-doc-${DOCBASE}-C.omf:: fedora-doc-${DOCBASE}-en.omf
$(foreach LANG,${LANGUAGES},$(eval $(call omf_template,${LANG})))
-targets::
+help::
@printf ${TFMT} 'omf' 'Generates the OMF files'
omf:: $(foreach LANG,${LANGUAGES},omf-$(LANG)) fedora-doc-${DOCBASE}-C.omf
-targets::
+help::
@printf ${TFMT} 'src-tarball' 'Builds tar(1) archive of sources & desktop files'
src-tarball $(DOCBASE)-$(VERSION).src.tar.gz:: xml-all
@@ -738,6 +743,29 @@ showvars::
@echo "RELEASE=$(RELEASE)"
@echo "PWD=$(PWD)"
+#########################################################################
+# 'LOCALE_template' issues rules and targets to symbolicly link the local
+# file 'locale-entities.xml' to the per-locale entity files located in
+# the "docs-common/common/entities/" directory.
+#
+LOCALE_ENTITIES='locale-entities.xml'
+define LOCALE_template
+.PHONY: set-locale-${1}
+set-locale-${1}::
+ ${LN} -f -s ${FDPDIR}/docs-common/common/entities/entities-${1}.ent \
+ ${LOCALE_ENTITIES}
+
+clean::
+ ${RM} ${LOCALE_ENTITIES}
+
+help::
+ @printf ${TFMT} 'set-locale-${1}' 'Link to locale ${1} FDP entities'
+endef
+
+$(foreach L,${PRI_LANG} ${OTHERS},$(eval $(call LOCALE_template,${L})))
+
+#
+#########################################################################
#########################################################################
# End of Makefile.common