#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-sox
VERSION=12.17.6
ARCH=alpha
BUILD=1
TARGET=$ARCH-alphaslack-linux

( cd $TMP
tar xzf $CWD/sox-$VERSION.tar.gz
cd sox-$VERSION
./configure --prefix=/usr $TARGET
make
mkdir -p $PKG/usr/bin
cat src/play > $PKG/usr/bin/play
cat src/sox > $PKG/usr/bin/sox
cat src/soxmix > $PKG/usr/bin/soxmix
mkdir -p $PKG/usr/man/man1 $PKG/usr/man/man3
cat soxexam.1 |gzip -9c > $PKG/usr/man/man1/soxexam.1.gz
cat sox.1 |gzip -9c > $PKG/usr/man/man1/sox.1.gz
cat play.1 |gzip -9c > $PKG/usr/man/man1/play.1.gz
cat libst.3 |gzip -9c > $PKG/usr/man/man3/libst.3.gz
# ! absolute:
( cd $PKG
( cd usr/bin ; ln -sf play rec )
( cd usr/man/man1 ; ln -sf play.1.gz rec.1.gz )
( cd usr/man/man1 ; ln -sf sox.1.gz soxmix.1.gz )
)
mkdir -p $PKG/usr/doc/sox-$VERSION
cp -a Changelog Copyright INSTALL README TODO $PKG/usr/doc/sox-$VERSION
chown root.root $PKG/usr/doc/sox-$VERSION/*
chown root.root $PKG/usr/bin/*
chmod 644 $PKG/usr/doc/sox-$VERSION/*
chmod 755 $PKG/usr/bin/*
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n $TMP/sox-$VERSION-$ARCH-$BUILD.tgz
) 2>&1 | tee $TMP/sox.build.log
