2015-05-11 22:14:03 +00:00
|
|
|
#
|
|
|
|
# This Makefile helps create the directory structure on ftp-master,
|
|
|
|
# making staging builds a bit more sane.
|
|
|
|
#
|
|
|
|
# You probably do not want to use this. Really.
|
|
|
|
# You have been warned.
|
|
|
|
#
|
2015-05-12 01:20:27 +00:00
|
|
|
# Seriously.
|
|
|
|
#
|
|
|
|
# Don't use this unless you know why you're using it.
|
|
|
|
#
|
2015-05-11 22:14:03 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
.include "${.CURDIR}/Makefile"
|
|
|
|
|
2015-05-12 00:27:52 +00:00
|
|
|
RELEASEDIR?= /R
|
2015-05-12 01:27:58 +00:00
|
|
|
FTPDIR?= ${RELEASEDIR}/ftp-stage
|
2015-05-26 17:40:36 +00:00
|
|
|
.if exists(${RELEASEDIR})
|
2015-05-11 22:14:03 +00:00
|
|
|
STAGE_TARGETS?= iso-images-stage
|
2015-05-26 17:40:36 +00:00
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
2015-05-22 21:04:42 +00:00
|
|
|
.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD))
|
2020-12-09 20:38:26 +00:00
|
|
|
. if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" || ${TARGET:Mriscv*} != ""
|
2015-05-21 22:11:57 +00:00
|
|
|
EMBEDDED= 1
|
2015-05-21 22:50:39 +00:00
|
|
|
. endif
|
2015-05-21 22:11:57 +00:00
|
|
|
.endif
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
# snapshot
|
2016-05-27 01:07:48 +00:00
|
|
|
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
2015-05-11 22:14:03 +00:00
|
|
|
SNAPSHOT= 1
|
|
|
|
TLD?= ${FTPDIR}/snapshots
|
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)
2020-07-16 20:34:26 +00:00
|
|
|
.if !defined(BUILDDATE) || empty(BUILDDATE)
|
2015-05-21 22:11:57 +00:00
|
|
|
BUILDDATE!= date +%Y%m%d
|
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)
2020-07-16 20:34:26 +00:00
|
|
|
.endif
|
2020-12-16 18:40:49 +00:00
|
|
|
_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV}-${GITCOUNT}
|
2015-05-11 22:14:03 +00:00
|
|
|
.else
|
|
|
|
# release
|
|
|
|
SNAPSHOT=
|
|
|
|
TLD?= ${FTPDIR}/releases
|
|
|
|
.endif
|
|
|
|
|
2015-05-21 22:11:57 +00:00
|
|
|
.if defined(EMBEDDED) && !empty(EMBEDDED)
|
2020-12-09 20:38:26 +00:00
|
|
|
. if ${TARGET:Marm*} != "" && (${TARGET_ARCH:Marm*} != "" || ${TARGET_ARCH} == "aarch64") || ${TARGET:Mriscv*} != ""
|
2016-05-27 01:07:48 +00:00
|
|
|
. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != ""
|
2015-05-21 22:11:57 +00:00
|
|
|
SNAPSHOT= 1
|
|
|
|
. endif
|
2015-05-22 21:04:42 +00:00
|
|
|
IMAGES:= img
|
2015-05-21 22:11:57 +00:00
|
|
|
. endif # arm/armv6
|
|
|
|
.endif # embedded
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
|
|
|
STAGE_TARGETS+= vm-images-stage
|
|
|
|
VM_DIR= ${TLD}/VM-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+= ${STAGE_TARGETS}
|
2015-10-14 22:33:11 +00:00
|
|
|
CHECKSUM_FILES?= SHA512 SHA256
|
2015-05-11 22:14:03 +00:00
|
|
|
SNAP_SUFFIX!= echo ${_SNAP_SUFFIX:S,^-,,1} | tr -d ' '
|
|
|
|
ISO_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}
|
|
|
|
FTP_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/${REVISION}-${BRANCH}
|
|
|
|
|
2015-05-12 00:30:56 +00:00
|
|
|
remove-old-bits:
|
|
|
|
rm -rf ${FTPDIR}
|
|
|
|
|
2015-05-11 22:14:03 +00:00
|
|
|
iso-images-stage:
|
|
|
|
mkdir -p ${ISO_DIR}
|
|
|
|
mkdir -p ${TLD}/ISO-IMAGES/${REVISION}
|
2015-05-26 17:44:31 +00:00
|
|
|
.if defined(SNAPSHOT) && !empty(SNAPSHOT)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for IMAGE in ${IMAGES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
|
|
|
|
${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif # not embedded
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${IMAGE} \
|
2015-05-26 17:34:56 +00:00
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-11 22:14:03 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
2015-05-22 21:04:42 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
mv ${OSRELEASE}-${IMAGE}.xz \
|
2015-05-26 17:34:56 +00:00
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-21 20:18:13 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
2015-05-22 21:04:42 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # images loop
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 22:11:57 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-21 22:11:57 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
|
2015-05-26 17:44:31 +00:00
|
|
|
. else # not embedded
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 20:18:13 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-12 01:04:02 +00:00
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
2015-05-12 00:55:28 +00:00
|
|
|
ln -s \
|
2015-05-21 20:18:13 +00:00
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif #
|
|
|
|
. endfor # checksum files
|
|
|
|
.else # not snapshot
|
|
|
|
. for IMAGE in ${IMAGES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif # not embedded
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && \
|
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${IMAGE}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \
|
|
|
|
${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # images loop
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && rm -f CHECKSUM.*
|
2015-05-26 17:44:31 +00:00
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
. if defined(EMBEDDED) && !empty(EMBEDDED)
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
|
2015-05-26 17:44:31 +00:00
|
|
|
. else # not embedded
|
2015-05-22 21:04:42 +00:00
|
|
|
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
|
2015-05-21 20:22:55 +00:00
|
|
|
CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} \
|
|
|
|
${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
|
|
|
cd ${TLD}/ISO-IMAGES/${REVISION} && \
|
|
|
|
ln -s \
|
|
|
|
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}
|
2015-05-26 17:44:31 +00:00
|
|
|
. endif
|
|
|
|
. endfor # checksum files
|
|
|
|
.endif # release
|
|
|
|
.if exists(${RELEASEDIR}/ftp)
|
2015-05-11 22:14:03 +00:00
|
|
|
mkdir -p ${FTP_DIR}
|
2015-05-22 21:04:42 +00:00
|
|
|
cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR}
|
2019-06-25 14:56:13 +00:00
|
|
|
echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE
|
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)
2020-07-16 20:34:26 +00:00
|
|
|
echo ${GITBRANCH} > ${FTP_DIR}/GITBRANCH
|
|
|
|
echo ${GITREV} > ${FTP_DIR}/REVISION
|
2015-05-11 22:14:03 +00:00
|
|
|
cd ${TLD}/${TARGET} && \
|
|
|
|
ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \
|
|
|
|
${REVISION}-${BRANCH}
|
2015-05-26 17:44:31 +00:00
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
|
|
|
vm-images-stage:
|
2015-05-22 21:38:11 +00:00
|
|
|
mkdir -p ${VM_DIR}
|
|
|
|
.if defined(SNAPSHOT) && !empty(SNAPSHOT)
|
|
|
|
. if exists(${VM_DIR}/Latest)
|
|
|
|
rm -rf ${VM_DIR}/Latest
|
|
|
|
. endif
|
|
|
|
mkdir -p ${VM_DIR}/Latest
|
|
|
|
mkdir -p ${VM_DIR}/${BUILDDATE}
|
|
|
|
. for VMFORMAT in ${VMFORMATS}
|
|
|
|
cd ${RELEASEDIR}/vmimages && \
|
|
|
|
mv ${OSRELEASE}.${VMFORMAT}.xz \
|
|
|
|
${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
|
|
|
|
${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz
|
|
|
|
cd ${VM_DIR}/Latest && \
|
|
|
|
ln -s ../${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
|
|
|
|
${OSRELEASE}.${VMFORMAT}.xz
|
|
|
|
. endfor
|
|
|
|
cd ${RELEASEDIR}/vmimages && rm -f CHECKSUM.*
|
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
cd ${RELEASEDIR}/vmimages && \
|
|
|
|
${CHECKSUM:tl} ${OSRELEASE}* > CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
|
|
|
|
${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
|
|
|
|
cd ${VM_DIR}/Latest && \
|
|
|
|
ln -s ../${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
|
|
|
|
CHECKSUM.${CHECKSUM}
|
|
|
|
. endfor
|
|
|
|
.else # not snapshot
|
|
|
|
. if exists(${VM_DIR}/Latest)
|
|
|
|
rm -rf ${VM_DIR}/Latest
|
|
|
|
. endif
|
|
|
|
mkdir -p ${VM_DIR}/Latest
|
|
|
|
. for VMFORMAT in ${VMFORMATS}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}.${VMFORMAT}.xz \
|
|
|
|
${VM_DIR}/Latest/${OSRELEASE}.${VMFORMAT}.xz
|
|
|
|
. endfor
|
|
|
|
. for CHECKSUM in ${CHECKSUM_FILES}
|
|
|
|
cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM} \
|
|
|
|
${VM_DIR}/Latest/CHECKSUM.${CHECKSUM}
|
|
|
|
. endfor
|
|
|
|
.endif
|
2015-05-11 22:14:03 +00:00
|
|
|
|
2015-05-12 00:30:56 +00:00
|
|
|
ftp-stage: remove-old-bits ${STAGE_TARGETS}
|
2015-05-11 22:14:03 +00:00
|
|
|
|