######################################################################## # Fedora Documentation Project Per-document Makefile # License: GPL # Copyright 2005,2006 Tommy Reynolds, MegaCoder.com ######################################################################## # # Document-specific definitions. # DOCBASE = RELEASE-NOTES PRI_LANG = en_US OTHERS = el es it pl pt_BR pt ru sv uk zh_CN FDPDIR = ${PWD}/../.. # Special legalnotice for this document: LEGALNOTICEBASE =legalnotice-relnotes # Special basename for packaging: PKGNAME =fedora-release-notes # Special PKGRPMFLAGS to keep Rawhide happy for f13 PKGRPMFLAGS =--define "_topdir ${PWD}" --define "_specdir ${PWD}" --define "_sourcedir ${PWD}" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" ######################################################################## # List each XML file of your document in the template below. Append the # path to each file to the "XMLFILES-${1}" string. Use a backslash if you # need additional lines. Here, we have one extra file "en/para.xml"; that # gets written as "${1}/para.xml" because later, make(1) will need to compute # the necesssary filenames. Oh, do NOT include "fdp-info.xml" because that's # a generated file and we already know about that one... define XMLFILES_template XMLFILES-${1}= ${1}/ArchSpecific.xml \ ${1}/BackwardsCompatibility.xml \ ${1}/Colophon.xml \ ${1}/DatabaseServers.xml \ ${1}/Desktop.xml \ ${1}/Devel.xml \ ${1}/Extras.xml \ ${1}/Entertainment.xml \ ${1}/Feedback.xml \ ${1}/FileSystems.xml \ ${1}/I18n.xml \ ${1}/Installer.xml \ ${1}/Java.xml \ ${1}/Kernel.xml \ ${1}/Legacy.xml \ ${1}/Multimedia.xml \ ${1}/OverView.xml \ ${1}/PackageChanges.xml \ ${1}/PackageNotes.xml \ ${1}/ProjectOverview.xml \ ${1}/RELEASE-NOTES.xml \ ${1}/Security.xml \ ${1}/Virtualization.xml \ ${1}/WebServers.xml \ ${1}/Welcome.xml \ ${1}/Xorg.xml \ ${1}/about-fedora.xml \ ${1}/README.xml \ ${1}/README-BURNING-ISOS.xml endef # ######################################################################## define find-makefile-common for d in docs-common ../docs-common ../../docs-common; do \ if [ -f $$d/Makefile.common ]; then echo "$$d/Makefile.common"; break; fi; done endef include $(shell $(find-makefile-common)) ######################################################################## # # If you want to add additional steps to any of the # targets defined in "Makefile.common", be sure to use # a double-colon in your rule here. For example, to # print the message "FINISHED AT LAST" after building # the HTML document version, uncomment the following # line: #${DOCBASE}-en/index.html:: # 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. # Otherwise it stays empty. After all, we may not want them at all. ifeq "${OMFINFILES}" "" OMFINFILES=$(foreach F,$(wildcard ${PRI_LANG}/*.omf.in),$(shell basename ${F})) ifeq "${OMFINFILES}" "" ifdef BUILDOMF 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 \ $< > $@ endif endif endif showvars:: @echo "OMFINFILES=\"${OMFINFILES}\"" define OMFVAR_template $(foreach F,${OMFINFILES},$(eval OMFINFILES-${1}+=${1}/${F})) $(foreach F,${OMFINFILES},$(eval OMFFILES-${1}+=$(patsubst %.in,${1}/%,${F}))) $(foreach F,${OMFINFILES},$(eval PKGOMFFILES-${1}+=$(patsubst \ %.omf.in,$(if $(findstring ${PRI_LANG},${1}),%-C.omf,%-${1}.omf), \ ${F}))) showvars-debug:: @echo "PKGOMFFILES-${1}=\"${PKGOMFFILES-${1}}\"" @echo "OMFFILES-${1}=\"${PKGOMFFILES-${1}}\"" endef $(foreach L,${LANGUAGES},$(eval $(call OMFVAR_template,${L}))) define OMFIN_template .PHONY: omf-in-${1} omf-in-${1}:: ${OMFINFILES-${1}} # Treat .omf.in files just like XML... since they are! $(foreach F,${OMFINFILES},$(eval $(call XML_template,${1},${PRI_LANG}/${F}))) clean:: ${RM} ${OMFINFILES-${1}} help:: @printf ${TFMT} 'omf-in-${1}' 'Make OMF input file for ${1}' endef $(foreach L,${OTHERS},$(eval $(call OMFIN_template,${L}))) .PHONY: omf-in omf-in:: $(foreach L,${LANGUAGES},${OMFINFILES-${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 -e 's!@RELEASE@!${VERSION}!g' $< > $@ sed -i 's!@DATE@!${REVDATE}!g' $@ sed -i '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}:: ${OMFFILES-${1}} clean:: ${RM} ${OMFFILES-${1}} 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},${OMFFILES-${L}}) help:: @printf ${TFMT} 'omf' 'Make all OMF files for all locales' define HACK_TXT_template .PHONY: readme-${1} readme-isoburn-${1} $(eval TXTEXTRAFILES-${1}=README-${1}.txt README-BURNING-ISOS-${1}.txt) readme-${1}:: README-${1}.txt README-${1}.txt:: ${1}/README.xml LANG=${1}.UTF-8 ${XMLLINT} ${XMLLINTOPT} ${1}/README.xml \ > ${1}/README.lint.xml LANG=${1}.UTF-8 ${XSLTPROC} \ ${FDPDIR}/docs-common/packaging/strip-for-txt.xsl \ ${1}/README.lint.xml > ${1}/README.stripped.xml && \ ${RM} -f ${1}/README.lint.xml LANG=${1}.UTF-8 ${XMLTO} ${XMLTOTXTPOSTOPT} txt \ ${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:: ${1}/README-BURNING-ISOS.xml 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 ${TXTEXTRAFILES-${1}} ${RM} -f ${1}/README.stripped.xml ${1}/README-BURNING-ISOS.stripped.xml txt-${1} text-${1}:: ${TXTEXTRAFILES-${1}} showvars:: @echo "TXTEXTRAFILES-${1}=\"${TXTEXTRAFILES-${1}}\"" endef $(foreach L,${LANGUAGES},$(eval $(call HACK_TXT_template,${L}))) .PHONY: readme readme:: $(foreach L,${LANGUAGES},${TXTEXTRAFILES-${L}}) ######### # # These rules are for use in packaging the release notes for an ISO # spin. To do so, just run "make release-pkg" and out pops a shiny # tarball named "${PKGNAME}-.tar.gz where is the FC # release (5.91, 6, etc.). # ######### define PKGOMF_DOC_template .PHONY: pkgomf-${1}-${2} ifeq "${2}" "${PRI_LANG}" pkgomf-${1}-${2}:: ${PKGNAME}-${VERSION}/${1}-C.omf ${PKGNAME}-${VERSION}/${1}-C.omf:: ${2}/${1}.omf mkdir -p ${PKGNAME}-${VERSION} cp ${2}/${1}.omf $$@ else pkgomf-${1}-${2}:: ${PKGNAME}-${VERSION}/${1}-${2}.omf ${PKGNAME}-${VERSION}/${1}-${2}.omf:: ${2}/${1}.omf mkdir -p ${PKGNAME}-${VERSION} cp ${2}/${1}.omf $$@ endif endef $(foreach L,${LANGUAGES}, \ $(foreach F,$(patsubst %.omf.in,%,${OMFINFILES}), \ $(eval $(call PKGOMF_DOC_template,${F},${L})))) define PKGOMF_template .PHONY: pkgomf-${1} pkgomf-${1}:: $(foreach F,${PKGOMFFILES-${1}},${PKGNAME}-${VERSION}/${F}) $(eval PKGFILES-${1}+=$(foreach F,${PKGOMFFILES-${1}},${PKGNAME}-${VERSION}/${F})) endef $(foreach L,${LANGUAGES},$(eval $(call PKGOMF_template,${L}))) define PKGHTML_NOCHUNKS_template .PHONY: pkghtml-nochunks-${1} pkghtml-nochunks-${1}:: ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html $(eval PKGFILES-${1}+=${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html) ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.html:: ${DOCBASE}-${1}.html mkdir -p ${PKGNAME}-${VERSION} cp ${DOCBASE}-${1}.html $$@ endef $(foreach L,${LANGUAGES},$(eval $(call PKGHTML_NOCHUNKS_template,${L}))) define PKGTXT_template .PHONY: pkgtxt-${1} pkgtxt-${1}:: ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt ${PKGNAME}-${VERSION}/README-${1}.txt ${PKGNAME}-${VERSION}/README-BURNING-ISOS-${1}.txt $(eval PKGFILES-${1}+=${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt ${PKGNAME}-${VERSION}/README-${1}.txt ${PKGNAME}-${VERSION}/README-BURNING-ISOS-${1}.txt) ${PKGNAME}-${VERSION}/${DOCBASE}-${1}.txt:: ${DOCBASE}-${1}.txt mkdir -p ${PKGNAME}-${VERSION} cp ${DOCBASE}-${1}.txt $$@ ### README is hacked in until we have more control here... ${PKGNAME}-${VERSION}/README-${1}.txt:: README-${1}.txt mkdir -p ${PKGNAME}-${VERSION} cp README-${1}.txt $$@ ${PKGNAME}-${VERSION}/README-BURNING-ISOS-${1}.txt:: README-BURNING-ISOS-${1}.txt mkdir -p ${PKGNAME}-${VERSION} cp README-BURNING-ISOS-${1}.txt $$@ endef $(foreach L,${LANGUAGES},$(eval $(call PKGTXT_template,${L}))) define PKG_template .PHONY: release-pkg-${1} release-pkg-${1}:: ${PKGFILES-${1}} showvars:: @echo "PKGFILES-${1}=${PKGFILES-${1}}" endef $(foreach L,${LANGUAGES},$(eval $(call PKG_template,${L}))) ${PKGNAME}-${VERSION}/about-gnome.desktop:: about-gnome.desktop.in \ $(foreach LN,${OTHERS},${LN}/about-fedora.xml) $(eval NAME_L10N=Name=$(shell ${XSLTPROC} \ about-title.xsl ${PRI_LANG}/about-fedora.xml)) $(eval COMMENT_L10N=Comment=$(shell ${XSLTPROC} \ about-title.xsl ${PRI_LANG}/about-fedora.xml)) $(eval EXEC_L10N=Exec=yelp file:///usr/share/doc/${PKGNAME}-${VERSION}/about/C/about-fedora.xml) $(foreach L,${LANGUAGES},$(eval \ NAME_L10N+=\nName[${L}]=$(shell ${XSLTPROC} \ about-title.xsl ${L}/about-fedora.xml))) $(foreach L,${LANGUAGES},$(eval \ COMMENT_L10N+=\nComment[${L}]=$(shell ${XSLTPROC} \ about-title.xsl ${L}/about-fedora.xml))) $(foreach L,${LANGUAGES},$(eval \ EXEC_L10N+=\nExec[${L}]=yelp file:///usr/share/doc/${PKGNAME}-${VERSION}/about/${L}/about-fedora.xml)) sed -e 's!@NAME-L10N@!${NAME_L10N}!' -e 's!@COMMENT-L10N@!${COMMENT_L10N}!' -e 's!@EXEC-L10N@!${EXEC_L10N}!' $< > $@ .PHONY: release-pkg release-pkg:: ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION}.tar.gz:: $(foreach L,${LANGUAGES},${PKGFILES-${L}}) \ ${PKGNAME}-${VERSION}/about-gnome.desktop cp -a --parents css/*css fedora.css img/*png stylesheet-images/*png ${PKGNAME}-${VERSION} mkdir -p ${PKGNAME}-${VERSION}/about/C && \ cp ${PRI_LANG}/about-fedora.xml ${PKGNAME}-${VERSION}/about/C $(foreach LN,${OTHERS},$(eval \ $(shell mkdir -p ${PKGNAME}-${VERSION}/about/${LN}))) $(foreach LN,${OTHERS},$(eval \ $(shell cp ${LN}/about-fedora.xml ${PKGNAME}-${VERSION}/about/${LN}))) cp -a README-Accessibility ${PKGNAME}-${VERSION} tar czf ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION} clean:: ${RM} -rf ${PKGNAME}-${VERSION}.tar.gz ${RM} -rf ${PKGNAME}-${VERSION} help:: @printf ${TFMT} 'release-pkg' 'Make a tarball suitable for import to Core' # To build the SRPM, you must build "make release-pkg" in the homepage/ # module and copy the resulting tarball to this module! Make sure that # homepage/Makefile defines VERSION to be the same as in this module's # specfile. .PHONY: release-srpm release-srpm:: ${PKGNAME}-${VERSION}-${RELEASE}.src.rpm ${PKGNAME}-${VERSION}-${RELEASE}.src.rpm:: ${SPECFILE} \ ${PKGNAME}-${VERSION}.tar.gz \ homepage-${VERSION}.tar.gz rpmbuild -bs ${PKGRPMFLAGS} ${SPECFILE} clean:: ${RM} -rf ${PKGNAME}-${VERSION}-${RELEASE}.src.rpm help:: @printf ${TFMT} 'release-srpm' 'Make a SRPM suitable for import to Core'