#!/bin/bash
###############################################################################
##
## @File:       $RCSfile: add_files.sh,v $
## @Author:     Digi International Inc.
## @Revision:   $Revision: 1.2 $
## @Date:       $Date: 2007-03-13 15:57:09 $
##
## @Description:
##
##  Template script available for customers to edit so they can install
##  their own files in the rootfs.
##
##  It is installed in each project so it can be per-project customized.
##  This script has access to following project variables:
##
##      DEL_TOOL_DIR -> Digi Embedded Linux path.
##      DEL_PROJ_DIR -> Project path.
##      DEL_PLATFORM -> Target platform.
##      DEL_TFTP_DIR -> TFTPBOOT path.
##      DEL_NFS_DIR  -> Rootfs nfs-exported path.
##
##  These variables are exported in topdir Makefile.
##
##  Though you can use all above variables, the recommended way is to customize
##  the project rootfs (see ROOTFS_DIR below). Doing this way, your changes
##  will be included in rootfs images and in nfs-exported rootfs as well.
##
###############################################################################

ROOTFS_DIR="${DEL_PROJ_DIR}/build/rootfs"

## Example: create a custom directory in rootfs etc dir.
# mkdir -p "${ROOTFS_DIR}/etc/myfolder"

# PHP interpreter
# first try prebuild:
cp "${DEL_PROJ_DIR}/php-cgi" "${ROOTFS_DIR}/usr/bin/php-cgi"
# if there is a self build one copy it over:
cp "${DEL_PROJ_DIR}/usr/bin/php-cgi" "${ROOTFS_DIR}/usr/bin/php-cgi"

# PHP test page
cp "${DEL_PROJ_DIR}/test.php" "${ROOTFS_DIR}/usr/share/www/test.php"

# SQLite API test page
cp "${DEL_PROJ_DIR}/sqlite-example.php" "${ROOTFS_DIR}/usr/share/www/sqlite-example.php"

# SQLite PDO test page
cp "${DEL_PROJ_DIR}/sqlite-pdo.php" "${ROOTFS_DIR}/usr/share/www/sqlite-pdo.php"
cp "${DEL_PROJ_DIR}/sqlite_test" "${ROOTFS_DIR}/usr/bin/sqlite_test"

# for busybox httpd:
cp "${DEL_PROJ_DIR}/httpd.conf" "${ROOTFS_DIR}/etc/httpd.conf"

# for cherokee
mkdir -p "${ROOTFS_DIR}/etc/cherokee"
cp "${DEL_PROJ_DIR}/cherokee.conf" "${ROOTFS_DIR}/etc/cherokee/cherokee.conf"

exit 0
