#!/bin/sh # ###################################################### # Build script for RPI # # # # See .info for details # # # # December 30, 2012 # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### SRCNAM=git-1.8.5.1.tar.gz WRKDIR=git-1.8.5.1 EXTNAM=git TMPDIR=/tmp/git ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR rm -r -f $TMPDIR-locale rm -r -f $TMPDIR-perl rm -r -f $TMPDIR-python rm -r -f $TMPDIR-gui rm -r -f $TMPDIR-web # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-Os -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard" export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -march=armv6 -mfpu=vfp -mfloat-abi=hard" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # Unpack source in current directory tar -xf $SRCNAM # Configure it cd $WRKDIR ./configure --prefix=/usr/local # Compile make # Install in base temp dir make install DESTDIR=$TMPDIR # Delete compilation work directory cd .. rm -r -f $WRKDIR # 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 locale extension mkdir -p $TMPDIR-locale/usr/local/share mv $TMPDIR/usr/local/share/locale $TMPDIR-locale/usr/local/share # Move files to python extension mkdir -p $TMPDIR-python/usr/local/lib mv $TMPDIR/usr/local/lib/python2.7 $TMPDIR-python/usr/local/lib rm -f $TMPDIR-python/usr/local/lib/python2.7/site-packages/git_remote_helpers/*.pyc rm -f $TMPDIR-python/usr/local/lib/python2.7/site-packages/git_remote_helpers/git/*.pyc # Move files to perl extension mkdir -p $TMPDIR-perl/usr/local mv $TMPDIR/usr/local/lib $TMPDIR-perl/usr/local # Move files to web extension mkdir -p $TMPDIR-web/usr/local/share mv $TMPDIR/usr/local/share/gitweb $TMPDIR-web/usr/local/share # Move files to git-gui extension mkdir -p $TMPDIR-gui/usr/local/share mkdir -p $TMPDIR-gui/usr/local/bin mv $TMPDIR/usr/local/share/git-gui $TMPDIR-gui/usr/local/share mv $TMPDIR/usr/local/share/gitk $TMPDIR-gui/usr/local/share mv $TMPDIR/usr/local/bin/gitk $TMPDIR-gui/usr/local/bin ################################################### # 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 locale extension in temp dir # ################################################### cd $TMPDIR-locale cd .. mksquashfs $TMPDIR-locale $EXTNAM-locale.tcz cd $TMPDIR-locale find usr -not -type d > $EXTNAM-locale.tcz.list mv ../$EXTNAM-locale.tcz . # Create md5 file md5sum $EXTNAM-locale.tcz > $EXTNAM-locale.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create python extension in temp dir # ################################################### cd $TMPDIR-python cd .. mksquashfs $TMPDIR-python python-git.tcz cd $TMPDIR-python find usr -not -type d > python-git.tcz.list mv ../python-git.tcz . # Create md5 file md5sum python-git.tcz > python-git.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create perl extension in temp dir # ################################################### cd $TMPDIR-perl cd .. mksquashfs $TMPDIR-perl perl_git.tcz cd $TMPDIR-perl find usr -not -type d > perl_git.tcz.list mv ../perl_git.tcz . # Create md5 file md5sum perl_git.tcz > perl_git.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create web extension in temp dir # ################################################### cd $TMPDIR-web cd .. mksquashfs $TMPDIR-web $EXTNAM-web.tcz cd $TMPDIR-web find usr -not -type d > $EXTNAM-web.tcz.list mv ../$EXTNAM-web.tcz . # Create md5 file md5sum $EXTNAM-web.tcz > $EXTNAM-web.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create gui extension in temp dir # ################################################### cd $TMPDIR-gui cd .. mksquashfs $TMPDIR-gui $EXTNAM-gui.tcz cd $TMPDIR-gui find usr -not -type d > $EXTNAM-gui.tcz.list mv ../$EXTNAM-gui.tcz . # Create md5 file md5sum $EXTNAM-gui.tcz > $EXTNAM-gui.tcz.md5.txt # Cleanup temp directory rm -r -f usr