#!/bin/bash # GPH SDK mini installer by gammy # WARNING: This code is horribly deprecated and should not be used # (signed 071029) DOWNLOAD="gp2x_gph/" FTPADDR="ftp.gp32spain.com" FTPUSER="public_ftp%40gp32spain.com" FTPPASS="publico" FTPPATH="/Programacion/GP2X" echo "GPH SDK Mini installer" echo if [ $UID != 0 ]; then echo "I need root access to insall!" echo "Exiting." exit fi FAILED=0 mkdir "$DOWNLOAD" >/dev/null 2>&1 && cd "$DOWNLOAD" || FAILED=1 if [ $FAILED -eq 1 ]; then echo "Failed to create \"$DOWNLOAD\"" exit fi echo "Getting packages..." # Get wget -t 3 "http://members.ii.net/~bmccarthy/linux-mmsp2-headers.tar.bz2" || exit wget -t 3 --passive-ftp "ftp://$FTPUSER:$FTPPASS@$FTPADDR$FTPPATH/arm-tools.tar.gz" || exit wget -t 3 --passive-ftp "ftp://$FTPUSER:$FTPPASS@$FTPADDR$FTPPATH/library.tar.gz" || exit wget -t 3 --passive-ftp "ftp://$FTPUSER:$FTPPASS@$FTPADDR$FTPPATH/doc.zip" || exit # Decompress echo "Decompresing packages (Ignore warnings)..." tar zxf arm-tools.tar.gz tar zxf library.tar.gz tar xjf linux-mmsp2-headers.tar.bz2 unzip doc.zip # Install echo "Removing /usr/local/arm-dev/..." rm -rf /usr/local/arm-dev/ >/dev/null 2>&1 echo "Installing packages..." cp -r arm-dev/ /usr/local/ rm /usr/local/arm-dev/arm-linux/include/asm rm /usr/local/arm-dev/arm-linux/include/linux cp -r library/image/ /usr/local/arm-dev/arm-linux/usr/ || exit cp -r linux-mmsp2-headers/* /usr/local/arm-dev/arm-linux/include/ || exit echo "Modifying arm-linux-sdl-config..." cat /usr/local/arm-dev/arm-linux/usr/bin/arm-linux-sdl-config | sed -e s/\\/home\\/depss\\/DEPSS\\/library\\/image/\\/usr\\/local\\/arm-dev\\/arm-linux\\/usr/ > .tmp mv .tmp /usr/local/arm-dev/arm-linux/usr/bin/arm-linux-sdl-config cp /usr/local/arm-dev/arm-linux/usr/bin/arm-linux-sdl-config /usr/local/arm-dev/bin/ chmod +x /usr/local/arm-dev/bin/* echo "Modifying all .la files..." for a in `ls /usr/local/arm-dev/arm-linux/usr/lib/*.la`; do cat $a | sed -e s/\\/home\\/depss\\/DEPSS\\/library\\/image/\\/usr\\/local\\/arm-dev\\/arm-linux\\/usr/ > .tmp mv .tmp $a done echo "Cleaning up..." rm -rf arm-dev/ library/ linux-mmsp2-headers/ *.tar *.zip *.tar.bz2 .tmp #rm -rf arm-dev/ library/ linux-mmsp2-headers/ echo echo echo "Compiler : arm-linux-gcc" echo "sdl-donfig : arm-linux-sdl-config" echo "autoconf opt: --host arm-linux" echo "Path : /usr/local/arm-dev/bin/" echo "All done."