-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-cd unix
-./configure --prefix=/usr \
- --enable-threads \
- --mandir=/usr/share/man
-make
-
-# removes the references to the build directory and replaces them with saner
-# system-wide locations:
-sed -i \
- -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
- -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
- -e "/SEARCH/s/=.*/=''/" \
- tclConfig.sh
-
-make install
-make install-private-headers
-
-PKG_VER_BASE=$(echo ${PACKAGE} | sed "s!^tcl\([0-9]*\.[0-9]*\).*!\1!g")
-
-ln -svfT tclsh${PKG_VER_BASE} /usr/bin/tclsh
-
-exit $?
+#!/bin/bash
+
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}/unix
+ ./configure \
+ --prefix=/usr \
+ --enable-threads \
+ --mandir=/usr/share/man
+}
+
+hvbuild()
+{
+ make
+
+ # Removes references to the build directory and replaces them with saner
+ # system-wide locations:
+ sed -i \
+ -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
+ -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
+ -e "/SEARCH/s/=.*/=''/" \
+ tclConfig.sh
+
+ make install
+}
+
+hvbuild_post()
+{
+ make install-private-headers
+
+ # Special case for TCL
+ PKG_VER_BASE=$(echo ${PACKAGE} | sed "s!^tcl\([0-9]*\.[0-9]*\).*!\1!g")
+
+ ln -svfT tclsh${PKG_VER_BASE} /usr/bin/tclsh
+}