Merge "Support BuildFlags: nocumulaterpms" into devel
[tools/build.git] / build-recipe-debbuild
1 #
2 # debbuild specific functions.
3 #
4 ################################################################
5 #
6 # Copyright (c) 2015 SUSE Linux GmbH
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2 or 3 as
10 # published by the Free Software Foundation.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program (see the file COPYING); if not, write to the
19 # Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #
22 ################################################################
23
24 recipe_setup_debbuild() {
25     TOPDIR=`chroot $BUILD_ROOT su -c "debbuild --eval '%_topdir'" - $BUILD_USER`
26     if test -z "$TOPDIR"; then
27         echo "Error: TOPDIR empty"
28         cleanup_and_exit 1
29     fi
30     test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
31     mkdir -p "$BUILD_ROOT$TOPDIR"
32     mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
33     mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
34     mkdir -p "$BUILD_ROOT$TOPDIR/DEBS"
35     mkdir -p "$BUILD_ROOT$TOPDIR/SDEBS"
36     mkdir -p "$BUILD_ROOT$TOPDIR/BUILD"
37     test -e "$BUILD_ROOT$TOPDIR/SPECS" || ln -s SOURCES "$BUILD_ROOT$TOPDIR/SPECS"
38     chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
39     cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
40 }
41
42 recipe_prepare_debbuild() {
43     recipe_prepare_spec "$@"
44 }
45
46 recipe_build_debbuild() {
47     recipe_build_spec "$@"
48 }
49
50 recipe_resultdirs_debbuild() {
51     echo DEBS SDEBS
52 }
53