#!/usr/bin/env modbuild

pbuild::set_download_url ftp://ftp.tcl.tk/pub/tcl/tcl8_6/tk$V-src.tar.gz"

# use system's cc
declare CC=cc

pbuild::add_to_group 'Programming'
pbuild::install_docfiles 'license.terms' 'README'

pbuild::configure() {
	case ${OS} in
	Linux )
		srcdir="${SRC_DIR}/unix"
		;;
	Darwin )
		srcdir="${SRC_DIR}/macosx"
		C_INCLUDE_PATH+=":/opt/local/include"
		LIBRARY_PATH+=":/opt/local/lib"
		;;
	esac
	"${srcdir}"/configure \
		--prefix="${PREFIX}" \
		--with-tcl=${TCL_PREFIX}/lib \
		--enable-shared=no \
		|| exit 1
}

pbuild::post_install() {
	:
	#{ cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; };
}

