From 1c80de2578c8048d4620fc29c8b50c084878a3cb Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 5 Aug 2006 04:39:18 +0000 Subject: The whole section on tagging and assigning NVR stuff should come after the first TARGETS assignment. (Just like it says, right there.) --- Makefile.common | 125 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/Makefile.common b/Makefile.common index 020d348..d994019 100644 --- a/Makefile.common +++ b/Makefile.common @@ -172,68 +172,6 @@ RPMDFLAG = -vv endif ######################################################################### -######################################################################### -# Obtain the document version and release info for building RPM's -SPECFILE=$(firstword $(wildcard *.spec)) - -ifneq "${SPECFILE}" "" -# 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 - -# CVS-safe version/release -- a package name like 4Suite screws things -# up, so we have to remove the leaving digits from the name -TAG_NAME := $(shell echo ${NAME} | sed -e s/\\\./_/g -e s/^[0-9]\\\+//g) -TAG_VERSION := $(shell echo ${VERSION} | sed s/\\\./_/g) -TAG_RELEASE := $(shell echo ${RELEASE} | sed s/\\\./_/g) - -# tag to export, defaulting to current tag in the spec file -TAG?=${TAG_NAME}-${TAG_VERSION}-${TAG_RELEASE} - -# The rest of this rule is set outside the ifneq -.PHONY: tag -tag:: ${SPECFILE} - -endif # ifneq "${SPECFILE}" "" - -# Only set tag here if not done already (i.e. SPECFILE doesn't exist) -# Use the FDPSH function to get a current version. Keep in mind this -# will prevent repetitive tagging without the user making use of -# TAG_OPTS. I'd say that encourages people to Do The Right Thing by -# changing version numbers where necessary. (PWF) -TAG_NAME ?= $(shell echo ${DOCBASE} | sed -e s/\\\./_/g -e s/^[0-9]\\\+//g) -TAG_VERSION ?= $(shell version doc | sed s/\\\./_/g) -TAG?=${TAG_NAME}-${TAG_VERSION} - -tag:: - cvs tag ${TAG_OPTS} -c ${TAG} - @echo "Tagged with: ${TAG}" - @echo - -showvars:: - @echo "TAG_NAME=${TAG_NAME}" - @echo "TAG_VERSION=${TAG_VERSION}" - @echo "TAG_RELEASE=${TAG_RELEASE}" - @echo "TAG=${TAG}" - @echo "### (Tag vars do not necessarily reflect CVS status)" - -help:: - @printf ${TFMT} 'tag' 'Tag this directory with the packaging NVR' - -######################################################################### - ######################################################################### # Set a provisional ${LANG} value. We'll dynamically change this as # needed. The "${PRI_LANG}" value is used because that is the original @@ -315,6 +253,69 @@ distclean:: clean # ######################################################################### +######################################################################### +# Obtain the document version and release info for building RPM's +SPECFILE=$(firstword $(wildcard *.spec)) + +ifneq "${SPECFILE}" "" +# 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 + +# CVS-safe version/release -- a package name like 4Suite screws things +# up, so we have to remove the leaving digits from the name +TAG_NAME := $(shell echo ${NAME} | sed -e s/\\\./_/g -e s/^[0-9]\\\+//g) +TAG_VERSION := $(shell echo ${VERSION} | sed s/\\\./_/g) +TAG_RELEASE := $(shell echo ${RELEASE} | sed s/\\\./_/g) + +# tag to export, defaulting to current tag in the spec file +TAG?=${TAG_NAME}-${TAG_VERSION}-${TAG_RELEASE} + +# The rest of this rule is set outside the ifneq +.PHONY: tag +tag:: ${SPECFILE} + @: + +endif # ifneq "${SPECFILE}" "" + +# Only set tag here if not done already (i.e. SPECFILE doesn't exist) +# Use the FDPSH function to get a current version. Keep in mind this +# will prevent repetitive tagging without the user making use of +# TAG_OPTS. I'd say that encourages people to Do The Right Thing by +# changing version numbers where necessary. (PWF) +TAG_NAME ?= $(shell echo ${DOCBASE} | sed -e s/\\\./_/g -e s/^[0-9]\\\+//g) +TAG_VERSION ?= $(shell version doc | sed s/\\\./_/g) +TAG?=${TAG_NAME}-${TAG_VERSION} + +tag:: + cvs tag ${TAG_OPTS} -c ${TAG} + @echo "Tagged with: ${TAG}" + @echo + +showvars:: + @echo "TAG_NAME=${TAG_NAME}" + @echo "TAG_VERSION=${TAG_VERSION}" + @echo "TAG_RELEASE=${TAG_RELEASE}" + @echo "TAG=${TAG}" + @echo "### (Tag vars do not necessarily reflect CVS status)" + +help:: + @printf ${TFMT} 'tag' 'Tag this directory with the packaging NVR' + +######################################################################### + ######################################################################### # Rules to generate the "${LANG}/${DOC_ENTITIES}.ent" file, if used define DOC_ENTITIES_template -- cgit