######################################################################### # Makefile.common # # This file, to be included from every document's local Makefile, provides # the basic targets used by the Fedora Docs Project: # all -- Default target, builds HTML document only # ${DOCNAME}/index.html -- Builds HTML version of document # html -- See "${DOCNAME}/index.html" # html-nochunks -- See "${DOCNAME}.html"; single HTML file # ${DOCNAME}.tar.gz -- Packages HTML document into a tar archive # tarball -- See "${DOCNAME}.tar.gz" # clean -- Deletes all generated files and directories # distclean -- See "clean" # ${DOCNAME}.pdf -- Builds PDF version of document # pdf -- See "${DOCNAME}.pdf" # txt -- Make ASCII txt version ######################################################################### ######################################################################### # PDF generation is still fragile and probably won't work on your document. # Yet. ######################################################################### ######################################################################### # Note: all targets within this Makefile.common must be defined as # double-colon (::) targets so that additional steps can be added by # providing additional rules, also marked with double-colons, in the # document Makefile. ######################################################################### ######################################################################### # N.B., if you want to use built-in variables such as "$@" in a template # be sure to quote them as "$$@" since the template is evaluated once as # it is expanded ######################################################################### ######################################################################### # WARNING. This feature is deprecated and will shortly disappear. ######################################################################### # Allow client document to provide "Make.paths" file to locate our files # This is a "silent include", so if it's missing there is no problem. # This file, if present, must be in the DOCUMENT directory, not here in # docs-common. Even if this file is present, defining FTPDIR via the # command line will take precedence. sinclude Make.paths ######################################################################### ######################################################################### # Supply default values for the boilerplate files _unless_ the user has # provided their own values. ifeq "${FDPDIR}" "" FDPDIR = $(PWD)/.. endif ifeq "${FDPBIN}" "" FDPBIN = ${FDPDIR}/docs-common/bin endif ifeq "${XSLPDF}" "" XSLPDF = ${FDPDIR}/docs-common/xsl/main-pdf.xsl endif ifeq "${XSLHTML}" "" XSLHTML = ${FDPDIR}/docs-common/xsl/main-html.xsl endif ifeq "${XSLHTMLNOCHUNKS}" "" XSLHTMLNOCHUNKS = ${FDPDIR}/docs-common/xsl/main-html-nochunks.xsl endif ifeq "${HTMLCSS}" "" HTMLCSS = ${FDPDIR}/docs-common/css/fedora-draft.css endif ifeq "${DRAFT}" "" DRAFT = yes endif ifeq "${PRI_LANG}" "" PRI_LANG= en endif ifeq "${RPMINFO}" "" RPMINFO = ${PWD}/rpm-info.xml endif ifeq "${RPMPREP}" "" RPMPREP=yes endif ifeq "${RPMPOST}" "" RPMPOST=yes endif ifeq "${XMLTOTXTPOSTOPT}" "" XMLTOTXTPOSTOPT =-p '-no-numbering -no-references' endif ifeq "${XMLLINTOPT}" "" XMLLINTOPT =--xinclude --postvalid --noent endif ######################################################################### ######################################################################### # Strange though it may seem, some shells do not provide a ${PWD} # environment variable for us. PWD :=$(shell /bin/pwd) ######################################################################### ######################################################################### # Use macros to locate our commonly-used programs XMLTO =xmlto XSLTPROC=xsltproc XMLFORMAT=xmlformat XMLFOPTS=-f $(FDPDIR)/docs-common/bin/xmlformat-fdp.conf XMLLINT =xmllint XML2PO =xml2po PO2XML =po2xml MSGMERGE=msgmerge ######################################################################### ######################################################################### # Rules to produce .po files from .xml files. Get the tools to do this # from the gnome-doc-utils RPM. .SUFFIXES: .po .pot .xml %.po: %.xml ${XML2PO} $< >$@ ######################################################################### ######################################################################### # Use our very own "docs-common/bin/fdpsh" as the command interpreter # This automatically has ${FDPBIN} as first in the ${PATH} SHELL =${FDPBIN}/fdpsh ######################################################################### ######################################################################### # Obtain the document version and release info for building RPM's VERSION:=$(shell version doc) RELEASE:=$(shell version rpm) ######################################################################### ######################################################################### RPMFLAGS=--define "docbase $(DOCBASE)" \ --define "_topdir $(PWD)/rpm" \ --define "fdpdir $(FDPDIR)" SPECFILE=fedora-doc-$(DOCBASE).spec ifeq "${RPMDEBUG}" "1" RPMDFLAG = -vv endif ######################################################################### ######################################################################### # Set a provisional ${LANG} value. We'll dynamically change this as # needed. The "${PRI_LANG}" value is used because that is the original # language the doc. LANG =${PRI_LANG} LANGUAGES=${PRI_LANG} ${OTHERS} # ######################################################################### ######################################################################### # Expand the template the XMLFILES_template to produce XMLFILES-${LANG} # macros that enumerate all of the input files for the document. $(foreach L,${LANGUAGES},$(eval $(call XMLFILES_template,${L}))) # ######################################################################### ######################################################################### TFMT="%-31s -- %s\n" ######################################################################### ######################################################################### # PUT NO TARGETS BEFORE THIS ONE, not even in your base Makefile # In a properly-constructed Makefile, this will be the default target TARGETS=all clean distclean fdp-info html html-nochunks pdf po showvars \ tarball rpm rpm-common noarch srpm package-prep package-post \ src-tarball txt text targets # FIXME: add the .PHONY attribute where the actual target is defined .PHONY: ${TARGETS} .PHONY: $(foreach LANG,${LANGUAGES},html-${LANG}) .PHONY: $(foreach LANG,${LANGUAGES},html-nochunks-${LANG}) .PHONY: $(foreach LANG,${LANGUAGES},pdf-${LANG}) all:: html html-nochunks tarball # pdf targets:: @printf ${TFMT} 'targets' 'Outputs target summaries' @printf ${TFMT} 'text' 'Same as "txt" target' @printf ${TFMT} 'txt' 'Renders XML into ASCII text file' @printf ${TFMT} 'src-tarball' 'FIXME' @printf ${TFMT} 'package-post' 'FIXME' @printf ${TFMT} 'package-prep' 'FIXME' @printf ${TFMT} 'srpm' 'FIXME' @printf ${TFMT} 'noarch' 'FIXME' @printf ${TFMT} 'rpm-common' 'FIXME' @printf ${TFMT} 'rpm' 'Builds RPM packages' @printf ${TFMT} 'tarball' 'Packages HTML files into tar(1) archive' @printf ${TFMT} 'clean' 'Removes temporary files' @printf ${TFMT} 'distclean' 'Removes product files and temporaries' @printf ${TFMT} 'fdp-info' 'Produces all $${LANG}/fdp-info.xml' @printf ${TFMT} 'all' 'Builds html, html-nochunks, and tarball' @printf ${TFMT} 'html' 'Renders XML into chunked HTML' @printf ${TFMT} 'html-nochunks' 'Renders XML into one big HTML file' @printf ${TFMT} 'pdf' 'Renders XML into one PDF file' @printf ${TFMT} 'po' 'Updates .PO files for all $${OTHERS} locales' @printf ${TFMT} 'showvars' 'Displays convenient make(1) variables' ${TARGETS}:: ######################################################################### # Ensure all 'clean' targets are invoked before 'distclean' targets distclean:: clean # ######################################################################### ######################################################################### # For each LANG in LANGUAGES, generate a target and rule similar to: # 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 ${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/ # but we do avoid copying EPS files since they are nonsense to the HTML world. # define HTML_template .PHONY: html-${1} html-$(1) ${DOCBASE}-$(1)/index.html:: ${XMLFILES-${1}} $(1)/fdp-info.xml 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 ${HTMLCSS} $(DOCBASE)-$(1)/fedora.css ifeq "${DRAFT}" "yes" cp ${FDPDIR}/docs-common/images/watermark-$(1).png \ $(DOCBASE)-$(1)/watermark.png endif [ ! -d figs ] || copy-figs -v -f '*.png' \ -l $(1) figs $(DOCBASE)-$(1) distclean:: ${RM} -r ${DOCBASE}-${1} targets:: @printf ${TFMT} 'html-${1}' 'Renders XML into locale ${1}' @printf ${TFMT} '${1}/index.html' 'Renders XML into locale ${1}' endef $(foreach L,${LANGUAGES},$(eval $(call HTML_template,${L}))) .PHONY: html html:: $(foreach L,${LANGUAGES},html-${L}) # ######################################################################### ######################################################################### # For each language in ${LANGUAGES}, generate a single HTML file define HTMLNOCHUNK_template .PHONY: html-nochunks-${1} html-nochunks-$(1) ${DOCBASE}-$(1).html:: ${XMLFILES-${1}} $(1)/fdp-info.xml ${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 ${HTMLCSS} fedora.css ifeq "${DRAFT}" "yes" cp ${FDPDIR}/docs-common/images/watermark-$(1).png watermark.png endif distclean:: ${RM} ${DOCBASE}-${1}.html ${RM} -r stylesheet-images ${RM} fedora.css ${RM} watermark.png targets:: @printf ${TFMT} 'html-nochunks-${1}' 'Renders XML into locale ${1} HTML' @printf ${TFMT} '${DOCBASE}-${1}.html' 'Renders XML into locale ${1} HTML' endef $(foreach L,${LANGUAGES},$(eval $(call HTMLNOCHUNK_template,${L}))) .PHONY: html-nochunks html-nochunks:: $(foreach L,${LANGUAGES},html-nochunks-$(L)) # ######################################################################### ######################################################################### # For each language in ${LANGUAGES}, build a tarball of the HTML and # image files. Any ".eps" files are ignored. # define HTMLTAR_template ${DOCBASE}-$(1).tar.gz:: ${DOCBASE}-$(1)/index.html tar -zc --exclude '*.eps' -f ${DOCBASE}-$(1).tar.gz ${DOCBASE}-$(1) distclean:: ${RM} ${DOCBASE}-${1}.tar.gz targets:: @printf ${TFMT} '${DOCBASE}-${1}.tar.gz' 'Tar archive of HTML and images' endef $(foreach L,${LANGUAGES},$(eval $(call HTMLTAR_template,${L}))) .PHONY: tarball tarball:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG).tar.gz) # ######################################################################### ######################################################################### # For each language in ${LANGUAGES}, generate an Adobe Portable Document # Format (PDF) file. define PDF_template .PHONY: pdf-${1} pdf-$(1) ${DOCBASE}-$(1).pdf:: ${XMLFILES-${1}} ${1}/fdp-info.xml ${XMLTO} pdf -x $(XSLPDF) $(1)/$(DOCBASE)-$(1).xml distclean:: ${RM} ${DOCBASE}-${1}.pdf targets:: @printf ${TFMT} 'pdf-${1}' 'Renders XML into PDF file for locale ${1}' @printf ${TFMT} '${DOCBASE}-${1}.pdf' 'Renders XML into PDF file' endef $(foreach L,${LANGUAGES},$(eval $(call PDF_template,${L}))) .PHONY: pdf 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 ${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 rm $(1)/$(DOCBASE).lint.xml ${XMLTO} ${XMLTOTXTPOSTOPT} txt $(1)/$(DOCBASE).stripped.xml mv $(DOCBASE).stripped.txt $(DOCBASE)-$(1).txt rm $(1)/$(DOCBASE).stripped.xml distclean:: ${RM} ${DOCBASE}-${1}.txt targets:: @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}' endef $(foreach L,${LANGUAGES},$(eval $(call TXT_template,${L}))) .PHONY: txt text txt text:: $(foreach LANG,${LANGUAGES},txt-$(LANG)) # ######################################################################### ######################################################################### clean:: ${RM} *.tmp ######################################################################### ######################################################################### po/${DOCBASE}.pot:: ${XMLFILES-${PRI_LANG}} [ -d po ] || (echo ADD po/ TO CVS >&2; exit 1) ${XML2PO} -o $@ $^ targets:: @printf ${TFMT} 'po' 'Writes one ${PRI_LANG} PO file for all XML' @printf ${TFMT} 'po/${DOCBASE}.pot' 'Writes one PO file for all XML' .PHONY: pot pot:: po/${DOCBASE}.pot ######################################################################### ######################################################################### define DIR_template ${1}:: mkdir ${1} distclean:: ${RM} -r ${1} targets:: @printf ${TFMT} '${1}' 'Creates translated XML working directory' endef $(foreach L,${OTHERS},$(eval $(call DIR_template,${L}))) ######################################################################### ######################################################################### define XML_template $(patsubst ${PRI_LANG}/%,${1}/%,${2}):: ${2} po/${1}.po ${1} ${PO2XML} ${2} po/${1}.po >$$@ endef $(foreach L,${OTHERS}, \ $(foreach F,${XMLFILES-${PRI_LANG}}, \ $(eval $(call XML_template,${L},${F})))) define XMLTARGET_template .PHONY: xml-${1} xml-${1}:: ${XMLFILES-${1}} distclean:: ${RM} -r ${1} targets:: @printf ${TFMT} 'xml-${1}' 'Produces translated XML for locale ${1}' endef .PHONY: xml-${PRI_LANG} xml-${PRI_LANG}:: ${XMLFILES-${PRI_LANG}} targets:: @printf ${TFMT} 'xml-${PRI_LANG}' 'Comfirms primary language XML files.' $(foreach L,${OTHERS},$(eval $(call XMLTARGET_template,${L}))) .PHONY: xml-all xml-all:: $(foreach L,${LANGUAGES},xml-${L}) targets:: @printf ${TFMT} 'xml-all' 'Creates all XML locale files' distclean:: $(foreach L,${OTHERS},${RM} -r ${L}) ######################################################################### ######################################################################### define PO_template po/${1}.po:: ${XMLFILES-${PRI_LANG}} po/${DOCBASE}.pot [ -d po ] || (echo ADD po/ TO CVS >&2; exit 1) if [ ! -f $$@ ]; then \ cp po/${DOCBASE}.pot $$@; \ else \ cp $$@ $$@.bank; \ ${MSGMERGE} -o $$@ $$@.bank po/${DOCBASE}.pot; \ fi .PHONY: po-${1} po-${1}:: po/${1}.po targets:: @printf ${TFMT} 'po-${1}' 'Creates or updates locale ${1} .PO file' @printf ${TFMT} 'po/${1}.po' 'Creates or updates locale ${1} .PO file' endef $(foreach L,${OTHERS},$(eval $(call PO_template,${L}))) .PHONY: po po:: $(foreach L,${OTHERS},po-${L}) ######################################################################### ######################################################################### # showvars:: @echo "DOCBASE=\"$(DOCBASE)\"" @echo "PRI_LANG=\"$(PRI_LANG)\"" @echo "OTHERS=\"$(OTHERS)\"" # ######################################################################### ######################################################################### # Show differences between two file revisions. To use this tool: # $ make OLD=old.xml NEW=new.xml diff # The ${DIFFS} macro can select a different output format: # $ make DIFFS=-C OLD=old.xml NEW=new.xml diff OLD =define-me-old.xml NEW =define-me-new.xml DIFFS =-u diff:: xmldiff ${DIFFS} ${OLD} ${NEW} targets:: @printf ${TFMT} 'diff' 'Compares XML files' # ######################################################################### ######################################################################### # The "${LANG}/fdp-info.xml" file contains the or # stanza. It is automatically generated from data in the # "rpm-info.xml" file whenever that file changes. # define fdp-info_template $(1)/fdp-info.xml:: $(RPMINFO) ${XSLTPROC} --stringparam lang $(1) \ --stringparam fdpdir $(FDPDIR) \ --stringparam doctype $(shell \ doctype ${PRI_LANG}/$(DOCBASE).xml \ ) ${FDPDIR}/docs-common/packaging/bookinfo.xsl \ $(RPMINFO) | \ $(XMLFORMAT) $(XMLFOPTS) >$$@ clean:: ${RM} ${1}/fdp-info.xml targets:: @printf ${TFMT} '${1}/fdp-info.xml' 'Locale ${1} packaging information' endef $(foreach L,${LANGUAGES},$(eval $(call fdp-info_template,${L}))) .PHONY: fdp-info fdp-info:: $(foreach LANG,${LANGUAGES},$(LANG)/fdp-info.xml) targets:: @printf ${TFMT} 'fdp-info' 'Outputs all locale-specific packaging info' # ######################################################################### ######################################################################### # Stuff after here is for RPM packaging ######################################################################### ######################################################################### # Make a new changelog entry for an existing rpm-info.xml file. clog:: $(RPMINFO) insert-changelog $(RPMINFO).tmp && \ move-if-change $(RPMINFO).tmp $(RPMINFO) targets:: @printf ${TFMT} 'clog' 'Adds changelog entry to rpm-info.xml file' # ######################################################################### # Make a new colophon entry for an existing rpm-info.xml file. colophon:: $(RPMINFO) insert-colophon $(RPMINFO).tmp && \ move-if-change $(RPMINFO).tmp $(RPMINFO) targets:: @printf ${TFMT} 'colophon' 'Adds colophon entry to rpm-info.xml file' ######################################################################### .PHONY: ${DOCBASE}-${1}-distclean define DISTCLEAN_template ${DOCBASE}-$(1)-distclean:: ${RM} *-$(1).omf ${RM} *-$(1).desktop targets:: @printf ${TFMT} '${DOCBASE}-${1}-distclean' 'Removes locale ${1} product files' endef $(foreach L,${LANGUAGES},$(eval $(call DISTCLEAN_template,${L}))) distclean:: $(foreach L,${LANGUAGES},${DOCBASE}-${L}-distclean) ######################################################################### clean:: ${RM} $(DOCBASE)-$(VERSION)*.src.tar.gz ${RM} -r $(DOCBASE)-$(VERSION)/ ${RM} fedora-doc-$(DOCBASE)*.{omf,desktop,spec} ${RM} *~ distclean:: ${RM} -r rpm ${RM} fedora-doc-$(DOCBASE)*.rpm ${RM} fedora-doc-$(DOCBASE)*.omf ${RM} fedora-doc-$(DOCBASE)*.desktop ${RM} fedora-doc-$(DOCBASE)*.spec ${RM} $(DOCBASE)*.src.tar.gz targets:: @printf ${TFMT} 'spec' 'Creates RPM spec file from rpm-info.xml' spec:: ${SPECFILE} targets:: @printf ${TFMT} '${SPECFILE}' 'Creates RPM spec file from rpm-info.xml' ${SPECFILE}:: ${RPMINFO} $(XSLTPROC) --stringparam docbase "${DOCBASE}" \ ${FDPDIR}/docs-common/packaging/spec.xsl ${RPMINFO} \ >$@.tmp && move-if-change $@.tmp $@ targets:: @printf ${TFMT} 'gnome-desktop' 'Outputs Gnome desktop description' gnome.desktop:: fedora-doc-${DOCBASE}-gnome.desktop targets:: @printf ${TFMT} 'fedora-doc-${DOCBASE}-gnome.desktop' 'Gnome Desktop Files' fedora-doc-${DOCBASE}-gnome.desktop:: ${RPMINFO} $(XSLTPROC) --stringparam docbase "${DOCBASE}" \ ${FDPDIR}/docs-common/packaging/gnome-desktop.xsl \ ${RPMINFO} >$@.tmp && move-if-change $@.tmp $@ targets:: @printf ${TFMT} 'kde.desktop' 'Generates KDE desktop files' kde.desktop:: fedora-doc-${DOCBASE}-kde.desktop targets:: @printf ${TFMT} 'fedora-doc-${DOCBASE}-kde.desktop' 'KDE desktop files' fedora-doc-${DOCBASE}-kde.desktop:: ${RPMINFO} $(XSLTPROC) --stringparam docbase "${DOCBASE}" \ ${FDPDIR}/docs-common/packaging/kde-desktop.xsl \ ${RPMINFO} >$@.tmp && move-if-change $@.tmp $@ targets:: @printf ${TFMT} 'khelp.desktop' 'KDE Help desktop files' khelp.desktop:: fedora-doc-${DOCBASE}-khelp.desktop targets:: @printf ${TFMT} 'fedora-doc-${DOCBASE}-khelp.desktop' 'KDE Help files' fedora-doc-${DOCBASE}-khelp.desktop:: ${RPMINFO} $(XSLTPROC) --stringparam docbase "${DOCBASE}" \ ${FDPDIR}/docs-common/packaging/khelpcenter-plugin.xsl \ ${RPMINFO} >$@.tmp && move-if-change $@.tmp $@ define omf_template omf-$(1):: fedora-doc-${DOCBASE}-$(1).omf fedora-doc-${DOCBASE}-$(1).omf:: ${RPMINFO} ${XSLTPROC} --stringparam docbase "${DOCBASE}" \ --stringparam lang "$(1)" \ ${FDPDIR}/docs-common/packaging/omf.xsl ${RPMINFO} | \ $(XMLFORMAT) $(XMLFOPTS) >fedora-doc-${DOCBASE}-$(1).omf.tmp && \ move-if-change fedora-doc-${DOCBASE}-$(1).omf.tmp fedora-doc-${DOCBASE}-$(1).omf targets:: @printf ${TFMT} 'omf-${1}' 'OMF file for locale ${1}' @printf ${TFMT} 'fedora-doc-${DOCBASE}-${1}.omf' 'OMF file for locale ${1}' endef targets:: @printf ${TFMT} 'fedora-doc-${DOCBASE}-C.omf' 'Locale "EN" not the C locale' fedora-doc-${DOCBASE}-C.omf:: fedora-doc-${DOCBASE}-en.omf cp fedora-doc-$(DOCBASE)-en.omf $@ $(foreach LANG,${LANGUAGES},$(eval $(call omf_template,${LANG}))) targets:: @printf ${TFMT} 'omf' 'Generates the OMF files' omf:: $(foreach LANG,${LANGUAGES},omf-$(LANG)) fedora-doc-${DOCBASE}-C.omf targets:: @printf ${TFMT} 'src-tarball' 'Builds tar(1) archive of sources & desktop files' src-tarball $(DOCBASE)-$(VERSION).src.tar.gz:: ${MAKE} fdp-info ${MAKE} gnome.desktop ${MAKE} kde.desktop ${MAKE} khelp.desktop ${MAKE} omf ${RM} -r $(DOCBASE)-$(VERSION) mkdir -p $(DOCBASE)-$(VERSION) find . '(' \ -name '*#*' \ -o -name 'CVS' \ -o -name 'rpm' \ -o -name '*.rpm' \ -o -name '*~' \ -o -name '*.tar.gz' \ -o -name '*.tmp' \ -o -name '${DOCBASE}-${VERSION}' \ ')' -prune -o -print | cpio -pamdv $(DOCBASE)-$(VERSION) tar -zcvf $(DOCBASE)-$(VERSION).src.tar.gz $(DOCBASE)-$(VERSION)/ ${RM} -r $(DOCBASE)-$(VERSION) package-prep:: ${MAKE} distclean ${MAKE} ${DOCBASE}-${shell version doc}.src.tar.gz ${MAKE} ${SPECFILE} ${MAKE} omf ${MAKE} kde.desktop ${MAKE} khelp.desktop mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} mkdir -p rpm/RPMS/{i386,i486,i586,i686,noarch,ppc,x86_64} cp -f $(DOCBASE)-$(shell version doc).src.tar.gz rpm/SOURCES/ cp -f ${SPECFILE} rpm/SPECS cp -f *.omf *.desktop rpm/SOURCES rpm-common:: if test $(shell get_latest_revision rpm) = 0 ; then \ echo "*** Creating revision log entry for rpm ***" ; \ ROLE=rpm $(MAKE) clog ; \ fi ${RM} *.rpm if test $(RPMPREP) != "no" ; then ${MAKE} package-prep ; fi noarch:: rpm-common rpmbuild -bb $(RPMDFLAG) $(RPMFLAGS) rpm/SPECS/$(SPECFILE) if test $(RPMPOST) != "no" ; then $(MAKE) package-post ; fi srpm:: rpm-common rpmbuild -bs $(RPMDFLAG) $(RPMFLAGS) rpm/SPECS/$(SPECFILE) if test $(RPMPOST) != "no" ; then $(MAKE) package-post ; fi rpm:: rpm-common rpmbuild -ba $(RPMDFLAG) $(RPMFLAGS) rpm/SPECS/$(SPECFILE) if test $(RPMPOST) != "no" ; then $(MAKE) package-post ; fi package-post:: $(MAKE) clean # If needed, review materials in rpm/BUILD/ find rpm/ -name '*.rpm' -exec ln '{}' . ';' ls *.rpm showvars:: @echo "VERSION=$(VERSION)" @echo "RELEASE=$(RELEASE)" @echo "PWD=$(PWD)" ######################################################################### # End of Makefile.common ######################################################################### # Local variables: # mode: makefile # End: