#!/bin/sh -e

for patch in *.patch
do
  patch -p1 < "$patch"
done

sed -i                                     \
    -e "/^CFLAGS/s/=/= $CFLAGS -static/"   \
    -e "/^LDFLAGS/s/=/= $LDFLAGS -static/" \
    config.mk

make
make DESTDIR="$1" PREFIX=/usr install
