#!/bin/sh -e

./configure \
    --prefix=/usr

mv make.sh src
cd src
./make.sh ..

for i in *.so* *.a
do
    install -Dm644 $i "$1/usr/lib/"
done

cd ..

mv include "$1/usr/"

rm $(find "$1/usr/" -name 'Makefile.*')
