root/gs2-extensions/parallel-building/trunk/src/packages/CASCADE-MAKE/DATETIME.sh @ 27440

Revision 27440, 2.2 KB (checked in by jmt12, 6 years ago)

cascade file for DateTime? module. Uses customized functions as DateTime? is build using Module::Build---rather than the more typical MakeMaker?. These functions might be candidates for moving to the cascade library one day

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3package=DateTime
4version=-1.03
5
6progname=$0
7
8source ../cascade-make/lib/cascade-lib.bash GEXTPARALLELBUILDING ../.. $*
9
10# One day these functions should live in their own library
11opt_modulebuild_configure()
12{
13  local force_config=$1; shift
14  local auto_config=$1; shift
15  local package=$1; shift
16  local version=$1; shift
17  local prefix=$1; shift
18  local perlversion=$1; shift
19
20  local buildfile_path="$package$version/Build"
21  if [ -e $buildfile_path ] ; then
22    force_config=0
23  fi
24
25  if [ $force_config = "1" ] ; then
26    echo "[pushd $package$version]"
27    ( cd $package$version ; \
28      perl -I "$prefix/lib/perl/$perlversion" Build.PL --install_base "$prefix" --install_path lib="$prefix/lib/perl/$perlversion" --install_path arch="$prefix/lib/perl/$perlversion" $@)
29    if [ $? != 0 ] ; then
30        echo "      Error encountered running *configure* stage of $progname"
31        exit 1
32    fi
33    echo "[popd]"
34  else
35    if [ $auto_config = "1" ] ; then
36      echo "Found top-level for ${progname%.*} => no need to run perl configure"
37    fi
38  fi
39}
40
41
42opt_modulebuild_make()
43{
44  local type=$1; shift
45  local package=$1; shift
46  local version=$1; shift
47  local opt_target=""
48
49  if [ ! -z "$1" ] ; then
50    opt_target=$1; shift
51  fi
52
53  if [ $type = "1" ] ; then
54    ( cd $package$version ; \
55      ./Build $opt_target $@)
56
57    if [ $? != 0 ] ; then
58        echo "      Error encountered running *Build $target* stage of $progname"
59        exit 1
60    fi
61  fi
62}
63
64prefix=$GEXTPARALLELBUILDING_INSTALLED
65perlversion=$PERL_VERSION
66
67opt_run_untar $force_untar $auto_untar $package $version
68opt_modulebuild_configure $force_config $auto_config $package $version $prefix $perlversion
69
70# We only compile if necessary, as compilation is quite slow and we don't
71# edit these source files
72if [[ ! -e "$prefix/lib/perl/$perlversion/DateTime.pm" ]]
73then
74  opt_modulebuild_make $compile   $package $version
75  echo "opt_run_make $install $package $version \"install\""
76  opt_modulebuild_make $install   $package $version "install"
77else
78  echo "DateTime Perl module already compiled => no need to recompile"
79fi
80
81opt_modulebuild_make $clean     $package $version "clean"
82opt_modulebuild_make $distclean $package $version "distclean"
83
84opt_run_tarclean $tarclean $package $version
85
86
87
88
89
90
91
Note: See TracBrowser for help on using the browser.