On Sat, 2005-05-07 at 14:41 -0400, Jeremy Katz wrote: > On Sat, 2005-05-07 at 11:24 -0400, Ignacio Vazquez-Abrams wrote: > > On Sat, 2005-05-07 at 10:59 -0400, seth vidal wrote: > > > eventually, once FC4 is released you'd run: > > > make build TARGET=FC4 > > > > > > you should make sure you're in the correct branch directory, of course. > > > > No default based on what branch you're in? > > Not at present... patches accepted to add that functionality to > Makefile.common. Or I'll get around to it eventually :-) Here's a prelim patch that handles both build and disttags. Feel free to slice-and-dice as desired. -- Ignacio Vazquez-Abrams <ivazquez ivazquez net> http://fedora.ivazquez.net/ gpg --keyserver hkp://subkeys.pgp.net --recv-key 38028b72
--- common/Makefile.common.build 2005-05-08 05:48:50.000000000 -0400
+++ common/Makefile.common 2005-05-08 06:47:17.000000000 -0400
@@ -10,16 +10,25 @@
$(error "You can not run this Makefile without having NAME defined")
endif
ifndef VERSION
-VERSION := $(shell rpm $(RPM_DEFINES) -q --qf "%{VERSION}\n" --specfile $(SPECFILE)| head -1)
+VERSION := $(shell rpm $(RPM_DEFINES) $(DIST_DEFINES) -q --qf "%{VERSION}\n" --specfile $(SPECFILE)| head -1)
endif
# the release of the package
ifndef RELEASE
-RELEASE := $(shell rpm $(RPM_DEFINES) -q --qf "%{RELEASE}\n" --specfile $(SPECFILE)| head -1)
+RELEASE := $(shell rpm $(RPM_DEFINES) $(DIST_DEFINES) -q --qf "%{RELEASE}\n" --specfile $(SPECFILE)| head -1)
endif
# this is used in make patch, maybe make clean eventually.
# would be nicer to autodetermine from the spec file...
RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION)
+# Branch and disttag definitions
+BRANCH = $(shell basename $(shell pwd))
+BRANCHINFO = $(shell grep ^$(BRANCH): $(COMMON_DIR)/branches | cut -d: --output-delimiter=" " -f2-)
+TARGET = $(word 2, $(BRANCHINFO))
+DIST = $(word 3, $(BRANCHINFO))
+DISTVAR = $(word 4, $(BRANCHINFO))
+DISTVAL = $(word 5, $(BRANCHINFO))
+DIST_DEFINES = --define "dist $(DIST)" --define "$(DISTVAR) $(DISTVAL)"
+
# default target: just make sure we've got the sources
all: sources
@@ -270,7 +279,7 @@
# If you build a new version into the tree, first do "make tag",
# then "make srpm", then build the package.
-tag:: $(SPECFILE)
+tag:: $(SPECFILE) $(COMMON_DIR)/branches
cvs tag $(TAG_OPTS) -c $(TAG)
@echo "Tagged with: $(TAG)"
@echo
@@ -285,8 +294,8 @@
endef
USER := $(shell $(find-user))
-build:
- @if [ -z "$(TARGET)" ]; then echo "Must specify a target to build into"; exit 1; fi
+build: $(COMMON_DIR)/branches
+ @if [ -z "$(TARGET)" -a ! -d CVS ]; then echo "Must be in a branch subdirectory"; exit 1; fi
@(pushd $(COMMON_DIR) >/dev/null ;\
cvs -Q update ;\
echo -e "$(USER)\t$(CVS_REPOSITORY)\t$(TAG)\t$(TARGET)" >> tobuild ;\
--- common/branches.build 2005-05-08 06:27:43.000000000 -0400
+++ common/branches 2005-05-08 06:31:34.000000000 -0400
@@ -0,0 +1,7 @@
+RHL-7:rhl7:.rhl7:rhl:7
+RHL-8:rhl8:.rhl8:rhl:8
+RHL-9:rhl9:.rhl9:rhl:9
+FC-1:fc1:.fc1:fedora:1
+FC-2:fc2:.fc2:fedora:2
+FC-3:fc3:.fc3:fedora:3
+devel:devel:.fc4:fedora:4
Attachment:
signature.asc
Description: This is a digitally signed message part