Magellan Linux

Contents of /trunk/mage-buildserver/buildserver-compile-smage.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2855 - (show annotations) (download) (as text)
Wed Feb 11 12:24:07 2015 UTC (9 years, 2 months ago) by niro
File MIME type: application/x-sh
File size: 2297 byte(s)
-error exit if prequisites install failes
1 #!/bin/bash
2
3 # get configuration
4 BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"
5 BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"
6 source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf
7
8 source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh
9
10 SMAGEFILE="$1"
11
12 if [[ -z ${SMAGEFILE} ]]
13 then
14 die "no smage file given. call '$(basename $0) with/relative/path/from/buildroot/svn/smage/to/smagefile'"
15 fi
16
17 if [[ ! -f ${BUILDROOT}/svn/smage/${SMAGEFILE} ]]
18 then
19 die "given smage file does not exist"
20 fi
21
22 if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ]
23 then
24 die "svn checkout of mage required. run buildserver-svn first."
25 fi
26 if [ ! -f ${BUILDROOT}/.stamps/smage_svn-checkout-ok ]
27 then
28 die "svn checkout of smage required. run buildserver-svn first."
29 fi
30 for arch in $(enum-all-arch-types)
31 do
32 if [ ! -f ${BUILDROOT}/.stamps/${arch}_bootstrap-ok ]
33 then
34 die "bootstrap of buildsystem required for arch '${arch}'. run buildserver-prepare first."
35 fi
36 if [ ! -f ${BUILDROOT}/.stamps/${arch}_initial-mage-tree-ok ]
37 then
38 die "initial regen of mage-tree required for '${arch}'. run buildserver-setup-mage-tree first."
39 fi
40 done
41 for arch in $(enum-build-arch-types)
42 do
43 if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ]
44 then
45 die "common-devutils package for '${arch}' not installed. run buildserver-prepare first."
46 fi
47 done
48
49 # create src package tarball
50 runarch src smage2 --create-src-tarball /var/cache/mage/smage/${SMAGEFILE} || die "src creating src-tarball"
51
52 for arch in $(enum-build-arch-types)
53 do
54 echo "SMAGEFILE=\"${SMAGEFILE}\"" > ${BUILDROOT}/${arch}/.runrc
55 echo "BUILDSERVER_LIB_DIR=\"${BUILDSERVER_LIB_DIR}\"" >> ${BUILDROOT}/${arch}/.runrc
56 cat >> ${BUILDROOT}/${arch}/.runrc << 'EOF'
57 build_retval=0
58 ${BUILDSERVER_LIB_DIR}/buildserver-build-depends.sh ${SMAGEFILE} || exit 1
59 ${BUILDSERVER_LIB_DIR}/buildserver-build-install-prerequisites.sh ${SMAGEFILE} || exit 1
60 ${BUILDSERVER_LIB_DIR}/buildserver-build.sh ${SMAGEFILE} || build_retval=1
61 ${BUILDSERVER_LIB_DIR}/buildserver-build-uninstall-prerequisites.sh ${SMAGEFILE}
62
63 exit ${build_retval}
64 EOF
65 runarch-script ${arch} .runrc || die "${arch} package build failed"
66 if [ -f ${BUILDROOT}/${arch}/.runrc ]
67 then
68 rm ${BUILDROOT}/${arch}/.runrc
69 fi
70 done
71
72 echo
73 echo "smage '${SMAGEFILE}' sucessfully build on all arches."