#!/bin/sh

SRCNAM=brasero-2.29.4.tar.bz2
WRKDIR=brasero-2.29.4
TMPDIR=/tmp/brasero

rm -r -f $WRKDIR

rm -r -f $TMPDIR

mkdir -p $TMPDIR

export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

tar -xf $SRCNAM

cd $WRKDIR

# brasero forbids symlinks to applications
# to avoid this i have removed symlink test code for applications
patch libbrasero-burn/burn-plugin.c ../patch.symlink

# dvd+rw-format version check fix
patch plugins/growisofs/burn-dvd-rw-format.c ../patch.dvdrwformat

./configure --prefix=/usr/local --disable-scrollkeeper

make

make install DESTDIR=$TMPDIR

cd ..

rm -r -f $WRKDIR

find $TMPDIR/ -type d | xargs chmod -v 755

cd $TMPDIR

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
