Contents of /trunk/toolchain/toolchain-diffutils/toolchain-diffutils-2.8.4-r4.smage2
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 1944 byte(s)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 1944 byte(s)
new toolchain create utilities and smages
1 | # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-diffutils/toolchain-diffutils-2.8.4-r4.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ |
2 | |
3 | PNAME="toolchain-diffutils" |
4 | PVER="2.8.4" |
5 | PBUILD="r4" |
6 | |
7 | SRCFILE="diffutils-${PVER}.tar.gz" |
8 | SRCDIR="${BUILDDIR}/diffutils-${PVER}" |
9 | |
10 | SRC_URI=( |
11 | mirror://diffutils/${SRCFILE} |
12 | mirror://diffutils/diffutils-${PVER}-Makefile-fix-typeo.patch |
13 | mirror://diffutils/diffutils-${PVER}-sdiff-no-waitpid.patch |
14 | mirror://diffutils/diffutils-${PVER}-tabsize-dumps-core.diff |
15 | mirror://diffutils/diffutils-${PVER}-no-manpage.patch |
16 | ) |
17 | |
18 | # needs: to run: glibc |
19 | # build: sed, gettext, texinfo |
20 | |
21 | ## global toolchain var ## |
22 | # export CFLAGS, CHOST, TOOLCHAIN_PREFIX |
23 | export CFLAGS="-mtune=i486 -Os -pipe" |
24 | export CXXFLAGS="${CFLAGS}" |
25 | export TOOLCHAIN_PREFIX="/tools" |
26 | |
27 | zapmost() { |
28 | local rootdir |
29 | rootdir="${1}/" |
30 | [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 |
31 | install -d ${BUILDDIR}/zap |
32 | local dirs |
33 | shift |
34 | local x |
35 | for x in ${*} |
36 | do |
37 | if [ "${x##*/}" = "${x}" ] |
38 | then |
39 | #one deep |
40 | mv ${rootdir}${x} ${BUILDDIR}/zap |
41 | else |
42 | #more than one deep; create intermediate directories |
43 | dirs=${x%/*} |
44 | install -d ${BUILDDIR}/zap/${dirs} |
45 | mv ${rootdir}${x} ${BUILDDIR}/zap/${x} |
46 | fi |
47 | done |
48 | rm -rf ${rootdir}* |
49 | mv ${BUILDDIR}/zap/* ${rootdir} |
50 | } |
51 | |
52 | src_prepare() { |
53 | munpack ${SRCFILE} || die |
54 | cd ${SRCDIR} |
55 | |
56 | mpatch -Np1 diffutils-${PVER}-Makefile-fix-typeo.patch || die |
57 | mpatch -Np1 diffutils-${PVER}-sdiff-no-waitpid.patch || die |
58 | mpatch -Np1 diffutils-${PVER}-tabsize-dumps-core.diff || die |
59 | mpatch -Np1 diffutils-${PVER}-no-manpage.patch || die |
60 | } |
61 | |
62 | src_compile() { |
63 | cd ${SRCDIR} |
64 | |
65 | ./configure \ |
66 | --host=${CHOST} \ |
67 | --build=${CHOST} \ |
68 | --prefix=${TOOLCHAIN_PREFIX} \ |
69 | --disable-nls \ |
70 | || die |
71 | |
72 | mmake || die |
73 | } |
74 | |
75 | src_install() { |
76 | cd ${SRCDIR} |
77 | make DESTDIR=${BINDIR} install || die |
78 | |
79 | # remove unwanted stuff |
80 | KEEPFILES="bin" |
81 | zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die |
82 | } |