Skip to content

Commit

Permalink
Merge branch 'cran'
Browse files Browse the repository at this point in the history
* cran:
  bee-init: Add support for cran repository in url rewriting
  buildtypes: Add support for R packages
  beesh: remove unused and deprecated variables R and W
  • Loading branch information
mariux committed Mar 27, 2013
2 parents 7807570 + 710c3d8 commit c16e2a4
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions buildtypes/r-package.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
#
# bee magic for python modules
#
# Copyright (C) 2009-2012
# Marius Tolzmann <tolzmann@molgen.mpg.de>
# Tobias Dreyer <dreyer@molgen.mpg.de>
# 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 <http://www.gnu.org/licenses/>.
#

# 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}
}
40 changes: 40 additions & 0 deletions src/bee-init.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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%%\?*}

Expand Down
13 changes: 5 additions & 8 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c16e2a4

Please sign in to comment.