Annotation of /trunk/mage-buildserver/buildserver-compile-smage.sh
Parent Directory | Revision Log
Revision 2799 -
(hide annotations)
(download)
(as text)
Thu Aug 28 09:49:14 2014 UTC (10 years, 2 months ago) by niro
File MIME type: application/x-sh
File size: 2277 byte(s)
Thu Aug 28 09:49:14 2014 UTC (10 years, 2 months ago) by niro
File MIME type: application/x-sh
File size: 2277 byte(s)
-respect all possible arches
1 | niro | 2588 | #!/bin/bash |
2 | |||
3 | # get configuration | ||
4 | BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" | ||
5 | niro | 2747 | BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" |
6 | niro | 2588 | 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 ${BUILD_ARCH[*]} src | ||
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 ${BUILD_ARCH[*]} | ||
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 | niro | 2799 | for arch in $(enum-build-arch-types) |
53 | niro | 2588 | do |
54 | echo "SMAGEFILE=\"${SMAGEFILE}\"" > ${BUILDROOT}/${arch}/.runrc | ||
55 | niro | 2747 | echo "BUILDSERVER_LIB_DIR=\"${BUILDSERVER_LIB_DIR}\"" >> ${BUILDROOT}/${arch}/.runrc |
56 | cat >> ${BUILDROOT}/${arch}/.runrc << 'EOF' | ||
57 | niro | 2588 | build_retval=0 |
58 | niro | 2798 | ${BUILDSERVER_LIB_DIR}/buildserver-build-depends.sh ${SMAGEFILE} || exit 1 |
59 | niro | 2747 | ${BUILDSERVER_LIB_DIR}/buildserver-build-install-prerequisites.sh ${SMAGEFILE} |
60 | ${BUILDSERVER_LIB_DIR}/buildserver-build.sh ${SMAGEFILE} || build_retval=1 | ||
61 | ${BUILDSERVER_LIB_DIR}/buildserver-build-uninstall-prerequisites.sh ${SMAGEFILE} | ||
62 | niro | 2588 | |
63 | niro | 2747 | exit ${build_retval} |
64 | niro | 2588 | 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." |