#!/bin/bash # # fftw.SlackBuild # code: Vicious (michal@scxd.info); improvements: Zielony (e-pl@o2.pl) set -e # PACKAGE GENERAL INFO [EDIT] PKGNAME=fftw VERSION=3.1.2 BUILD=1X ARCH=i686 URL=http://www.fftw.org/fftw-$VERSION.tar.gz CWD=`pwd` TMP=/tmp/$PKGNAME if [ -e $TMP/$PKGNAME-$VERSION/'Makefile' ]; then cd $TMP/$PKGNAME-$VERSION make else if [ ! -d $TMP/$PKGNAME-$VERSION ]; then rm -rf $TMP/package mkdir -p $TMP $TMP/package $TMP/package/install # PACKAGE DESCRIPTION [ EDIT] cat << SLACKDESC > $TMP/package/install/slack-desc |-----handy-ruler------------------------------------------------------| $PKGNAME: FFTW (Fastest Fourier Transform in the West) $PKGNAME: $PKGNAME: FFTW is a C subroutine library for computing the discrete Fourier $PKGNAME: transform (DFT) in one or more dimensions, of arbitrary input size, $PKGNAME: and of both real and complex data (as well as of even/odd data, i.e. $PKGNAME: the discrete cosine/sine transforms or DCT/DST). We believe that $PKGNAME: FFTW, which is free software, should become the FFT library of choice $PKGNAME: for most applications. $PKGNAME: $PKGNAME: Package prepared by Zielony (e-pl@o2.pl) SLACKDESC cd $TMP # step 1 : DOWNLOAD SOURCE PKGFNAME=`ls -t | grep -i $PKGNAME*.t*z* | head -1` if [ -z $PKGFNAME ]; then ( wget -c $URL -P $TMP ) # step 2 : UNPACK SOURCE AND COMPILE PKGFNAME=`ls -t | grep -i $PKGNAME*.t*z* | head -1` fi EXTENSION=`echo ${PKGFNAME//*.}` if [ $EXTENSION = "bz2" ]; then tar jxvf $PKGFNAME -C $TMP else tar xfz $PKGFNAME -C $TMP fi DIRNAME=`tar tf $PKGFNAME | head -1` if [ $DIRNAME != $PKGNAME-$VERSION/ ]; then mv $DIRNAME $PKGNAME-$VERSION; fi chown root:root $TMP -R fi cd $TMP/$PKGNAME-$VERSION if [ -s 'configure' ]; then CFLAGS=${CFLAGS:--O2 -march=i686 -mcpu=i686} ./configure \ --prefix=/usr \ --enable-static \ --disable-debug \ --mandir=/usr/man \ --sysconfdir=/etc fi make fi make install DESTDIR=$TMP/package # step 3 : STRIP BINARIES && GZIP MANUALS ( cd $TMP/package find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) ( gzip $TMP/package/usr/man/man?/* ) # step 4 : CREATE PACKAGE && CLEAN TMP cd $TMP/package if [ `ls | wc -m` -le 8 ]; then echo "Brak plików pakietu!" else makepkg -l y -c n $CWD/$PKGNAME-$VERSION-$ARCH-$BUILD.tgz rm -rf $TMP fi