path: root/release/Makefile
diff options
authorJohn Baldwin <jhb@FreeBSD.org>2009-08-14 20:35:42 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2009-08-14 20:35:42 +0000
commitb03ddec95f14af316c897ca9be31fd80dbb31198 (patch)
treed705c28ea0c1369a49aea4ed99da4ba47f22b9d3 /release/Makefile
parente70dd3b105abdbb246269a022f0bcec151d2583e (diff)
Add the ability to build a release from an SVN checkout instead of a CVS
checkout. If SVNROOT is specified, then the source tree will be checked out from that SVN repository instead of using CVS. ports and docs still use CVS. If SVNROOT is not specified, then the source tree will be checked out using CVS. An explicit SVN branch can be specified using SVNBRANCH (e.g. SVNBRANCH=stable/8). If SVNBRANCH is not set but RELEASETAG is set to a CVS branch (such as RELENG_8) the appropriate SVN branch will be inferred from the CVS branch using svnbranch.awk. Note that there are still several open questions about using SVN instead of CVS in the release process. However, this does enable one to build a release from an SVN repository if needed. Approved by: re (kensmith)
Notes: svn path=/head/; revision=196221
Diffstat (limited to 'release/Makefile')
1 files changed, 50 insertions, 5 deletions
diff --git a/release/Makefile b/release/Makefile
index 22f250af0640..fd3cb929d3c7 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -1,7 +1,8 @@
# $FreeBSD$
# make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
+# [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \
+# [SVNBRANCH=some/branch]
# Where "/some/dir" is the pathname of a directory on a some filesystem with
# at least 1000MB of free space, "somename" is what you want the release to
@@ -9,6 +10,11 @@
# which CVS "tag" name should be used when checking out the sources to build
# the release (default is HEAD).
+# Please note the support for building from SVN is preliminary and there
+# are still questions about things like how to handle updates of
+# /usr/src on production systems (csup(1) replacement). It is a work
+# in progress and may change as the other issues get worked out.
# Please note: the md(4) driver must be present in the kernel
# (either by being compiled in or available as a kld(4) module),
# otherwise the target 'release.8' and possibly others will fail.
@@ -49,12 +55,25 @@ BUILDNAME?=${BASE}-${DATE}-SNAP
# To add other options to the CVS command, set
-# To prefix the cvs command
+# To prefix the CVS command
# Where the CVS repository is
+# To add other options to the Subversion subcommands (co,up), set
+#SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'"
+# To prefix the Subversion command
+# Where the Subversion repository is
+# Subversion branch to build for src. If this is not set then it is
+# automatically computed from RELEASETAG.
# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
# are building an official release. Otherwise, we are building for
# a branch.
+# Determine the Subversion source branch that corresponds to the requested
+.if !defined(SVNBRANCH)
+.if defined(RELEASETAG)
+SVNBRANCH!= echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk
# If you want to pass flags to the world build such as -j X, use
# WORLD_FLAGS. Similarly, you can specify make flags for kernel
# builds via KERNEL_FLAGS.
@@ -341,8 +370,17 @@ CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
release rerelease:
-.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
- @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
+.if !defined(CHROOTDIR) || !defined(BUILDNAME)
+ @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
+.if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
+ @echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
+.if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
+ @echo "Building docs requires CVSROOT or EXTDOCDIR" && false
+.if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
+ @echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
.if defined(NOPORTSATALL) && !defined(NODOC)
@echo "Ports are required for building the release docs. Either set NODOC or"
@@ -387,6 +425,10 @@ release rerelease:
.if defined(EXTSRCDIR)
cd ${CHROOTDIR}/usr && \
cp -R -H ${EXTSRCDIR} src
+.elif defined(SVNROOT)
+ cd ${CHROOTDIR}/usr && \
cd ${CHROOTDIR}/usr && \
@@ -432,7 +474,10 @@ release rerelease:
.if make(rerelease)
.if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
-.if !defined(RELEASETAG)
+.if defined(SVNROOT)
+ cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
+.elif !defined(RELEASETAG)
cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
update ${CVSCMDARGS} -P -d -A