#!/bin/sh

. config/options $1

PYTHON_VERSION=2.6
PYTHON_LIB_DIR=$INSTALL/usr/lib/python$PYTHON_VERSION

mkdir -p $INSTALL/usr/bin
  cp $PKG_BUILD/.objdir-target/python $INSTALL/usr/bin/

mkdir -p $INSTALL/usr/lib
  cp -PR $PKG_BUILD/.objdir-target/libpython2.6.so.1.0 $INSTALL/usr/lib/
  ln -sf libpython2.6.so.1.0 $INSTALL/usr/lib/libpython2.6.so

mkdir -p $PYTHON_LIB_DIR/lib-dynload
  cp $PKG_BUILD/.objdir-target/build/lib*/*.so $PYTHON_LIB_DIR/lib-dynload

  cp $PKG_BUILD/.objdir-target/Lib/*.pyc $PYTHON_LIB_DIR
  cp $PKG_BUILD/.objdir-target/Lib/site.py $PYTHON_LIB_DIR
  cp $PKG_BUILD/.objdir-target/Lib/doctest.py $PYTHON_LIB_DIR
  cp $PKG_BUILD/.objdir-target/Lib/unittest.py $PYTHON_LIB_DIR

mkdir -p $PYTHON_LIB_DIR/plat-linux2
  cp $PKG_BUILD/.objdir-target/Lib/plat-linux2/* $PYTHON_LIB_DIR/plat-linux2

mkdir -p $PYTHON_LIB_DIR/json
  cp $PKG_BUILD/.objdir-target/Lib/json/*.pyc $PYTHON_LIB_DIR/json

mkdir -p $PYTHON_LIB_DIR/xml
  cp $PKG_BUILD/.objdir-target/Lib/xml/*.pyc $PYTHON_LIB_DIR/xml

mkdir -p $PYTHON_LIB_DIR/xml/dom
  cp $PKG_BUILD/.objdir-target/Lib/xml/dom/*.pyc $PYTHON_LIB_DIR/xml/dom

mkdir -p $PYTHON_LIB_DIR/xml/parsers
  cp $PKG_BUILD/.objdir-target/Lib/xml/parsers/*.pyc $PYTHON_LIB_DIR/xml/parsers

mkdir -p $PYTHON_LIB_DIR/xml/sax
  cp $PKG_BUILD/.objdir-target/Lib/xml/sax/*.pyc $PYTHON_LIB_DIR/xml/sax

mkdir -p $PYTHON_LIB_DIR/encodings
  cp $PKG_BUILD/.objdir-target/Lib/encodings/*.pyc $PYTHON_LIB_DIR/encodings

mkdir -p $PYTHON_LIB_DIR/logging
  cp $PKG_BUILD/.objdir-target/Lib/logging/*.pyc $PYTHON_LIB_DIR/logging

mkdir -p $PYTHON_LIB_DIR/distutils
  cp $PKG_BUILD/.objdir-target/Lib/distutils/*.pyc $PYTHON_LIB_DIR/distutils

mkdir -p $PYTHON_LIB_DIR/distutils/command
  cp $PKG_BUILD/.objdir-target/Lib/distutils/command/*.pyc $PYTHON_LIB_DIR/distutils/command

# For future 3rd-parties Python modules
mkdir -p $PYTHON_LIB_DIR/site-packages

### for test ###

#mkdir -p $PYTHON_LIB_DIR/bsddb
#  cp $PKG_BUILD/.objdir-target/Lib/bsddb/*.pyc $PYTHON_LIB_DIR/bsddb

mkdir -p $PYTHON_LIB_DIR/compiler
  cp $PKG_BUILD/.objdir-target/Lib/compiler/*.pyc $PYTHON_LIB_DIR/compiler

mkdir -p $PYTHON_LIB_DIR/ctypes
  cp $PKG_BUILD/.objdir-target/Lib/ctypes/*.pyc $PYTHON_LIB_DIR/ctypes

mkdir -p $PYTHON_LIB_DIR/ctypes/macholib
  cp $PKG_BUILD/.objdir-target/Lib/ctypes/macholib/*.pyc $PYTHON_LIB_DIR/ctypes/macholib

#mkdir -p $PYTHON_LIB_DIR/curses
#  cp $PKG_BUILD/.objdir-target/Lib/curses/*.pyc $PYTHON_LIB_DIR/curses

mkdir -p $PYTHON_LIB_DIR/email
  cp $PKG_BUILD/.objdir-target/Lib/email/*.pyc $PYTHON_LIB_DIR/email

mkdir -p $PYTHON_LIB_DIR/email/mime
  cp $PKG_BUILD/.objdir-target/Lib/email/mime/*.pyc $PYTHON_LIB_DIR/email/mime

mkdir -p $PYTHON_LIB_DIR/hotshot
  cp $PKG_BUILD/.objdir-target/Lib/hotshot/*.pyc $PYTHON_LIB_DIR/hotshot

mkdir -p $PYTHON_LIB_DIR/idlelib
  cp $PKG_BUILD/.objdir-target/Lib/idlelib/*.pyc $PYTHON_LIB_DIR/idlelib

#mkdir -p $PYTHON_LIB_DIR/lib-tk
#  cp $PKG_BUILD/.objdir-target/Lib/lib-tk/*.pyc $PYTHON_LIB_DIR/lib-tk

#mkdir -p $PYTHON_LIB_DIR/msilib
#  cp $PKG_BUILD/.objdir-target/Lib/msilib/*.pyc $PYTHON_LIB_DIR/msilib

mkdir -p $PYTHON_LIB_DIR/multiprocessing
  cp $PKG_BUILD/.objdir-target/Lib/multiprocessing/*.pyc $PYTHON_LIB_DIR/multiprocessing

# not needed, we have pysqlite2
mkdir -p $PYTHON_LIB_DIR/sqlite3
  cp $PKG_BUILD/.objdir-target/Lib/sqlite3/*.pyc $PYTHON_LIB_DIR/sqlite3

#mkdir -p $PYTHON_LIB_DIR/wsgiref
#  cp $PKG_BUILD/.objdir-target/Lib/wsgiref/*.pyc $PYTHON_LIB_DIR/wsgiref

mkdir -p $PYTHON_LIB_DIR/xml/etree
  cp $PKG_BUILD/.objdir-target/Lib/xml/etree/*.pyc $PYTHON_LIB_DIR/xml/etree