diff options
-rw-r--r-- | Makefile.common | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/Makefile.common b/Makefile.common index 97eb0b9..590dd3e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,3 +1,5 @@ +For more information on using the Fedora source code repositories, +please visit http://fedoraproject.org/wiki/UsingCvs ######################################################################### # Makefile.common # @@ -158,17 +160,14 @@ SHELL =${FDPBIN}/fdpsh ######################################################################### ######################################################################### -# Obtain the document version and release info for building RPM's -VERSION:=$(shell version doc) -RELEASE:=$(shell version rpm) -######################################################################### - -######################################################################### +ifndef RPMFLAGS RPMFLAGS=--define "docbase $(DOCBASE)" \ --define "_topdir $(PWD)/rpm" \ + --define "_srpmdir ${PWD}" \ + --define "_rpmdir ${PWD}" \ + --define "_sourcedir ${PWD}" \ --define "fdpdir /usr/share/fedora/doc" - -SPECFILE=fedora-doc-$(DOCBASE).spec +endif ifeq "${RPMDEBUG}" "1" RPMDFLAG = -vv @@ -176,6 +175,28 @@ endif ######################################################################### ######################################################################### +# Obtain the document version and release info for building RPM's +SPECFILE=$(firstword $(wildcard *.spec)) + +# the name of the package +ifndef NAME +NAME := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{NAME}\n" \ + --specfile ${SPECFILE} | head -1) +endif +# the version of the package +ifndef VERSION +VERSION := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{VERSION}\n" \ + --specfile ${SPECFILE} | head -1) +endif +# the release of the package +ifndef RELEASE +RELEASE := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{RELEASE}\n" \ + --specfile ${SPECFILE} | head -1) +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. |