From: Michael Tremer Date: Wed, 11 Jan 2023 09:26:29 +0000 (+0000) Subject: macros: Make it easier to build in a different directory X-Git-Tag: 0.9.29~398 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d23b8c18f06c1e7e1c59c52322dae4045662fc87;p=pakfire.git macros: Make it easier to build in a different directory Signed-off-by: Michael Tremer --- diff --git a/macros/build.macro b/macros/build.macro index cfae9dc25..36c8fa030 100644 --- a/macros/build.macro +++ b/macros/build.macro @@ -155,7 +155,9 @@ end # Pre-defined build scripts. build - configure = [ -x "%{CONFIGURE_SCRIPT}" ] && ./%{CONFIGURE_SCRIPT} %{configure_options} + DIR_BUILD = %{DIR_APP}/%{BUILD_DIR} + + configure = [ -x "%{DIR_APP}/%{CONFIGURE_SCRIPT}" ] && %{DIR_APP}/%{CONFIGURE_SCRIPT} %{configure_options} # These variables are used if you have to add some targets # directly to the make command. @@ -167,6 +169,9 @@ build mkdir -p %{DIR_SRC} && cd %{DIR_SRC} %{prepare} + + # Create the build directory + mkdir -pv %{DIR_BUILD} end def prepare @@ -187,7 +192,7 @@ build end def _build - [ -d "%{DIR_APP}" ] && cd %{DIR_APP} + [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD} %{build} end @@ -215,7 +220,7 @@ build end def _test - [ -d "%{DIR_APP}" ] && cd %{DIR_APP} + [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD} %{test} end @@ -224,7 +229,7 @@ build end def _install - [ -d "%{DIR_APP}" ] && cd %{DIR_APP} + [ -d "%{DIR_BUILD}" ] && cd %{DIR_BUILD} mkdir -pv %{BUILDROOT} diff --git a/macros/constants.macro b/macros/constants.macro index 0a7dbbd1b..e56d5865f 100644 --- a/macros/constants.macro +++ b/macros/constants.macro @@ -1,11 +1,8 @@ -BUILDROOT = %{DIR_BUILD}/%{name}-%{thisver} - -DIR_BUILD = /builddir DIR_APP = %{DIR_SRC}/%{thisapp} DIR_DL = %{BASEDIR}/files DIR_PATCHES = %{BASEDIR}/patches -DIR_SRC = %{DIR_BUILD}/source +DIR_SRC = /build/source DIR_TMP = /tmp DIR_SOURCE = %{BASEDIR}