Magellan Linux

Contents of /trunk/toolchain/toolchain-gzip/toolchain-gzip-1.3.5-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Mon Jul 4 00:41:38 2005 UTC (18 years, 10 months ago) by niro
File size: 1543 byte(s)
new toolchain create utilities and smages

1 # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-gzip/toolchain-gzip-1.3.5-r4.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $
2
3 PNAME="toolchain-gzip"
4 PVER="1.3.5"
5 PBUILD="r4"
6
7 SRCFILE="gzip-${PVER}.tar.bz2"
8 SRCDIR="${BUILDDIR}/gzip-${PVER}"
9
10 SRC_URI=(
11 mirror://gzip/${SRCFILE}
12 )
13
14 ## global toolchain var ##
15 # export CFLAGS, CHOST, TOOLCHAIN_PREFIX
16 export CFLAGS="-mtune=i486 -Os -pipe"
17 export CXXFLAGS="${CFLAGS}"
18 export TOOLCHAIN_PREFIX="/tools"
19
20 zapmost() {
21 local rootdir
22 rootdir="${1}/"
23 [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1
24 install -d ${BUILDDIR}/zap
25 local dirs
26 shift
27 local x
28 for x in ${*}
29 do
30 if [ "${x##*/}" = "${x}" ]
31 then
32 #one deep
33 mv ${rootdir}${x} ${BUILDDIR}/zap
34 else
35 #more than one deep; create intermediate directories
36 dirs=${x%/*}
37 install -d ${BUILDDIR}/zap/${dirs}
38 mv ${rootdir}${x} ${BUILDDIR}/zap/${x}
39 fi
40 done
41 rm -rf ${rootdir}*
42 mv ${BUILDDIR}/zap/* ${rootdir}
43 }
44
45
46 src_prepare() {
47 munpack ${SRCFILE} || die
48 }
49
50 src_compile() {
51 cd ${SRCDIR}
52
53 ./configure \
54 --host=${CHOST} \
55 --prefix=${TOOLCHAIN_PREFIX} \
56 --disable-nls \
57 || die
58
59 # fix: gzexe program has the location of the gzip binary hard-wired into it
60 cp gzexe.in{,.backup} || die
61 sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in || die
62
63 mmake || die
64 }
65
66 src_install() {
67 cd ${SRCDIR}
68 make DESTDIR=${BINDIR} install || die
69
70 # remove unwanted stuff
71 KEEPFILES="bin/gunzip bin/gzip bin/zcaz bin/znew"
72 zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die
73 }