Magellan Linux

Contents of /trunk/mlivecdbuild/files/mage-src/mage-0.3.6-r17.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102 - (show annotations) (download)
Fri Jul 1 17:24:33 2005 UTC (18 years, 10 months ago) by niro
File size: 2885 byte(s)
updated mage

1 # $Header: /home/cvsd/magellan-cvs/magellan-src/mlivecdbuild/files/mage-src/mage-0.3.6-r17.smage2,v 1.1 2005-07-01 17:24:11 niro Exp $
2
3 PNAME="mage"
4 PVER="0.3.6"
5 PBUILD="r17"
6
7 SRCFILE="${PNAME}-${PVER}.tar.bz2"
8 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
9
10 #avaible options are source/rsync/cvs
11 METHOD=cvs
12
13 src_prepare() {
14 if [ "${METHOD}" == "source" ]
15 then
16 munpack ${SRCFILE} || die
17 fi
18
19 if [ "${METHOD}" == "rsync" ]
20 then
21 mkdir -p ${SRCDIR} || die
22 rsync \
23 --recursive \
24 --links \
25 --perms \
26 --times \
27 --devices \
28 --timeout=600 \
29 --verbose \
30 --compress \
31 --progress \
32 --stats \
33 --delete \
34 --delete-after \
35 rsync://192.168.0.2/${PNAME}-${PVER}-${PBUILD} \
36 ${SRCDIR} || die
37 fi
38
39 if [ "${METHOD}" == "cvs" ]
40 then
41 local MY_CVS_OPTS
42 local MY_CVS_MODULE
43
44 MY_CVS_MODULE="magellan-src/mage"
45 # $PVER must be eg 0_3_3
46 MY_CVS_OPTS="-r mage-$(echo ${PVER}| sed -e "s|\.|\_|g")-${PBUILD}"
47
48 #cvs login
49 export CVSROOT=:pserver:anonymous:@192.168.0.2:/magellan-cvs
50 cvs login
51
52 [ ! -d "${SRCDIR}" ] && install -d ${SRCDIR}
53
54 #get all our modules or update them
55 if [ ! -d ${SRCDIR}/magellan-initscripts/CVS ]
56 then
57 (cd ${SRCDIR}; cvs -z3 checkout ${MY_CVS_OPTS} ${MY_CVS_MODULE})
58 else
59 (cd ${SRCDIR}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MY_CVS_MODULE})
60 fi
61
62 #correct permissions
63 find ${SRCDIR} -type f -exec chmod 0644 '{}' ';'
64 find ${SRCDIR} -type d -exec chmod 0755 '{}' ';'
65
66 #delete CVS directories
67 for file in $(find ${SRCDIR} -type d -name CVS)
68 do
69 rm -rf ${file}
70 done
71
72 #set correct SRCDIR
73 export SRCDIR="${SRCDIR}/${MY_CVS_MODULE}"
74 fi
75
76 cd ${SRCDIR}
77
78 #clean up backup files (foo~)
79 find ${SRCDIR} -name *~ -exec rm '{}' ';' || die
80 }
81
82 src_install() {
83 cd ${SRCDIR}
84
85 # needed directories
86 install -d ${BINDIR}/sbin || die
87
88 cp -aR ${SRCDIR}/* ${BINDIR} || die
89
90 # added :
91 # ldd-fix.sh
92 # find_not_installed.sh
93
94 #corrects file attributes
95 for i in env-rebuild.sh \
96 mage3.sh \
97 pkgbuild_dir.sh \
98 depwanderer.sh \
99 smage2.sh \
100 pkgsearch.sh \
101 compressdoc \
102 create_desktop_app.sh \
103 sourceinstall.sh \
104 mkinfodir \
105 etc-update \
106 writeprotected \
107 magequery.sh \
108 mageupgrade.sh \
109 mgroupadd \
110 mgroupdel \
111 museradd \
112 muserdel \
113 ldd-fix.sh \
114 find_not_installed.sh
115 do
116 chown root:root ${BINDIR}/usr/lib/mage/${i} || die
117 chmod 0755 ${BINDIR}/usr/lib/mage/${i} || die
118 done
119
120 #some needed symlinks
121 ln -snf /usr/lib/mage/mage3.sh ${BINDIR}/sbin/mage || die
122 ln -snf /usr/lib/mage/smage2.sh ${BINDIR}/sbin/smage2 || die
123 ln -snf /usr/lib/mage/env-rebuild.sh ${BINDIR}/sbin/env-rebuild || die
124 ln -snf /usr/lib/mage/compressdoc ${BINDIR}/sbin/compressdoc || die
125 ln -snf /usr/lib/mage/etc-update ${BINDIR}/sbin/etc-update || die
126 ln -snf /usr/lib/mage/magequery.sh ${BINDIR}/sbin/magequery || die
127 ln -snf /usr/lib/mage/mageupgrade.sh ${BINDIR}/sbin/mageupgrade || die
128 }