Contents of /trunk/toolchain/toolchain-create.sh
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
(as text)
Mon Jul 4 00:41:38 2005 UTC (18 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 2010 byte(s)
Mon Jul 4 00:41:38 2005 UTC (18 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 2010 byte(s)
new toolchain create utilities and smages
1 | #!/bin/bash |
2 | |
3 | die() { |
4 | echo "ERROR: $@" |
5 | exit 1 |
6 | } |
7 | |
8 | # get some settings from mage |
9 | source /etc/mage.rc |
10 | |
11 | # which profile we are using ? |
12 | PROFILE="$1" |
13 | |
14 | [ -z "${PROFILE}" ] && die "no profile given. Usage: $(basename $0) PROFILE" |
15 | [ ! -f ./profiles/${PROFILE}/layout ] && die "Profile '${PROFILE}' layout file not found." |
16 | |
17 | # which packages to build |
18 | # read them, end exclude the commented ones |
19 | TOOLCHAIN_PACKAGES="$(< ./profiles/${PROFILE}/layout)" |
20 | |
21 | # where are the smage files ? |
22 | TOOLCHAIN_SMAGE_DIR=$(pwd) |
23 | |
24 | # where gets the toolchain installed ? |
25 | export ROOT="$(pwd)/tmp/${PROFILE}" |
26 | |
27 | # name and place of the tarball |
28 | TOOLCHAIN_TARBALL="$(pwd)/magellan-toolchain-${PROFILE}.tar.bz2" |
29 | |
30 | echo "Compiling all packages for profile '${PROFILE}' ..." |
31 | |
32 | for i in ${TOOLCHAIN_PACKAGES} |
33 | do |
34 | # exclude commented and empty |
35 | case ${i} in |
36 | \#*|"") continue ;; |
37 | esac |
38 | |
39 | PNAME_FULL="${i}" |
40 | PNAME="${i%-*-*}" |
41 | smage2 ${TOOLCHAIN_SMAGE_DIR}/${PNAME}/${PNAME_FULL}.smage2 || die "compile ${i}" |
42 | done |
43 | echo "All packages for profile '${PROFILE}' successfully compiled ..." |
44 | |
45 | [ ! -x ./minstallpkg.sh ] && die "minstallpkg not found. Cannot build ./tools dir." |
46 | [ ! -d ${ROOT} ] && install -d ${ROOT} |
47 | |
48 | echo "Installing all packages for profile '${PROFILE}' to '${ROOT}' ..." |
49 | for i in ${TOOLCHAIN_PACKAGES} |
50 | do |
51 | # exclude commented and empty |
52 | case ${i} in |
53 | \#*|"") continue ;; |
54 | esac |
55 | |
56 | # fix pgk name -> add ARCH from mage.rc |
57 | PNAME_FULL="${i}" |
58 | PNAME="${i%-*-*}" |
59 | PVER="$(echo ${PNAME_FULL%-*} | sed -e s:${PNAME}-::g)" |
60 | PNAME_PVER_ARCH="${PNAME_FULL/-${PVER}-/-${PVER}-${ARCH}-}" |
61 | ROOT=${ROOT} ./minstallpkg.sh ${PKGDIR}/${PNAME_PVER_ARCH}.mpk || die "install ${i}" |
62 | done |
63 | echo "All packages for profile '${PROFILE}' successfully installed ..." |
64 | |
65 | echo "Creating no the toolchain tarball ..." |
66 | [ ! -d $(dirname ${TOOLCHAIN_TARBALL}) ] && install -d $(dirname ${TOOLCHAIN_TARBALL}) |
67 | ( cd ${ROOT}; tar cvjpf ${TOOLCHAIN_TARBALL} ./ ) || die "error creating tarball" |
68 | |
69 | echo |
70 | echo "All tasks done." |
71 | echo "You find your tarball at ${TOOLCHAIN_TARBALL} ..." |
72 | echo |
Properties
Name | Value |
---|---|
svn:executable | * |