#!/bin/bash ###################################################### # freebasic compiler lzm package for SLAX 6 # # # # Packed by Arnel A. Borja, galeon@ymail.com # # # # Package home http://freebasic.net # # # # November 27, 2010 # ###################################################### ###################################################### # NOTE: # # * This script requires the freebasic module # # * This script requires the FreeBASIC source in # # the current directory, automatically downloaded # # otherwise # # * This script requires the tarball of a compiled # # standalone FreeBASIC Compiler, automatically # # downloaded otherwise # ###################################################### ### Set up Variables ### VERSION=0.21.1 SRCNAM=FreeBASIC-$VERSION-source.tar.lzma WRKDIR=FreeBASIC-$VERSION-source MODNAM=freebasic-standalone-$VERSION TMPDIR=/tmp/freebasic BINSRCVERSION=0.20.0 BINSRCNAM=FreeBASIC-v$BINSRCVERSION\b-linux-standalone.tar.gz BINSRCDIR=FreeBASIC ### Compile for SLAX ### rm -rf $TMPDIR rm -rf $WRKDIR rm -rf $BINSRCDIR wget -N http://nchc.dl.sourceforge.net/project/fbc/Source%20Code/FreeBASIC%20$VERSION/$SRCNAM tar -xf $SRCNAM cd $WRKDIR cd src/rtlib/obj/linux CFLAGS="-O3 -march=i486 -mtune=i686" ../../configure --prefix=/usr --build=i486-Slackware-linux make make MULTITHREADED=1 make install cd ../../../gfxlib2/obj/linux CFLAGS="-O3 -march=i486 -mtune=i686" ../../configure --prefix=/usr --build=i486-Slackware-linux make make install cd ../../../compiler/obj/linux CFLAGS="-O3 -march=i486 -mtune=i686" ../../configure --prefix=/usr --build=i486-Slackware-linux --enable-standalone make make install cd ../../../.. mkdir $TMPDIR mkdir $TMPDIR/usr mkdir $TMPDIR/usr/bin mkdir $TMPDIR/usr/man mkdir $TMPDIR/usr/man/man1 mkdir $TMPDIR/usr/share cd .. wget -N http://nchc.dl.sourceforge.net/project/fbc/Binaries%20-%20Linux/FreeBASIC%20$BINSRCVERSION/$BINSRCNAM tar -xf $BINSRCNAM cp $BINSRCDIR/bin/linux/ar $WRKDIR/bin/linux/ cp $BINSRCDIR/bin/linux/as $WRKDIR/bin/linux/ cp $BINSRCDIR/bin/linux/gprof $WRKDIR/bin/linux/ cp $BINSRCDIR/bin/linux/ld $WRKDIR/bin/linux/ cp $BINSRCDIR/lib/linux/crt1.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/crtbegin.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/crtend.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/crti.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/crtn.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/gcrt1.o $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/libbfd.a $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/libgcc.a $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/libgcc_eh.a $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/libiberty.a $WRKDIR/lib/linux/ cp $BINSRCDIR/lib/linux/libsupc++.a $WRKDIR/lib/linux/ cd $WRKDIR sed -e 's/link="\/usr\/bin"/link="\/tmp\/freebasic\/usr\/bin"/' \ -e 's/$dest\/fbc -prefix $dest/\/usr\/share\/freebasic\/fbc -prefix \/usr\/share\/freebasic/' \ -i install-standalone.sh ./install-standalone.sh -i $TMPDIR/usr/share cd .. ### Remove unneeded files ### rm -rf $TMPDIR/usr/share/freebasic/inc/dos rm -rf $TMPDIR/usr/share/freebasic/inc/win rm -f $TMPDIR/usr/share/freebasic/inc/windows.bi # Seems like examples are not installed in standalone #rm -rf $TMPDIR/usr/share/freebasic/examples/DOS #rm -rf $TMPDIR/usr/share/freebasic/examples/Windows ### Copy SLAX files to the package ### mkdir -p $TMPDIR/usr/src/slaxbuilds cp $0 $TMPDIR/usr/src/slaxbuilds ### Adjust Directory Access Rights ### find $TMPDIR/ -type d | xargs chmod -v 755; ### Uncompress man pages ### find $TMPDIR/usr/man/ -type l -name "*.gz" | xargs -r gunzip -f find $TMPDIR/usr/man ! -type l -name "*.gz" | xargs -r gunzip dir2lzm $TMPDIR $MODNAM.lzm ### House keeping ### rm -rf $BINSRCDIR rm -rf $WRKDIR rm -rf $TMPDIR # EOF