2020-07-23 15:23:08 +02:00
|
|
|
# Copyright (c) 2015-2020 Franco Fichtner <franco@opnsense.org>
|
2017-01-01 14:46:04 +01:00
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
|
2018-09-17 02:26:13 +02:00
|
|
|
STEPS= arm base boot chroot clean compress confirm core distfiles \
|
2019-10-13 11:11:43 +02:00
|
|
|
download dvd fingerprint info kernel nano packages plugins \
|
|
|
|
ports prefetch print rebase release rename rewind serial sign \
|
2019-07-02 08:26:40 +02:00
|
|
|
skim test update upload verify vga vm xtools
|
2019-01-18 08:55:05 +01:00
|
|
|
SCRIPTS= batch hotfix nightly
|
2019-07-02 08:26:40 +02:00
|
|
|
|
|
|
|
.PHONY: ${STEPS} ${SCRIPTS}
|
2015-05-17 19:48:27 +02:00
|
|
|
|
2015-05-17 20:26:21 +02:00
|
|
|
PAGER?= less
|
|
|
|
|
2019-01-02 16:07:00 +01:00
|
|
|
.MAKE.JOB.PREFIX?= # tampers with some of our make invokes
|
|
|
|
|
2015-05-17 20:26:21 +02:00
|
|
|
all:
|
|
|
|
@cat ${.CURDIR}/README.md | ${PAGER}
|
|
|
|
|
2017-08-27 06:04:54 +02:00
|
|
|
lint-steps:
|
2017-09-05 06:22:39 +02:00
|
|
|
.for STEP in common ${STEPS}
|
2016-03-04 15:46:37 +01:00
|
|
|
@sh -n ${.CURDIR}/build/${STEP}.sh
|
2017-08-27 06:04:54 +02:00
|
|
|
.endfor
|
|
|
|
|
2018-10-12 08:33:47 +02:00
|
|
|
lint-composite:
|
2017-08-27 06:04:54 +02:00
|
|
|
.for SCRIPT in ${SCRIPTS}
|
2018-10-12 08:33:47 +02:00
|
|
|
@sh -n ${.CURDIR}/composite/${SCRIPT}.sh
|
2017-08-27 06:04:54 +02:00
|
|
|
.endfor
|
|
|
|
|
2018-10-12 08:33:47 +02:00
|
|
|
lint: lint-steps lint-composite
|
2016-03-04 15:46:37 +01:00
|
|
|
|
2016-12-23 16:27:48 +01:00
|
|
|
# Special vars to load early build.conf settings:
|
|
|
|
|
|
|
|
TOOLSDIR?= /usr/tools
|
2016-12-26 11:08:46 +01:00
|
|
|
TOOLSBRANCH?= master
|
2020-07-23 15:23:08 +02:00
|
|
|
SETTINGS?= 20.7
|
2016-12-23 16:27:48 +01:00
|
|
|
|
|
|
|
CONFIG?= ${TOOLSDIR}/config/${SETTINGS}/build.conf
|
2015-05-16 11:35:18 +02:00
|
|
|
|
2017-01-05 18:02:21 +01:00
|
|
|
.-include "${CONFIG}"
|
2015-05-16 11:35:18 +02:00
|
|
|
|
2015-05-17 19:48:27 +02:00
|
|
|
# Bootstrap the build options if not set:
|
|
|
|
|
2015-05-16 11:35:18 +02:00
|
|
|
NAME?= OPNsense
|
2016-07-10 16:49:31 +02:00
|
|
|
TYPE?= ${NAME:tl}
|
2016-07-12 07:22:57 +02:00
|
|
|
SUFFIX?= #-devel
|
2019-06-10 17:55:58 +02:00
|
|
|
FLAVOUR?= OpenSSL LibreSSL # first one is default
|
2016-07-21 21:40:28 +02:00
|
|
|
_ARCH!= uname -p
|
2016-07-17 15:38:10 +02:00
|
|
|
ARCH?= ${_ARCH}
|
2016-12-26 11:08:46 +01:00
|
|
|
KERNEL?= SMP
|
2018-01-15 21:38:52 +01:00
|
|
|
ADDITIONS?= os-dyndns${SUFFIX}
|
2019-05-07 10:02:53 +02:00
|
|
|
DEVICE?= A10
|
2016-05-23 22:06:57 +02:00
|
|
|
SPEED?= 115200
|
2016-07-11 08:50:39 +02:00
|
|
|
UEFI?= yes
|
2017-07-16 04:57:23 +02:00
|
|
|
GITBASE?= https://github.com/opnsense
|
2016-02-02 21:08:53 +01:00
|
|
|
MIRRORS?= https://opnsense.c0urier.net \
|
2016-02-02 20:51:03 +01:00
|
|
|
http://mirrors.nycbug.org/pub/opnsense \
|
|
|
|
http://mirror.wdc1.us.leaseweb.net/opnsense \
|
|
|
|
http://mirror.sfo12.us.leaseweb.net/opnsense \
|
|
|
|
http://mirror.fra10.de.leaseweb.net/opnsense \
|
|
|
|
http://mirror.ams1.nl.leaseweb.net/opnsense
|
2018-03-17 09:13:29 +01:00
|
|
|
SERVER?= user@does.not.exist
|
2019-05-08 06:22:54 +02:00
|
|
|
UPLOADDIR?= .
|
2015-05-16 11:35:18 +02:00
|
|
|
_VERSION!= date '+%Y%m%d%H%M'
|
|
|
|
VERSION?= ${_VERSION}
|
2016-02-28 22:57:54 +01:00
|
|
|
STAGEDIRPREFIX?=/usr/obj
|
2019-12-23 07:13:45 +01:00
|
|
|
|
2020-01-05 08:33:28 +01:00
|
|
|
PORTSREFURL?= https://git-01.md.hardenedbsd.org/HardenedBSD/hardenedbsd-ports.git
|
2017-06-12 09:32:37 +02:00
|
|
|
PORTSREFDIR?= /usr/hardenedbsd-ports
|
2017-01-12 08:22:37 +01:00
|
|
|
PORTSREFBRANCH?=master
|
2019-12-23 07:13:45 +01:00
|
|
|
|
2020-02-18 10:15:34 +01:00
|
|
|
PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} PLUGIN_PYTHON=${PYTHON}
|
2015-07-09 14:32:50 +02:00
|
|
|
PLUGINSDIR?= /usr/plugins
|
2020-07-15 16:26:46 +02:00
|
|
|
PLUGINSBRANCH?= stable/${SETTINGS}
|
2015-06-09 10:14:37 +02:00
|
|
|
PORTSDIR?= /usr/ports
|
2016-12-23 16:27:48 +01:00
|
|
|
PORTSBRANCH?= master
|
2015-06-09 10:14:37 +02:00
|
|
|
COREDIR?= /usr/core
|
2020-07-15 16:26:46 +02:00
|
|
|
COREBRANCH?= stable/${SETTINGS}
|
2020-02-18 10:15:34 +01:00
|
|
|
COREENV?= CORE_PHP=${PHP} CORE_ABI=${SETTINGS} CORE_PYTHON=${PYTHON}
|
2015-06-09 10:14:37 +02:00
|
|
|
SRCDIR?= /usr/src
|
2020-07-15 16:26:46 +02:00
|
|
|
SRCBRANCH?= stable/${SETTINGS}
|
2015-05-16 11:35:18 +02:00
|
|
|
|
2020-06-24 05:07:40 +02:00
|
|
|
# for plugins and core
|
2019-02-24 18:33:44 +01:00
|
|
|
DEVELBRANCH?= #master
|
|
|
|
|
2016-02-02 16:47:06 +01:00
|
|
|
# A couple of meta-targets for easy use and ordering:
|
2015-05-17 19:48:27 +02:00
|
|
|
|
2016-03-25 11:29:50 +01:00
|
|
|
ports distfiles: base
|
2016-02-02 16:47:06 +01:00
|
|
|
plugins: ports
|
|
|
|
core: plugins
|
2017-01-06 19:24:20 +01:00
|
|
|
packages test: core
|
2017-04-10 09:37:26 +02:00
|
|
|
dvd nano serial vga vm: packages kernel
|
2016-05-21 12:18:23 +02:00
|
|
|
sets: distfiles packages kernel
|
2017-09-03 10:39:52 +02:00
|
|
|
images: dvd nano serial vga vm # arm
|
2017-04-10 09:37:26 +02:00
|
|
|
release: dvd nano serial vga
|
2015-05-16 13:38:54 +02:00
|
|
|
|
2015-05-17 19:48:27 +02:00
|
|
|
# Expand target arguments for the script append:
|
|
|
|
|
|
|
|
.for TARGET in ${.TARGETS}
|
|
|
|
_TARGET= ${TARGET:C/\-.*//}
|
|
|
|
.if ${_TARGET} != ${TARGET}
|
|
|
|
${_TARGET}_ARGS+= ${TARGET:C/^[^\-]*(\-|\$)//:S/,/ /g}
|
|
|
|
${TARGET}: ${_TARGET}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2016-05-20 16:12:11 +02:00
|
|
|
.if "${VERBOSE}" != ""
|
2015-09-09 16:20:18 +02:00
|
|
|
VERBOSE_FLAGS= -x
|
2016-07-17 15:38:10 +02:00
|
|
|
.else
|
|
|
|
VERBOSE_HIDDEN= @
|
2015-08-21 11:07:49 +02:00
|
|
|
.endif
|
|
|
|
|
2020-02-18 10:15:34 +01:00
|
|
|
.for _VERSION in PERL PHP PYTHON RUBY
|
2018-04-05 08:23:30 +02:00
|
|
|
VERSIONS+= PRODUCT_${_VERSION}=${${_VERSION}}
|
2018-04-01 12:24:11 +02:00
|
|
|
.endfor
|
|
|
|
|
2015-05-17 19:48:27 +02:00
|
|
|
# Expand build steps to launch into the selected
|
|
|
|
# script with the proper build options set:
|
|
|
|
|
|
|
|
.for STEP in ${STEPS}
|
2017-08-27 06:04:54 +02:00
|
|
|
${STEP}: lint-steps
|
2016-07-17 15:38:10 +02:00
|
|
|
${VERBOSE_HIDDEN} cd ${.CURDIR}/build && \
|
2016-12-26 11:08:46 +01:00
|
|
|
sh ${VERBOSE_FLAGS} ./${.TARGET}.sh -a ${ARCH} -F ${KERNEL} \
|
2019-06-10 17:55:58 +02:00
|
|
|
-f "${FLAVOUR}" -n ${NAME} -v ${VERSION} -s ${SETTINGS} \
|
2015-07-09 14:32:50 +02:00
|
|
|
-S ${SRCDIR} -P ${PORTSDIR} -p ${PLUGINSDIR} -T ${TOOLSDIR} \
|
2016-07-05 08:55:27 +02:00
|
|
|
-C ${COREDIR} -R ${PORTSREFDIR} -t ${TYPE} -k "${PRIVKEY}" \
|
|
|
|
-K "${PUBKEY}" -l "${SIGNCHK}" -L "${SIGNCMD}" -d ${DEVICE} \
|
2016-05-23 22:06:57 +02:00
|
|
|
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
|
2016-12-23 16:55:19 +01:00
|
|
|
-b ${SRCBRANCH} -B ${PORTSBRANCH} -e ${PLUGINSBRANCH} \
|
2017-01-12 08:22:37 +01:00
|
|
|
-g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \
|
2019-06-03 08:25:26 +02:00
|
|
|
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \
|
2018-04-01 12:24:11 +02:00
|
|
|
-V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \
|
2019-03-14 11:27:15 +01:00
|
|
|
-q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \
|
2019-12-23 07:13:45 +01:00
|
|
|
-D "${DEVELBRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS}
|
2015-05-16 11:35:18 +02:00
|
|
|
.endfor
|
2017-08-27 06:04:54 +02:00
|
|
|
|
|
|
|
.for SCRIPT in ${SCRIPTS}
|
2018-10-12 08:33:47 +02:00
|
|
|
${SCRIPT}: lint-composite
|
2019-06-10 17:55:58 +02:00
|
|
|
${VERBOSE_HIDDEN} cd ${.CURDIR} && FLAVOUR="${FLAVOUR}" \
|
|
|
|
sh ${VERBOSE_FLAGS} ./composite/${SCRIPT}.sh ${${SCRIPT}_ARGS}
|
2017-08-27 06:04:54 +02:00
|
|
|
.endfor
|