summaryrefslogtreecommitdiffstats
path: root/Makefile.common
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2007-03-12 00:08:35 +0000
committerPaul W. Frields <stickster@gmail.com>2007-03-12 00:08:35 +0000
commite0a03714553c6aca33824d315a266f3998090832 (patch)
treed146ff4be474c7c2f243982034f376fc14c68c76 /Makefile.common
parent3197e330900a1778e2b2b19091f1218ab3eaf797 (diff)
downloadfedora-doc-utils-e0a03714553c6aca33824d315a266f3998090832.tar.gz
fedora-doc-utils-e0a03714553c6aca33824d315a266f3998090832.tar.xz
fedora-doc-utils-e0a03714553c6aca33824d315a266f3998090832.zip
Use new rule to locate docs-common and rely on this for most building, instead of a possibly nonexistent FDPDIR. This should make a module inclusion or a full repository checkout equally workable.
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common61
1 files changed, 34 insertions, 27 deletions
diff --git a/Makefile.common b/Makefile.common
index 2ca10ec..eba493b 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -76,23 +76,30 @@ PWD :=$(shell /bin/pwd)
#########################################################################
# Supply default values for the boilerplate files _unless_ the user has
# provided their own values.
+define find-common-dir
+for d in $(PWD)/docs-common $(PWD)/../docs-common $(PWD)/../../docs-common \
+ /usr/share/fedora/doc/docs-common ; do \
+if [ -f $$d/Makefile.common ] ; then echo "$$d"; break; fi; done
+endef
+FDPCOMMONDIR := $(shell $(find-common-dir))
+# FDPDIR may no longer be required.
ifeq "${FDPDIR}" ""
-FDPDIR = $(PWD)/..
+FDPDIR = ${FDPCOMMONDIR}/..
endif
ifeq "${FDPBIN}" ""
-FDPBIN = ${FDPDIR}/docs-common/bin
+FDPBIN = ${FDPCOMMONDIR}/bin
endif
ifeq "${XSLPDF}" ""
-XSLPDF = ${FDPDIR}/docs-common/xsl/main-pdf.xsl
+XSLPDF = ${FDPCOMMONDIR}/xsl/main-pdf.xsl
endif
ifeq "${XSLHTML}" ""
-XSLHTML = ${FDPDIR}/docs-common/xsl/main-html.xsl
+XSLHTML = ${FDPCOMMONDIR}/xsl/main-html.xsl
endif
ifeq "${XSLHTMLNOCHUNKS}" ""
-XSLHTMLNOCHUNKS = ${FDPDIR}/docs-common/xsl/main-html-nochunks.xsl
+XSLHTMLNOCHUNKS = ${FDPCOMMONDIR}/xsl/main-html-nochunks.xsl
endif
ifeq "${HTMLCSS}" ""
-HTMLCSS = ${FDPDIR}/docs-common/css/fedora-draft.css
+HTMLCSS = ${FDPCOMMONDIR}/css/fedora-draft.css
endif
ifeq "${DRAFT}" ""
#DRAFT = no
@@ -126,7 +133,7 @@ endif
XMLTO =xmlto
XSLTPROC=xsltproc
XMLFORMAT=xmlformat
-XMLFOPTS=-f $(FDPDIR)/docs-common/bin/xmlformat-fdp.conf
+XMLFOPTS=-f $(FDPCOMMONDIR)/bin/xmlformat-fdp.conf
XMLLINT =xmllint
XML2PO =xml2po
XML2POFLAGS=-e
@@ -148,7 +155,7 @@ FDP_ENTITIES=fdp-entities.ent
%.ent: %.xml
${XSLTPROC} -o $@ --stringparam FDPCOMMONDIR "NONE" \
- ${FDPDIR}/docs-common/common/entities/entities.xsl $<
+ ${FDPCOMMONDIR}/common/entities/entities.xsl $<
#########################################################################
#########################################################################
@@ -364,7 +371,7 @@ OMFINFILES=${PKGNAME}.omf.in
${PRI_LANG}/${PKGNAME}.omf.in:: ${PRI_LANG}/${RPMINFO}
${XSLTPROC} --stringparam lang ${PRI_LANG} \
--stringparam docbase ${PKGNAME} \
- ${FDPDIR}/docs-common/packaging/omf-in.xsl \
+ ${FDPCOMMONDIR}/packaging/omf-in.xsl \
$< > $@
endif
endif
@@ -595,11 +602,11 @@ distclean::
# mydoc-en/index.html:: mydoc-en.xml ${XMLEXTRAFILES}-en
# LANG=en.UTF-8 ${XMLTO} html -x $(XSLHTML) -o mydoc-en mydoc-en.xml
# mkdir -p mydoc-en/stylesheet-images
-# cp ${FDPDIR}/docs-common/stylesheet-images/*.png mydoc-en/stylesheet-images/
+# cp ${FDPCOMMONDIR}/stylesheet-images/*.png mydoc-en/stylesheet-images/
# cp ${HTMLCSS} mydoc-en/fedora.css
# cp ${HTMLCSSEXTRA} mydoc-en/watermark.png
-# cp ${FDPDIR}/docs-common/images/watermark.png mydoc-en/
-# ${FDPDIR}/docs-common/bin/copy-figs -f '*.png' figs mydoc-en/
+# cp ${FDPCOMMONDIR}/images/watermark.png mydoc-en/
+# ${FDPCOMMONDIR}/bin/copy-figs -f '*.png' figs mydoc-en/
# but we do avoid copying EPS files since they are nonsense to the HTML world.
#
define HTML_template
@@ -608,10 +615,10 @@ html-$(1):: ${DOCBASE}-$(1)/index.html
${DOCBASE}-$(1)/index.html:: ${XMLFILES-${1}} ${XMLDEPFILES-${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
+ cp ${FDPCOMMONDIR}/stylesheet-images/*.png $(DOCBASE)-$(1)/stylesheet-images
cp ${HTMLCSS} $(DOCBASE)-$(1)/fedora.css
ifneq "${DRAFT}" "no"
- cp ${FDPDIR}/docs-common/images/watermark-$(1).png \
+ cp ${FDPCOMMONDIR}/images/watermark-$(1).png \
$(DOCBASE)-$(1)/watermark.png
endif
[ ! -d figs ] || copy-figs -v -f '*.png' \
@@ -644,10 +651,10 @@ ${DOCBASE}-$(1).html:: ${XMLFILES-${1}} ${XMLDEPFILES-${1}}
LANG=${1}.UTF-8 ${XMLTO} html-nochunks -x $(XSLHTMLNOCHUNKS) $(1)/$(DOCBASE).xml
mv $(DOCBASE).html $(DOCBASE)-$(1).html
mkdir -p stylesheet-images/
- cp ${FDPDIR}/docs-common/stylesheet-images/*.png stylesheet-images/
+ cp ${FDPCOMMONDIR}/stylesheet-images/*.png stylesheet-images/
cp ${HTMLCSS} fedora.css
ifneq "${DRAFT}" "no"
- cp ${FDPDIR}/docs-common/images/watermark-$(1).png watermark.png
+ cp ${FDPCOMMONDIR}/images/watermark-$(1).png watermark.png
endif
distclean::
@@ -700,7 +707,7 @@ define FO_template
fo-${1}:: ${1}/${DOCBASE}.fo
${1}/${DOCBASE}.fo:: ${XMLFILES-${1}} ${XMLDEPFILES-${1}}
LANG=${1}.UTF-8 xsltproc --xinclude \
- --stringparam FDPDIR ${FDPDIR} \
+ --stringparam FDPCOMMONDIR ${FDPCOMMONDIR} \
--stringparam IMGROOT ${PWD} \
--stringparam RENDEREDBY fop-0.20.5 \
${XSLPDF} ${1}/${DOCBASE}.xml | ${XMLLINT} --format -o $$@ -
@@ -750,7 +757,7 @@ txt-$(1) text-$(1):: ${DOCBASE}-$(1).txt
${DOCBASE}-$(1).txt:: ${XMLFILES-${1}} ${XMLDEPFILES-${1}}
${XMLLINT} ${XMLLINTOPT} $(1)/$(DOCBASE).xml > $(1)/$(DOCBASE).lint.xml
- ${XSLTPROC} $(FDPDIR)/docs-common/packaging/strip-for-txt.xsl \
+ ${XSLTPROC} $(FDPCOMMONDIR)/packaging/strip-for-txt.xsl \
$(1)/$(DOCBASE).lint.xml > $(1)/$(DOCBASE).stripped.xml
rm $(1)/$(DOCBASE).lint.xml
LANG=$(1).UTF-8 ${XMLTO} ${XMLTOTXTPOSTOPT} txt $(1)/$(DOCBASE).stripped.xml
@@ -846,11 +853,11 @@ define fdp-info_template
$(1)/fdp-info.xml:: ${1}/$(RPMINFO)
mkdir -p ${1}
LANG=$(1).UTF-8 ${XSLTPROC} --stringparam lang $(1) \
- --stringparam fdpdir $(FDPDIR) \
+ --stringparam fdpcommondir $(FDPCOMMONDIR) \
--stringparam doctype $(shell \
doctype ${PRI_LANG}/$(DOCBASE).xml) \
--stringparam legalbase ${LEGALNOTICEBASE} \
- ${FDPDIR}/docs-common/packaging/bookinfo.xsl \
+ ${FDPCOMMONDIR}/packaging/bookinfo.xsl \
${1}/$(RPMINFO) | \
$(XMLFORMAT) $(XMLFOPTS) >$$@
@@ -971,7 +978,7 @@ help::
fedora-doc-${DOCBASE}-gnome.desktop:: ${RPMINFO}
$(XSLTPROC) --stringparam docbase "${DOCBASE}" \
- ${FDPDIR}/docs-common/packaging/gnome-desktop.xsl \
+ ${FDPCOMMONDIR}/packaging/gnome-desktop.xsl \
${RPMINFO} >$@.tmp && move-if-change $@.tmp $@
help::
@@ -984,7 +991,7 @@ help::
fedora-doc-${DOCBASE}-kde.desktop:: ${RPMINFO}
$(XSLTPROC) --stringparam docbase "${DOCBASE}" \
- ${FDPDIR}/docs-common/packaging/kde-desktop.xsl \
+ ${FDPCOMMONDIR}/packaging/kde-desktop.xsl \
${RPMINFO} >$@.tmp && move-if-change $@.tmp $@
help::
@@ -997,16 +1004,16 @@ help::
fedora-doc-${DOCBASE}-khelp.desktop:: ${RPMINFO}
$(XSLTPROC) --stringparam docbase "${DOCBASE}" \
- ${FDPDIR}/docs-common/packaging/khelpcenter-plugin.xsl \
+ ${FDPCOMMONDIR}/packaging/khelpcenter-plugin.xsl \
${RPMINFO} >$@.tmp && move-if-change $@.tmp $@
define FDP_ENTITIES_template
-${1}/$${FDP_ENTITIES}:: ${FDPDIR}/docs-common/common/entities/entities-${1}.xml
+${1}/$${FDP_ENTITIES}:: ${FDPCOMMONDIR}/common/entities/entities-${1}.xml
mkdir -p ${1}
- xsltproc --stringparam FDPCOMMONDIR "${FDPDIR}/docs-common/common" \
- $${FDPDIR}/docs-common/common/entities/entities.xsl \
- $${FDPDIR}/docs-common/common/entities/entities-${1}.xml \
+ xsltproc --stringparam FDPCOMMONDIR "${FDPCOMMONDIR}/common" \
+ $${FDPCOMMONDIR}/common/entities/entities.xsl \
+ $${FDPCOMMONDIR}/common/entities/entities-${1}.xml \
>$$@.tmp && move-if-change $$@.tmp $$@
clean::