#!/bin/bash

PKG=/mnt/hda2/fakeroot/pkg

[ -d fakeroot-1.14.4 ] && rm -rf fakeroot-1.14.4
tar xvf fakeroot_1.14.4.orig.tar.xz
cd fakeroot-1.14.4

./configure --prefix=/usr/local
make
make DESTDIR="$PKG" install

cd "$PKG"

find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null


# Change the shebang in /usr/local/bin/fakeroot from /bin/bash to /bin/sh to drop bash dependency.
