#!/bin/sh # ###################################################### # Build script for RPI # # # # See .info for details # # # # December 17, 2012 # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### SRCNAM=dropbear-2014.63.tar.bz2 WRKDIR=dropbear-2014.63 EXTNAM=dropbear TMPDIR=/tmp/dropbear ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR rm -r -f $TMPDIR-doc # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-Os -pipe -flto" export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -flto" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # Unpack source in current directory tar -xf $SRCNAM # Configure it cd $WRKDIR ./configure # Compile make PRGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 make PRGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 install # Delete compilation work directory cd .. rm -r -f $WRKDIR # Create temp install dir mkdir -p $TMPDIR/usr/local/bin mkdir -p $TMPDIR/usr/local/sbin mv /usr/local/bin/dropbearmulti $TMPDIR/usr/local/bin mkdir -p $TMPDIR/usr/local/etc/dropbear cp banner $TMPDIR/usr/local/etc/dropbear mkdir -p $TMPDIR/usr/local/etc/init.d cp dropbear $TMPDIR/usr/local/etc/init.d mkdir -p $TMPDIR/usr/local/share/man/man1 mkdir -p $TMPDIR/usr/local/share/man/man8 mv /usr/local/share/man/man1/dbclient.1 $TMPDIR/usr/local/share/man/man1 mv /usr/local/share/man/man1/dropbear* $TMPDIR/usr/local/share/man/man1 mv /usr/local/share/man/man8/dropbear.8 $TMPDIR/usr/local/share/man/man8 cd $TMPDIR/usr/local/sbin ln -s ../bin/dropbearmulti dropbear cd $TMPDIR/usr/local/bin ln -s dropbearmulti ssh ln -s dropbearmulti dropbearkey ln -s dropbearmulti dropbearconvert ln -s dropbearmulti dbclient # Adjust directory access rigths find $TMPDIR/ -type d | xargs chmod -v 755; # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded # Move files to doc extension mkdir -p $TMPDIR-doc/usr/local mv $TMPDIR/usr/local/share $TMPDIR-doc/usr/local ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR find usr -not -type d > $EXTNAM.tcz.list mv ../$EXTNAM.tcz . # Create md5 file md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create doc extension in temp dir # ################################################### cd $TMPDIR-doc cd .. mksquashfs $TMPDIR-doc $EXTNAM-doc.tcz cd $TMPDIR-doc find usr -not -type d > $EXTNAM-doc.tcz.list mv ../$EXTNAM-doc.tcz . # Create md5 file md5sum $EXTNAM-doc.tcz > $EXTNAM-doc.tcz.md5.txt # Cleanup temp directory rm -r -f usr