#!/bin/sh

. config/options

$SCRIPTS/install atk
$SCRIPTS/install tiff
$SCRIPTS/install jpeg
$SCRIPTS/install  libpng
$SCRIPTS/install libX11
$SCRIPTS/install libXrandr
$SCRIPTS/install glib
$SCRIPTS/install pango
$SCRIPTS/install cairo

GTK_BINARY_VERSION=`pkg-config gtk+-2.0 --variable=gtk_binary_version`
GTK_LIB_DIR="gtk-2.0/$GTK_BINARY_VERSION"
PKG_DIR=`find $PACKAGES -type d -name $1`

mkdir -p $INSTALL/usr/lib
cp -PR $PKG_BUILD/contrib/gdk-pixbuf-xlib/.libs/libgdk_pixbuf_xlib*.so* $INSTALL/usr/lib
cp -PR $PKG_BUILD/gdk-pixbuf/.libs/libgdk_pixbuf*.so* $INSTALL/usr/lib
cp -PR $PKG_BUILD/gdk/.libs/*.so* $INSTALL/usr/lib
rm -rf $INSTALL/usr/lib/libgdk*.so*T
cp -PR $PKG_BUILD/gtk/.libs/*.so* $INSTALL/usr/lib
rm -rf $INSTALL/usr/lib/libgtk*.so*T

mkdir -p $INSTALL/usr/lib/$GTK_LIB_DIR/engines
cp -PR $PKG_BUILD/modules/engines/pixbuf/.libs/*.so \
    $INSTALL/usr/lib/$GTK_LIB_DIR/engines
mkdir -p $INSTALL/usr/lib/$GTK_LIB_DIR/immodules
cp -PR $PKG_BUILD/modules/input/.libs/*.so \
    $INSTALL/usr/lib/$GTK_LIB_DIR/immodules
mkdir -p $INSTALL/usr/lib/$GTK_LIB_DIR/printbackends
cp -PR $PKG_BUILD/modules/printbackends/*/.libs/*.so \
    $INSTALL/usr/lib/$GTK_LIB_DIR/printbackends
mkdir -p $INSTALL/usr/lib/$GTK_LIB_DIR/loaders
cp -PR $PKG_BUILD/gdk-pixbuf/.libs/libpixbufloader*.so \
    $INSTALL/usr/lib/$GTK_LIB_DIR/loaders

mkdir -p $INSTALL/etc/gtk-2.0
cp -PR $PKG_BUILD/modules/input/im-multipress.conf \
    $INSTALL/etc/gtk-2.0
#cp -PR $PKG_DIR/config/gdk-pixbuf.loaders \
#    $INSTALL/etc/gtk-2.0

mkdir -p $INSTALL/usr/bin
cp -PR $PKG_BUILD/gtk/.libs/gtk-query-immodules-2.0 $INSTALL/usr/bin
cp -PR $PKG_BUILD/gdk-pixbuf/.libs/gdk-pixbuf-query-loaders $INSTALL/usr/bin