#!/bin/sh

. common.sh

cd ${ZIPSPEAK_BUILD_ROOT}
mkdir -p loadspk/usr/{bin,doc/loadspk}
LOADSPK_ROOT=`pwd`/loadspk
rm -rf load_spk-${LOADSPK_VERSION}
tar zxf ${ZIPSPEAK_SOURCE_DIR}/load_spk-${LOADSPK_VERSION}.tar.gz
cd load_spk-${LOADSPK_VERSION}
LDFLAGS=-s ./configure --prefix=/usr
make install DESTDIR=${LOADSPK_ROOT}
cp -R README* examples ${LOADSPK_ROOT}/usr/doc/loadspk
cd ${LOADSPK_ROOT}
chown -R root.root .
chown -R root.bin usr/bin
rm -rf usr/doc/loadspk/examples/CVS
makepkg ${ZIPSPEAK_PACKAGE_DIR}/loadspk.tgz
cp ${ZIPSPEAK_PACKAGE_DIR}/loadspk.tgz ${ZIPSPEAK_STAGE_ROOT}/tmp
chroot ${ZIPSPEAK_STAGE_ROOT} installpkg /tmp/loadspk.tgz
rm ${ZIPSPEAK_STAGE_ROOT}/tmp/loadspk.tgz
