diff --git a/Makefile b/Makefile index d05e8cb..3875459 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ BUILDTYPES+=make BUILDTYPES+=perl-module BUILDTYPES+=perl-module-makemaker BUILDTYPES+=python-module +BUILDTYPES+=r-package HELPER_HOOKS_SHELL+=update-mime-database HELPER_HOOKS_SHELL+=glib-compile-schemas diff --git a/buildtypes/r-package.sh.in b/buildtypes/r-package.sh.in new file mode 100644 index 0000000..df9ad0e --- /dev/null +++ b/buildtypes/r-package.sh.in @@ -0,0 +1,44 @@ +# +# +# bee magic for python modules +# +# Copyright (C) 2009-2012 +# Marius Tolzmann +# Tobias Dreyer +# and other bee developers +# +# This file is part of bee. +# +# bee is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# this needs to be forced for now +if [ ${BEE_BUILDTYPE} != "r-package" ] ; then + return +fi + +BEE_BUILDTYPE_DETECTED="r-package" + +: ${R:=R} + +RHOME=$(${R} RHOME) + +RLIBRARY="${RHOME}/library" + +#### bee_install() ############################################################ + +bee_install() { + start_cmd mkdir -p ${D}/${RLIBRARY} + start_cmd ${R} CMD INSTALL -l ${D}/${RLIBRARY} ${S} +} diff --git a/src/bee-init.sh.in b/src/bee-init.sh.in index 6a43391..6e2a8e5 100644 --- a/src/bee-init.sh.in +++ b/src/bee-init.sh.in @@ -211,6 +211,46 @@ function initialize() { surl="${surl} ${pname}.tar.gz" fi + if [[ "${surl}" = http://cran.r-project.org/src/contrib/* ]] ; then + local cran_pname + local cran_version + local cran_revision + local cran_suffix + + # set suffix + cran_suffix=.tar${pname#*.tar} + # remove suffix + cran_pname=${pname%.tar*} + # extract version and revision + cran_version=${cran_pname##*_} + # set pname + cran_pname=${cran_pname%_*} + + if [[ "${cran_version}" = *-* ]] ; then + # set revision + cran_revision=${cran_version#*-} + fi + + # set version + cran_version=${cran_version%%-*} + + if [[ "${cran_revision}" = *-* ]] ; then + break; + fi + + pname="${cran_pname}" + pname+="-${cran_version}" + pname+="${cran_revision+_${cran_revision}}" + + surl="${surl%/*}/${cran_pname}" + surl+='_${PKGVERSION}${PKGEXTRAVERSION_DASH}' + surl+="${cran_suffix}" + + if [ -z "${OPT_BUILDTYPE}" ] ; then + OPT_BUILDTYPE=r-package + fi + fi + # and remove all HTTP-GET variables.. pname=${pname%%\?*} diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 45077de..4c8e2c8 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -211,12 +211,12 @@ function bee_init_builddir() { print_info "==> initializing build environment .." - if [ -d "${W}" ] ; then + if [ -d "${BEEWORKDIR}" ] ; then if [ "${OPT_CLEANUP}" = "yes" ] ; then - print_info " -> cleaning work dir ${W} .." - rm -fr ${W} + print_info " -> cleaning work dir ${BEEWORKDIR} .." + rm -fr ${BEEWORKDIR} else - print_error "error initializing build-dir ${W}" + print_error "error initializing build-dir ${BEEWORKDIR}" print_error "please use -c to force a cleanup." exit 1 fi @@ -233,7 +233,7 @@ function bee_init_buildinsourcedir() { if [ "${B}" == "${S}" ] ; then link=${BEEWORKDIR}/build print_info " -> B=S linking build dir ${link} to source dir" - ln -s ${S#${W}/} ${link} + ln -s ${S#${BEEWORKDIR}/} ${link} else print_info " -> creating build dir ${B}" mkdir -p ${B} @@ -954,9 +954,6 @@ PV=( ${PKGVERSION[@]} ) BEEPKGROOT="${BEE_TMP_BUILDROOT}/${PKGNAME}" BEEWORKDIR="${BEEPKGROOT}/${PKGFULLPKG}" -R=${BEEPKGROOT} -W=${BEEWORKDIR} - F=${BEEPKGROOT}/files S=${BEEWORKDIR}/source B=${BEEWORKDIR}/build