Skip to content

Commit

Permalink
[mb2] set target option to rpmbuild
Browse files Browse the repository at this point in the history
Signed-off-by: Juha Kallioinen <juha.kallioinen@jolla.com>
  • Loading branch information
kaltsi authored and lbt committed Sep 8, 2014
1 parent 8e9726a commit 0151b93
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/mb2
Expand Up @@ -286,12 +286,13 @@ run_build() {
verify_target_dependencies

sed -e '/^%patch/d' "$OPT_SPEC" > "$OPT_SPEC".$$

local build_tgt=$(sb2 -t $OPT_TARGET gcc -dumpmachine)
build_tgt=${build_tgt%-gnueabi}
increment_build_number;
(
cd_to_spec_setup_dir;
rm -f $_basedir/RPMS/*;
increment_build_number;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place \
rm -f $_basedir/RPMS/*.rpm;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place --target=$build_tgt \
$BUILD_DEBUG \
--define \"_smp_mflags -j$BUILD_JOBS\" \
--define \"_rpmdir $_basedir/RPMS \" \
Expand All @@ -309,6 +310,9 @@ run_build() {

run_qmake() {
if [[ "$OPT_SPEC" ]]; then
local build_tgt=$(sb2 -t $OPT_TARGET gcc -dumpmachine)
build_tgt=${build_tgt%-gnueabi}

# The paths that are passed to rpmbuild via the --define
# options can contain whitespace so let's quote all args
fix_arguments "$@"
Expand All @@ -317,7 +321,7 @@ run_qmake() {
verify_target_dependencies
(
cd_to_spec_setup_dir;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place \
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place --target=$build_tgt \
--dobuild \
--define \"noecho 1 \" \
--define \"qtc_builddir $_basedir \" \
Expand All @@ -333,9 +337,11 @@ run_qmake() {

run_make() {
if [[ "$OPT_SPEC" ]]; then
local build_tgt=$(sb2 -t $OPT_TARGET gcc -dumpmachine)
build_tgt=${build_tgt%-gnueabi}
(
cd_to_spec_setup_dir;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place \
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place --target=$build_tgt \
--dobuild \
--define \"noecho 1 \" \
--define \"qtc_builddir $_basedir \" \
Expand All @@ -350,10 +356,13 @@ run_make() {
}

run_install() {
local build_tgt=$(sb2 -t $OPT_TARGET gcc -dumpmachine)
build_tgt=${build_tgt%-gnueabi}

# Install to buildroot which should be rsync'ed to /opt/sdk/$package on device
(
cd_to_spec_setup_dir;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place \
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place --target=$build_tgt \
--define \"noecho 1 \" \
--define \"qtc_builddir $_basedir \" \
--define \"_sourcedir $_basedir/rpm \" \
Expand All @@ -364,11 +373,13 @@ run_install() {
}

run_rpm() {
local build_tgt=$(sb2 -t $OPT_TARGET gcc -dumpmachine)
build_tgt=${build_tgt%-gnueabi}
(
cd_to_spec_setup_dir;
rm -f $_basedir/RPMS/*;
rm -f $_basedir/RPMS/*.rpm;
increment_build_number;
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place \
eval sb2 -t $OPT_TARGET rpmbuild --build-in-place --target=$build_tgt \
--define \"qtc_builddir $_basedir \" \
--define \"_rpmdir $_basedir/RPMS \" \
--define \"_sourcedir $_basedir/rpm \" \
Expand Down

0 comments on commit 0151b93

Please sign in to comment.