summaryrefslogtreecommitdiffstats
path: root/Makefile.common
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2006-08-04 02:43:57 +0000
committerPaul W. Frields <stickster@gmail.com>2006-08-04 02:43:57 +0000
commitbbf8d076e2fce7a6ce5e64696efb806bd3537e6b (patch)
treecb64986e7ab42078974d3580ceb9cb0763e52d98 /Makefile.common
parent2f534e829a3da7b5fcf378d60a6f0ac472040df3 (diff)
downloadfedora-doc-utils-bbf8d076e2fce7a6ce5e64696efb806bd3537e6b.tar.gz
fedora-doc-utils-bbf8d076e2fce7a6ce5e64696efb806bd3537e6b.tar.xz
fedora-doc-utils-bbf8d076e2fce7a6ce5e64696efb806bd3537e6b.zip
Make tagging routine dependent on whether we have a specfile or not.
If no specfile exists, we pick up a simpler tag using the existing variables and fdpsh functions.
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common30
1 files changed, 29 insertions, 1 deletions
diff --git a/Makefile.common b/Makefile.common
index 9e60f7a..be33a4c 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -192,7 +192,35 @@ ifndef RELEASE
RELEASE := $(shell rpm ${RPMFLAGS} ${DISTRPMFLAGS} -q --qf "%{RELEASE}\n" \
--specfile ${SPECFILE} | head -1)
endif
-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
+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?=${DOCBASE}-$(shell version doc)
+
+tag::
+ cvs tag ${TAG_OPTS} -c ${TAG}
+ @echo "Tagged with: ${TAG}"
+ @echo
+
+help::
+ @printf ${TFMT} 'tag' 'Tag this directory with the packaging NVR'
#########################################################################