Magellan Linux

Contents of /trunk/mage/usr/lib/mage/sourceinstall.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (show annotations) (download) (as text)
Thu Jan 6 02:57:12 2005 UTC (19 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 1951 byte(s)
fixed version tags

1 #!/bin/bash
2
3 #installs from source with given mage-file
4 # version: 0.3.6-r9
5
6 [ -z "$1" ] && echo "no mage-file given ..." && exit 1
7
8 MAGENAME=$1
9 SMSUFFIX=smage2
10
11 source /etc/mage.rc
12
13 #cuts full pathnames or versioniezed names down to basename
14 choppkgname(){
15 #we want this only if full name was used
16 if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]
17 then
18 #cuts ARCH and PBUILD
19 #ARCH comes from /etc/mage.rc
20 #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")
21 #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g")
22 MAGENAME=$(basename ${MAGENAME%-*} .mage)
23
24 #cuts version number
25 MAGENAME=$(basename ${MAGENAME%-*} .mage)
26 fi
27 }
28
29 choppkgname
30 #VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}::g")
31 #VERSION=$(echo ${VERSION#-*}|sed -e "s:-${ARCH}.*::g")
32 #BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g" -e "s:-${VERSION}::g" -e "s:-${ARCH}-::g")
33
34 VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f2)
35 BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f3)
36
37 echo M:${MAGENAME}
38 echo V:${VERSION}
39 echo B:${BUILD}
40
41 #read
42
43 SMAGEFILE=${SMAGESCRIPTSDIR}/${MAGENAME}/${MAGENAME}-${VERSION}-${BUILD}.${SMSUFFIX}
44 if [ -e ${SMAGEFILE} ]
45 then
46 echo ${SMAGEFILE}
47 else
48 echo
49 echo "$(basename ${SMAGEFILE}) not found."
50 echo "update your smage-tree and try it again."
51 echo
52 exit 1
53 fi
54
55 #starts package build
56 smage2 ${SMAGEFILE} || exit 1
57
58
59 # sometimes we only want to build a package with its dependencies
60 # but don't want to install it ... so it's decided here
61 # with a global variable NOINSTALL=true¦TRUE¦yes¦y
62 case ${NOINSTALL} in
63 TRUE|true|yes|y)
64 echo
65 echo "NOINSTALL=true; Package will not be installed ..."
66 echo
67 sleep 1
68 ;;
69 *)
70 #installs package
71 mage install ${MAGENAME} || exit 1
72 ;;
73 esac
74
75 #clean-up builddir
76 if [ -d ${BUILDDIR} ]
77 then
78 rm -rf ${BUILDDIR}/*
79 fi

Properties

Name Value
svn:executable *