1 | #!/bin/bash |
---|
2 | |
---|
3 | BASE=/tmp |
---|
4 | PREFIX=$BASE/mpone |
---|
5 | ALT_PREFIX=$BASE/mptwo |
---|
6 | DISTFILES_DIR=$BASE/mpdistfiles |
---|
7 | PORTFILES_DIR=$BASE/mpdports |
---|
8 | SOURCE_DIR=$BASE/mpbase |
---|
9 | |
---|
10 | if [ -z "$1" ]; then |
---|
11 | REV="HEAD" |
---|
12 | else |
---|
13 | REV="$1" |
---|
14 | fi |
---|
15 | |
---|
16 | ZLIB_REV=53368 |
---|
17 | |
---|
18 | if [ ! -d $SOURCE_DIR ]; then |
---|
19 | mkdir -p $SOURCE_DIR |
---|
20 | svn co -r $REV http://svn.macosforge.org/repository/macports/trunk/base $SOURCE_DIR || exit $? |
---|
21 | else |
---|
22 | svn up -r $REV $SOURCE_DIR || exit $? |
---|
23 | fi |
---|
24 | if [ ! -d $PORTFILES_DIR ]; then |
---|
25 | mkdir -p $PORTFILES_DIR |
---|
26 | svn co -r $ZLIB_REV -N http://svn.macosforge.org/repository/macports/trunk/dports $PORTFILES_DIR || exit $? |
---|
27 | svn up -r $ZLIB_REV -N $PORTFILES_DIR/archivers || exit $? |
---|
28 | svn up -r $ZLIB_REV $PORTFILES_DIR/archivers/zlib || exit $? |
---|
29 | fi |
---|
30 | if [ ! -d $PREFIX/var/macports/distfiles ]; then |
---|
31 | mkdir -p $DISTFILES_DIR $PREFIX/var/macports |
---|
32 | ln -s $DISTFILES_DIR $PREFIX/var/macports/distfiles || exit $? |
---|
33 | fi |
---|
34 | |
---|
35 | export PATH="/bin:/sbin:/usr/bin:/usr/sbin" |
---|
36 | |
---|
37 | export GREP_OPTIONS="" |
---|
38 | |
---|
39 | cd $SOURCE_DIR |
---|
40 | |
---|
41 | ./configure \ |
---|
42 | --prefix=$PREFIX \ |
---|
43 | --with-tclpackage=$PREFIX/Library/Tcl \ |
---|
44 | --with-applications-dir=$PREFIX/Applications \ |
---|
45 | --with-frameworks-dir=$PREFIX/Library/Frameworks \ |
---|
46 | --enable-readline || exit $? |
---|
47 | |
---|
48 | make || exit $? |
---|
49 | |
---|
50 | make install || exit $? |
---|
51 | |
---|
52 | make distclean || exit $? |
---|
53 | |
---|
54 | sed s%^rsync://rsync.macports.org/release/ports/%file://$PORTFILES_DIR% < "$PREFIX/etc/macports/sources.conf" > "$PREFIX/etc/macports/sources.conf.tmp" |
---|
55 | mv "$PREFIX/etc/macports/sources.conf.tmp" "$PREFIX/etc/macports/sources.conf" |
---|
56 | |
---|
57 | mv "$PREFIX" "$ALT_PREFIX" || exit $? |
---|
58 | ln -s "$ALT_PREFIX" "$PREFIX" || exit $? |
---|
59 | |
---|
60 | "$PREFIX/bin/port" install zlib |
---|
61 | "$PREFIX/bin/port" -d deactivate zlib |
---|
62 | |
---|
63 | EXIT=0 |
---|
64 | if [ -d "$PREFIX" ]; then |
---|
65 | echo "Bug absent in base rev $REV: $PREFIX exists" |
---|
66 | else |
---|
67 | echo "Bug present in base rev $REV: $PREFIX is gone" |
---|
68 | EXIT=1 |
---|
69 | fi |
---|
70 | |
---|
71 | rm -rf "$PREFIX" "$ALT_PREFIX" |
---|
72 | |
---|
73 | exit $EXIT |
---|
74 | |
---|