release-notes/devel Makefile,1.20,1.21
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Mon Aug 28 02:11:16 UTC 2006
Author: pfrields
Update of /cvs/docs/release-notes/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1078
Modified Files:
Makefile
Log Message:
Here is the goodies to make OMF building work. This module's spec
file needs to be updated to make use of it, but the non-packaging
targets here should all work now.
Index: Makefile
===================================================================
RCS file: /cvs/docs/release-notes/devel/Makefile,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Makefile 2 Aug 2006 18:34:56 -0000 1.20
+++ Makefile 28 Aug 2006 02:11:13 -0000 1.21
@@ -60,7 +60,8 @@
${1}/Welcome.xml \
${1}/Xorg.xml \
${1}/about-fedora.xml \
- ${1}/README.xml
+ ${1}/README.xml \
+ ${1}/README-BURNING-ISOS.xml
endef
@@ -79,13 +80,120 @@
# echo FINISHED AT LAST
########################################################################
+
+###########
+#
+# Get or build OMF.
+#
+# If the per-doc Makefile provides a ${OMFINFILES} list, we use those.
+# If it does not, and ${BUILDOMF} is defined, make one using XSLT and
+# rpm-info data.
+#
+# The template OMF files are expected to use @VARNAME@ notation to
+# allow replacement of their content dynamically at build time. They
+# should retain this notation during PO/POT conversion so that
+# translators never have to worry about that content. Substitution
+# only occurs during the packaging process.
+#
+
+# FIXME: There may not be a need to have the ${PRI_LANG} prefixing
+# each entry in ${OMFINFILES}. Might be a good idea to take that out.
+
+# if OMFINFILES is empty, try and get the file list.
+# if it's still empty, and BUILDOMF is set, use that to populate the list
+# Once that's done, append the XMLFILES
+ifeq "${OMFINFILES}" ""
+OMFINFILES=$(wildcard ${PRI_LANG}/*.omf.in)
+ifeq "${OMFINFILES}" ""
+ifdef BUILDOMF
+OMFINFILES=${PRI_LANG}/${PKGNAME}.omf.in
+${OMFINFILES}:: ${PRI_LANG}/${RPMINFO}
+ ${XSLTPROC} --stringparam lang ${PRI_LANG} \
+ --stringparam docbase ${PKGNAME} \
+ ${FDPDIR}/docs-common/packaging/omf-in.xsl \
+ ${PRI_LANG}/${RPMINFO} > $@
+endif
+endif
+endif
+
+showvars::
+ @echo "OMFINFILES=\"${OMFINFILES}\""
+
+define OMFIN_template
+.PHONY: omf-in-${1}
+omf-in-${1}:: $(foreach F,$(patsubst ${PRI_LANG}/%,%,${OMFINFILES}),${1}/${F})
+
+clean::
+ $(foreach F,$(patsubst ${PRI_LANG}/%,%,${OMFINFILES}),${RM} ${1}/${F})
+
+help::
+ @printf ${TFMT} 'omf-in-${1}' 'Make OMF input file for ${1}'
+
+endef
+
+$(foreach L,${OTHERS},$(eval $(call OMFIN_template,${L})))
+
+# Treat .omf.in files just like XML... since they are!
+$(foreach L,${OTHERS}, \
+ $(foreach F,${OMFINFILES}, \
+ $(eval $(call XML_template,${L},${F}))))
+
+omf-in-${PRI_LANG}:: ${OMFINFILES}
+
+.PHONY: omf-in
+omf-in:: $(foreach L,${LANGUAGES},omf-in-${L})
+help::
+ @printf ${TFMT} 'omf-in' 'Make all OMF input files'
+
+
+# To make the real OMF, just do a quick bit of sed processing.
+# The spacing in the second command is purposeful to ensure no extra
+# space appears in the sed command.
+#
+# Note the difference between @LANG@ and @LANGC@: the former is always
+# replaced by the locale name, whereas the latter is replaced by the
+# locale name *unless* the locale is en_US, in which case is is replaced
+# by "C", the fallback.
+%.omf: %.omf.in
+ sed ' s!@RELEASE@!${VERSION}!g ; \
+ s!@DATE@!${REVDATE}!g ; \
+ s!@LANG@!$(patsubst %/$(shell basename $<),%,$<)!g' \
+ $< > $@
+ sed -i 's!@LANGC@!$(if $(findstring en_US,$(patsubst \
+ %/$(shell basename $<),%,$<)),C,$(patsubst \
+ %/$(shell basename $<),%,$<))!g' $@
+
+
+define OMF_template
+.PHONY: omf-${1}
+omf-${1}:: omf-in-${1} $(patsubst ${PRI_LANG}/%.in,${1}/%,${OMFINFILES})
+
+clean::
+ $(foreach F,$(patsubst ${PRI_LANG}/%.in,%,${OMFINFILES}), \
+ ${RM} ${1}/${F})
+
+help::
+ @printf ${TFMT} 'omf-${1}' 'Make all OMF files for ${1} locale'
+
+endef
+
+$(foreach L,${LANGUAGES},$(eval $(call OMF_template,${L})))
+
+.PHONY: omf
+omf:: $(foreach L,${LANGUAGES},omf-${L})
+help::
+ @printf ${TFMT} 'omf' 'Make all OMF files for all locales'
+
+
+
+
####
# Build README fom PO'd file...
#
define HACK_TXT_template
-.PHONY: readme-${1}
+.PHONY: readme-${1} readme-isoburn-${1}
-txt-${1} text-${1}:: readme-${1}
+txt-${1} text-${1}:: readme-${1} readme-isoburn-${1}
readme-${1}:: README-${1}.txt
@@ -100,9 +208,24 @@
${1}/README.stripped.xml && \
move-if-change README.stripped.txt README-${1}.txt
+readme-isoburn-${1}:: README-BURNING-ISOS-${1}.txt
+
+README-BURNING-ISOS-${1}.txt:: set-locale-${1} ${XMLFILES-${1}} ${XMLDEPFILES-${1}}
+ LANG=${1}.UTF-8 ${XMLLINT} ${XMLLINTOPT} ${1}/README-BURNING-ISOS.xml \
+ > ${1}/README-BURNING-ISOS.lint.xml
+ LANG=${1}.UTF-8 ${XSLTPROC} \
+ ${FDPDIR}/docs-common/packaging/strip-for-txt.xsl \
+ ${1}/README-BURNING-ISOS.lint.xml > \
+ ${1}/README-BURNING-ISOS.stripped.xml && \
+ ${RM} -f ${1}/README-BURNING-ISOS.lint.xml
+ LANG=${1}.UTF-8 ${XMLTO} ${XMLTOTXTPOSTOPT} txt \
+ ${1}/README-BURNING-ISOS.stripped.xml && \
+ move-if-change README-BURNING-ISOS.stripped.txt \
+ README-BURNING-ISOS-${1}.txt
+
clean::
- ${RM} -f README-${1}.txt
- ${RM} -f ${1}/README.stripped.xml
+ ${RM} -f README-${1}.txt README-BURNING-ISOS-${1}.txt
+ ${RM} -f ${1}/README.stripped.xml ${1}/README-BURNING-ISOS.stripped.xml
endef
@@ -121,22 +244,32 @@
define PKG_template
.PHONY: release-pkg-${1}
-release-pkg-${1}:: ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html \
- ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt \
- ${PKGNAME}-${VERSION}/README-${1}.txt
-
-${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html:: ${DOCBASE}-${1}.html
+${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html:: html-nochunks-${1}
mkdir -p ${PKGNAME}-${VERSION}
cp ${DOCBASE}-${1}.html $$@
-${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt:: ${DOCBASE}-${1}.txt
+${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt:: txt-${1}
mkdir -p ${PKGNAME}-${VERSION}
cp ${DOCBASE}-${1}.txt $$@
-${PKGNAME}-${VERSION}/README-${1}.txt:: README-${1}.txt
+${PKGNAME}-${VERSION}/README-${1}.txt:: txt-${1}
mkdir -p ${PKGNAME}-${VERSION}
cp README-${1}.txt $$@
+define PKGOMF_template
+$${PKGNAME}-$${VERSION}/$${1}-${1}.omf:: omf-${1}
+ mkdir -p ${PKGNAME}-${VERSION}
+ cp ${1}/$${1}.omf $$$$@
+endef
+$(foreach F,$(patsubst ${PRI_LANG}/%.omf.in,%,${OMFINFILES}), \
+ $(eval $(call PKGOMF_template,${F})))
+
+release-pkg-${1}:: ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html \
+ ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt \
+ ${PKGNAME}-${VERSION}/README-${1}.txt \
+ $(foreach F,$(patsubst ${PRI_LANG}/%.omf.in,%,${OMFINFILES}), \
+ ${PKGNAME}-${VERSION}/${F}-${1}.omf)
+
ifeq "${1}" "en_US"
release-pkg-${1}:: ${PKGNAME}-${VERSION}/about/C/about-fedora.xml
${PKGNAME}-${VERSION}/about/C/about-fedora.xml:: xml-${1}
@@ -169,14 +302,13 @@
@printf ${TFMT} 'release-pkg' 'Make a tarball suitable for import to Core'
-RPMRELEASE=$(shell rpm -q --qf '%{RELEASE}\n' --specfile ${PKGNAME}.spec)
.PHONY: release-srpm
-release-srpm:: ${PKGNAME}-${VERSION}-${RPMRELEASE}.src.rpm
-${PKGNAME}-${VERSION}-${RPMRELEASE}.src.rpm:: ${PKGNAME}-${VERSION}.tar.gz
- rpmbuild -bs ${PKGRPMFLAGS} ${PKGNAME}.spec
+release-srpm:: ${PKGNAME}-${VERSION}-${PKGRELEASE}.src.rpm
+${PKGNAME}-${VERSION}-${PKGRELEASE}.src.rpm:: ${SPECFILE} ${PKGNAME}-${VERSION}.tar.gz
+ rpmbuild -bs ${PKGRPMFLAGS} ${SPECFILE}
clean::
- ${RM} -rf ${PKGNAME}-${VERSION}-${RPMRELEASE}.src.rpm
+ ${RM} -rf ${PKGNAME}-${VERSION}-${PKGRELEASE}.src.rpm
help::
@printf ${TFMT} 'release-srpm' 'Make a SRPM suitable for import to Core'
More information about the docs-commits
mailing list