Debian Codegraph @

build-recipe-collax

raw
1 #
2 # Copyright 2015 Zarafa B.V. and its licensors
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the GNU General Public License as published by the Free Software
6 # Foundation; either version 2 or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11 # details.
12 #
13
14 recipe_setup_collax() {
15 TOPDIR="/usr/src/packages"
16 test "$DO_INIT_TOPDIR" != false && rm -Rf "$BUILD_ROOT/$TOPDIR"
17 mkdir -p "$BUILD_ROOT/$TOPDIR"/{SOURCES,SOURCES.DEB,DEBS,OTHER}
18 cp -p "$MYSRCDIR"/* "$BUILD_ROOT/$TOPDIR/SOURCES/"
19 chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/$TOPDIR"
20 }
21
22 recipe_prepare_collax() {
23 DEB_SOURCEDIR="$TOPDIR/SOURCES"
24 DEB_DSCFILE="$RECIPEFILE"
25 chmod -v +x "$BUILD_ROOT/$DEB_SOURCEDIR/build.collax"
26 ln -fsv build.collax "$BUILD_ROOT/$DEB_SOURCEDIR/build"
27 }
28
29 collax_build() {
30 local buildroot="$1"
31
32 chroot "$buildroot" su - $BUILD_USER -c \
33 "cd $TOPDIR/SOURCES && ./build"
34 ret=$?
35 if test "$ret" = 0; then
36 BUILD_SUCCEEDED=true
37 fi
38 }
39
40 collax_move_build_result() {
41 for f in "$BUILD_ROOT/$DEB_SOURCEDIR"/*.{deb,changes}; do
42 test -f "$f" && mv -v "$f" "$BUILD_ROOT/$TOPDIR/DEBS/"
43 done
44 }
45
46 recipe_build_collax() {
47 collax_build "$BUILD_ROOT"
48 collax_move_build_result
49 }
50
51 recipe_resultdirs_collax() {
52 echo DEBS
53 }
54
55 recipe_cleanup_collax() {
56 :
57 }