summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2007-09-06 01:22:39 +0000
committerPaul W. Frields <stickster@gmail.com>2007-09-06 01:22:39 +0000
commit35eb13f172fb3ce547465619273852ed8fabd7ce (patch)
tree07e52e2009808632a90bec227bb1fb1528af3f57
parent67fedcd00ba427fe7a2319d86eeb6ced17bc4934 (diff)
downloadfedora-doc-utils-35eb13f172fb3ce547465619273852ed8fabd7ce.tar.gz
fedora-doc-utils-35eb13f172fb3ce547465619273852ed8fabd7ce.tar.xz
fedora-doc-utils-35eb13f172fb3ce547465619273852ed8fabd7ce.zip
These variables need to be set simply (i.e. one-time substitution) to
prevent running 'rpm' repeatedly whenever used.
-rw-r--r--Makefile.common16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile.common b/Makefile.common
index 0d6afc0..9317375 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -291,14 +291,20 @@ SPECFILE=$(firstword $(wildcard *.spec))
ifneq "${SPECFILE}" ""
# the name of the package
-NAME ?= $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{NAME}\n" \
+ifeq "${NAME}" ""
+NAME := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{NAME}\n" \
--specfile ${SPECFILE} | head -1)
+endif
# the version of the package
-VERSION ?= $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{VERSION}\n" \
+ifeq "${VERSION}" ""
+VERSION := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{VERSION}\n" \
--specfile ${SPECFILE} | head -1)
+endif
# the release of the package
-RELEASE ?= $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{RELEASE}\n" \
+ifeq "${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
@@ -314,7 +320,7 @@ TAG?=${TAG_NAME}-${TAG_VERSION}-${TAG_RELEASE}
tag:: ${SPECFILE}
@:
-endif # ifneq "${SPECFILE}" ""
+else # 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
@@ -325,6 +331,8 @@ VERSION ?= $(shell version doc)
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}
+endif
+
# the last revision date of the package, according to rpm-info
REVDATE ?= $(shell date doc)