-
Notifications
You must be signed in to change notification settings - Fork 186
/
build-recipe-productcompose
100 lines (91 loc) · 3.22 KB
/
build-recipe-productcompose
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# KIWI specific functions. Handle with care.
#
################################################################
#
# Copyright (c) 2023 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (see the file COPYING); if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
################################################################
recipe_setup_productcompose() {
TOPDIR=/usr/src/packages
test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
mkdir -p "$BUILD_ROOT$TOPDIR/PRODUCT"
# compat, older build versions did not clean TOPDIR ...
mkdir -p "$BUILD_ROOT$TOPDIR/BUILD"
mkdir -p "$BUILD_ROOT$TOPDIR/RPMS"
mkdir -p "$BUILD_ROOT$TOPDIR/SRPMS"
if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir; then
mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
else
if test -z "$LINKSOURCES" ; then
cp -dLR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ || cleanup_and_exit 1 "source copy failed"
else
cp -lR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ || cleanup_and_exit 1 "source copy failed"
fi
fi
chown -hR "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
}
recipe_prepare_productcompose() {
:
}
productcompose_query_recipe() {
perl -I$BUILD_DIR -MBuild::ProductCompose -e Build::ProductCompose::show "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" "$1" "${BUILD_ARCH%%:*}" "$BUILD_FLAVOR"
}
recipe_build_productcompose() {
echo "running product composer..."
local milestone=$(productcompose_query_recipe milestone)
extra_args=
if test -n "$RELEASE" ; then
extra_args=" $extra_args --release $RELEASE"
fi
if test -n "$BUILD_FLAVOR" ; then
extra_args=" $extra_args --flavor $BUILD_FLAVOR"
fi
if test -n "$DISTURL" ; then
extra_args=" $extra_args --disturl $DISTURL"
fi
if test -n "$BUILD_VCSURL" ; then
extra_args=" $extra_args --vcs $BUILD_VCSURL"
fi
chroot "$BUILD_ROOT" su -c "/usr/bin/product-composer build $extra_args -v --clean $TOPDIR/SOURCES/$RECIPEFILE $TOPDIR/PRODUCT" - abuild < /dev/null && BUILD_SUCCEEDED=true
pushd "$BUILD_ROOT/$TOPDIR/PRODUCT"
for i in * ; do
test -e "$i" || continue
case $i in
*.iso)
test -n "$milestone" && echo "$milestone" > $BUILD_ROOT/$TOPDIR/PRODUCT/${i%.iso}.milestone
;;
*.report)
test -n "$milestone" && echo "$milestone" > $BUILD_ROOT/$TOPDIR/PRODUCT/${i%.report}.milestone
;;
*)
test -d "$i" || continue
test -n "$milestone" && echo "$milestone" > $BUILD_ROOT/$TOPDIR/PRODUCT/${i}.milestone
;;
esac
done
popd
}
recipe_resultdirs_productcompose() {
echo PRODUCT
}
recipe_cleanup_productcompose() {
:
}