docs-common Makefile.common,1.125,1.126
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Thu Aug 3 18:18:20 UTC 2006
Author: pfrields
Update of /cvs/docs/docs-common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11952
Modified Files:
Makefile.common
Log Message:
Better package building definitions (stolen from Extras)
Index: Makefile.common
===================================================================
RCS file: /cvs/docs/docs-common/Makefile.common,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- Makefile.common 2 Aug 2006 23:32:24 -0000 1.125
+++ Makefile.common 3 Aug 2006 18:18:17 -0000 1.126
@@ -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 @@
#########################################################################
#########################################################################
-# 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 @@
#########################################################################
#########################################################################
+# 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.
More information about the Fedora-docs-commits
mailing list