Makefile.inc1:
- New file. Adds logic to search for the git binary, as well as determining the branch and revision, used in various places. Makefile: - Remove searching for the svn{,lite} binary. Makefile.ec2: - Reduce duplicated code, removing searching for the svn{,lite} binary, in addition to EC2_SVN{BRANCH,REV}. - Rename EC2_SVN* with GIT* for consistency. Makefile.mirrors: - Remove the SRCBRANCH declaration, replaced with the exported GITBRANCH variable. - Update _SNAP_SUFFIX from SVNREVISION to GITREV, and remove the leading 'r' from it, since it will break git hashes. - Remove yet another instance of duplicated code to search for the svn{,version}lite binary. Sponsored by: Rubicon Communications, LLC (netgate.com)
This commit is contained in:
parent
e2c0e292e8
commit
29b282f31d
@ -90,15 +90,6 @@ EXTRA_PACKAGES+= src.txz
|
|||||||
.endif
|
.endif
|
||||||
.if !defined(NODOC)
|
.if !defined(NODOC)
|
||||||
EXTRA_PACKAGES+= reldoc
|
EXTRA_PACKAGES+= reldoc
|
||||||
. if !defined(SVN) || empty(SVN)
|
|
||||||
. for S in svn svnlite
|
|
||||||
. for D in /usr/local/bin /usr/bin
|
|
||||||
. if(exists(${D}/${S}))
|
|
||||||
SVN?= ${D}/${S}
|
|
||||||
. endif
|
|
||||||
. endfor
|
|
||||||
. endfor
|
|
||||||
. endif
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
RELEASE_TARGETS= ftp
|
RELEASE_TARGETS= ftp
|
||||||
@ -173,7 +164,6 @@ ports.txz:
|
|||||||
reldoc:
|
reldoc:
|
||||||
cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \
|
cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \
|
||||||
env MAN4DIR=${WORLDDIR}/share/man/man4 \
|
env MAN4DIR=${WORLDDIR}/share/man/man4 \
|
||||||
SVN=${SVN} \
|
|
||||||
_BRANCH=${BRANCH} \
|
_BRANCH=${BRANCH} \
|
||||||
${MAKE} all install clean "FORMATS=html txt" \
|
${MAKE} all install clean "FORMATS=html txt" \
|
||||||
INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \
|
INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \
|
||||||
@ -336,4 +326,5 @@ release-install:
|
|||||||
cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512
|
cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512
|
||||||
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
|
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
|
||||||
|
|
||||||
|
.include "${.CURDIR}/Makefile.inc1"
|
||||||
.include "${.CURDIR}/Makefile.vm"
|
.include "${.CURDIR}/Makefile.vm"
|
||||||
|
@ -5,30 +5,6 @@
|
|||||||
# Makefile for creating an EC2 AMI from a disk image.
|
# Makefile for creating an EC2 AMI from a disk image.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Figure out where SVN is
|
|
||||||
.if !defined(SVN_CMD) || empty(SVN_CMD)
|
|
||||||
. for _P in /usr/bin /usr/local/bin
|
|
||||||
. for _S in svn svnlite
|
|
||||||
. if exists(${_P}/${_S})
|
|
||||||
SVN_CMD= ${_P}/${_S}
|
|
||||||
. endif
|
|
||||||
. endfor
|
|
||||||
. endfor
|
|
||||||
.endif
|
|
||||||
.if exists(${SRCTOP}/.svn)
|
|
||||||
. if empty(EC2_SVNBRANCH)
|
|
||||||
EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} 2>/dev/null | sed -e 's/\^\///'
|
|
||||||
. export EC2_SVNBRANCH
|
|
||||||
. endif
|
|
||||||
. if empty(EC2_SVNREV)
|
|
||||||
EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} 2>/dev/null || true
|
|
||||||
. export EC2_SVNREV
|
|
||||||
. endif
|
|
||||||
.else
|
|
||||||
EC2_SVNBRANCH= unknown
|
|
||||||
EC2_SVNREV= unknown
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
|
.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
|
||||||
AMINAMESUFFIX!= date +-%Y-%m-%d
|
AMINAMESUFFIX!= date +-%Y-%m-%d
|
||||||
.endif
|
.endif
|
||||||
@ -40,7 +16,7 @@ PUBLICSNAP= --publicsnap
|
|||||||
.endif
|
.endif
|
||||||
.if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC)
|
.if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC)
|
||||||
EC2SNSREL= ${REVISION}-${BRANCH}
|
EC2SNSREL= ${REVISION}-${BRANCH}
|
||||||
EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV}
|
EC2SNSVERS= ${GITBRANCH}@${GITREV}
|
||||||
.endif
|
.endif
|
||||||
.if ${TARGET_ARCH} != "amd64"
|
.if ${TARGET_ARCH} != "amd64"
|
||||||
EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/}
|
EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/}
|
||||||
@ -89,7 +65,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
|
|||||||
${EC2ARCH} --sriov --ena \
|
${EC2ARCH} --sriov --ena \
|
||||||
${.OBJDIR}/ec2.raw \
|
${.OBJDIR}/ec2.raw \
|
||||||
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
|
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
|
||||||
"${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \
|
"${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \
|
||||||
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
|
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
|
||||||
${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}
|
${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}
|
||||||
@touch ${.TARGET}
|
@touch ${.TARGET}
|
||||||
|
25
release/Makefile.inc1
Normal file
25
release/Makefile.inc1
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
|
||||||
|
# Figure out where the git binary is.
|
||||||
|
.if !defined(GIT_CMD) || empty(GIT_CMD)
|
||||||
|
. for _P in /usr/bin /usr/local/bin
|
||||||
|
. if exists(${_P}/git)
|
||||||
|
GIT_CMD= ${_P}/git
|
||||||
|
. endif
|
||||||
|
. endfor
|
||||||
|
. export GIT_CMD
|
||||||
|
.else
|
||||||
|
. error "Git binary not found. Set GIT_CMD appropriately."
|
||||||
|
.endif
|
||||||
|
|
||||||
|
# Set the git branch and hash to export where needed.
|
||||||
|
.if !defined(GITBRANCH) || empty(GITBRANCH)
|
||||||
|
GITBRANCH!= ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
|
||||||
|
.export GITBRANCH
|
||||||
|
.endif
|
||||||
|
.if !defined(GITREV) || empty(GITREV)
|
||||||
|
GITREV!= ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
|
||||||
|
.export GITREV
|
||||||
|
.endif
|
@ -19,7 +19,6 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage
|
|||||||
.if exists(${RELEASEDIR})
|
.if exists(${RELEASEDIR})
|
||||||
STAGE_TARGETS?= iso-images-stage
|
STAGE_TARGETS?= iso-images-stage
|
||||||
.endif
|
.endif
|
||||||
SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR}
|
|
||||||
|
|
||||||
.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD))
|
.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD))
|
||||||
. if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != ""
|
. if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != ""
|
||||||
@ -31,26 +30,10 @@ EMBEDDED= 1
|
|||||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
||||||
SNAPSHOT= 1
|
SNAPSHOT= 1
|
||||||
TLD?= ${FTPDIR}/snapshots
|
TLD?= ${FTPDIR}/snapshots
|
||||||
. if !defined(SVNREVISION) || empty(SVNREVISION)
|
.if !defined(BUILDDATE) || empty(BUILDDATE)
|
||||||
. for _D in /usr/bin /usr/local/bin
|
|
||||||
. for _S in svnversion svnliteversion
|
|
||||||
. if exists(${_D}/${_S})
|
|
||||||
SVNVERSION?= ${_D}/${_S}
|
|
||||||
. endif
|
|
||||||
. endfor
|
|
||||||
. endfor
|
|
||||||
. if exists(${SVNVERSION}) && !empty(SVNVERSION)
|
|
||||||
SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
|
|
||||||
. endif
|
|
||||||
. endif # !defined(SVNREVISION)
|
|
||||||
. if !defined(BUILDDATE) || empty(BUILDDATE)
|
|
||||||
. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
|
|
||||||
BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
|
|
||||||
. else
|
|
||||||
BUILDDATE!= date +%Y%m%d
|
BUILDDATE!= date +%Y%m%d
|
||||||
. endif
|
.endif
|
||||||
. endif
|
_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV}
|
||||||
_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION}
|
|
||||||
.else
|
.else
|
||||||
# release
|
# release
|
||||||
SNAPSHOT=
|
SNAPSHOT=
|
||||||
@ -187,8 +170,8 @@ iso-images-stage:
|
|||||||
mkdir -p ${FTP_DIR}
|
mkdir -p ${FTP_DIR}
|
||||||
cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR}
|
cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR}
|
||||||
echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE
|
echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE
|
||||||
echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH
|
echo ${GITBRANCH} > ${FTP_DIR}/GITBRANCH
|
||||||
echo r${SVNREVISION} > ${FTP_DIR}/REVISION
|
echo ${GITREV} > ${FTP_DIR}/REVISION
|
||||||
cd ${TLD}/${TARGET} && \
|
cd ${TLD}/${TARGET} && \
|
||||||
ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \
|
ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \
|
||||||
${REVISION}-${BRANCH}
|
${REVISION}-${BRANCH}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user