view images/static-tools/build.sh @ 29:f3e1afd794a5

The zlib developers remove each old version as the new one as released, to discourage people from using it (I.E. zlib). Remind me to copy the mirroring architecture into the control image shared infrastructure.
author Rob Landley <rob@landley.net>
date Sun, 10 Jun 2012 20:30:25 -0500
parents 3dadeb04a403
children 488f0a1ac475
line wrap: on
line source

#!/bin/bash

# Download all the source tarballs we haven't got up-to-date copies of.

# The tarballs are downloaded into the "packages" directory, which is
# created as needed.

EXTRACT_ALL=1

echo "=== Download source code."

# Note: set SHA1= blank to skip checksum validation.

URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \
SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \
maybe_fork download || dienow

URL=http://zlib.net/zlib-1.2.7.tar.bz2 \
SHA1=858818fe6d358ec682d54ac5e106a2dd62628e7f \
maybe_fork "download || dienow"

URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-2012.55.tar.bz2
SHA1=261d033c28031faa34b92390ad5278feb20c6efc \
maybe_fork download || dienow

#URL=http://kernel.org/pub/software/utils/pciutils/pciutils-3.1.7.tar.bz2 \
#SHA1= \
#maybe_fork download || dienow

echo === Got all source.

cleanup_oldfiles

cat > "$WORK"/init << 'EOF' || dienow
#!/bin/bash

upload_result()
{
  ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1"
}

echo Started second stage init

echo === Native build static zlib

cp -sfR /mnt/zlib zlib &&
cd zlib &&
# 
rm -f Makefile zconf.h &&
./configure &&
make -j $CPUS &&
cd .. || exit 1

echo === $HOST Native build static dropbear

cp -sfR /mnt/dropbear dropbear &&
cd dropbear &&
CFLAGS="-I ../zlib -Os" LDFLAGS="--static -L ../zlib" ./configure &&
sed -i 's@/usr/bin/dbclient@ssh@' options.h &&
make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 &&
strip dropbearmulti &&
upload_result dropbearmulti &&
cd .. &&
rm -rf dropbear || exit 1

echo === $HOST native build static strace

cp -sfR /mnt/strace strace &&
cd strace &&
CFLAGS="--static -Os" ./configure &&
make -j $CPUS &&
strip strace &&
upload_result strace &&
cd .. &&
rm -rf strace || dienow

echo === $HOST native build rsync

sync

EOF

chmod +x "$WORK"/init || dienow