Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2747 - (show annotations) (download) (as text)
Wed Aug 13 14:02:51 2014 UTC (9 years, 8 months ago) by niro
File MIME type: application/x-sh
File size: 2471 byte(s)
-split off helper functions
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 # override
11 #BUILDROOT="/mnt/test-buildroot"
12 #BUILD_ARCH=( x86_64 i686 )
13 #BUILDROOT_PROFILE="R11"
14 #SMAGE_SVN_REPO="svn://cvs.magellan-linux.de/smage/trunk"
15 #MAGE_SVN_REPO="svn://cvs.magellan-linux.de/mage/trunk"
16
17 SMAGEFILE="$1"
18
19 if [[ -z ${SMAGEFILE} ]]
20 then
21 die "no smage file given. call '$(basename $0) with/relative/path/from/buildroot/svn/smage/to/smagefile'"
22 fi
23
24 if [[ ! -f ${BUILDROOT}/svn/smage/${SMAGEFILE} ]]
25 then
26 die "given smage file does not exist"
27 fi
28
29 if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ]
30 then
31 die "svn checkout of mage required. run buildserver-svn first."
32 fi
33 if [ ! -f ${BUILDROOT}/.stamps/smage_svn-checkout-ok ]
34 then
35 die "svn checkout of smage required. run buildserver-svn first."
36 fi
37 for arch in ${BUILD_ARCH[*]} src
38 do
39 if [ ! -f ${BUILDROOT}/.stamps/${arch}_bootstrap-ok ]
40 then
41 die "bootstrap of buildsystem required for arch '${arch}'. run buildserver-prepare first."
42 fi
43 if [ ! -f ${BUILDROOT}/.stamps/${arch}_initial-mage-tree-ok ]
44 then
45 die "initial regen of mage-tree required for '${arch}'. run buildserver-setup-mage-tree first."
46 fi
47 done
48 for arch in ${BUILD_ARCH[*]}
49 do
50 if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ]
51 then
52 die "common-devutils package for '${arch}' not installed. run buildserver-prepare first."
53 fi
54 done
55
56 # create src package tarball
57 runarch src smage2 --create-src-tarball /var/cache/mage/smage/${SMAGEFILE} || die "src creating src-tarball"
58
59 for arch in ${BUILD_ARCH[*]}
60 do
61 echo "SMAGEFILE=\"${SMAGEFILE}\"" > ${BUILDROOT}/${arch}/.runrc
62 echo "BUILDSERVER_LIB_DIR=\"${BUILDSERVER_LIB_DIR}\"" >> ${BUILDROOT}/${arch}/.runrc
63 cat >> ${BUILDROOT}/${arch}/.runrc << 'EOF'
64 build_retval=0
65 ${BUILDSERVER_LIB_DIR}/buildserver-build-depends.sh ${SMAGEFILE}
66 ${BUILDSERVER_LIB_DIR}/buildserver-build-install-prerequisites.sh ${SMAGEFILE}
67 ${BUILDSERVER_LIB_DIR}/buildserver-build.sh ${SMAGEFILE} || build_retval=1
68 ${BUILDSERVER_LIB_DIR}/buildserver-build-uninstall-prerequisites.sh ${SMAGEFILE}
69
70 exit ${build_retval}
71 EOF
72 runarch-script ${arch} .runrc || die "${arch} package build failed"
73 if [ -f ${BUILDROOT}/${arch}/.runrc ]
74 then
75 rm ${BUILDROOT}/${arch}/.runrc
76 fi
77 done
78
79 echo
80 echo "smage '${SMAGEFILE}' sucessfully build on all arches."