Debian Codegraph @

build-recipe-arch

raw
1 #
2 # Arch specific functions.
3 #
4 ################################################################
5 #
6 # Copyright (c) 1995-2014 SUSE Linux Products 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_arch() {
25 TOPDIR=/usr/src/packages
26 test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
27 mkdir -p "$BUILD_ROOT$TOPDIR"
28 mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
29 mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
30 mkdir -p "$BUILD_ROOT/$TOPDIR/ARCHPKGS"
31 mkdir -p "$BUILD_ROOT/$TOPDIR/BUILD"
32 chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
33 cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
34 {
35 echo 'source /etc/makepkg.conf'
36 printf '%s=%s\n' \
37 BUILDDIR $TOPDIR/BUILD \
38 PKGDEST $TOPDIR/ARCHPKGS
39 } > $BUILD_ROOT$TOPDIR/makepkg.conf
40 }
41
42 recipe_prepare_arch() {
43 echo "Preparing sources..."
44 if ! _arch_recipe_makepkg -so --skippgpcheck "2>&1" ">/dev/null" ; then
45 cleanup_and_exit 1 "failed to prepare sources"
46 fi
47 }
48
49 recipe_build_arch() {
50 # Build binary and source package
51 _arch_recipe_makepkg -ef < /dev/null && \
52 _arch_recipe_makepkg -ef --allsource < /dev/null && \
53 BUILD_SUCCEEDED=true
54 }
55
56 recipe_resultdirs_arch() {
57 echo ARCHPKGS
58 }
59
60 recipe_cleanup_arch() {
61 :
62 }
63
64 _arch_recipe_makepkg() {
65 chroot $BUILD_ROOT su -lc "source /etc/profile; cd $TOPDIR/SOURCES && makepkg --config ../makepkg.conf $*" $BUILD_USER
66 }