# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # # Author: Tom Regner # # Ease the development of ebuild for pike-modules # available via monger # inherit base eutils RESTRICT="mirror" EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_setup if [ -z "${PM_NAME}" ]; then PM_NAME="${PN//-/.}" fi if [ -z "${PM_PACKAGE_NAME}" ]; then PM_PACKAGE_NAME="${PN//-/_}" fi S="${WORKDIR}/${PM_PACKAGE_NAME}-${PV}" pike-monger_pkg_setup() { if [ -z "${SRC_URI}" ]; then eerror "No SRC_URI in ebuild. Use the command" eerror "expr \"\$( pike -x monger --force --version \"${PV}\" \ --show-urls --query \"${PM_NAME}\" )\" \ : '.*\(http://[^[:space:]]*\).*'" eerror "To obtain a list of URLs to use for SRC_URI" eerror "(needs >=dev-pike/Tools-Mopnger-7.7.39 or >=dev-lang/pike-7.7)" die "Bad ebuild - please file a bug with the above information" fi } pike-monger_src_unpack() { unpack ${PM_PACKAGE_NAME}-${PV}.tar.gz || die "Couldn't unpack ${PM_PACKAGE_NAME}-${PV}.tar.gz" if [ -n "${!PATCHES[@]}" ]; then pushd "${S}" for i in ${!PATCHES[@]}; do epatch "${FILESDIR}/${PATCHES[$i]}" done popd fi } pike-monger_src_compile() { pike -x module || die "Couldn't compile ${PM_PACKAGE_NAME}-${PV} - check \ output above" } pike-monger_src_install() { local MOD_PATH="${D%%/}$(pike -x module \ --query=system_module_path)" mkdir -p ${MOD_PATH} pike -x module SYSTEM_MODULE_PATH=${MOD_PATH} install || die "Failed to install \ ${PM_PACKAGE_NAME}-{$PV}" } # vim: set sw=4 ts=4 filetype=ebuild