1 | #!/bin/bash
|
---|
2 |
|
---|
3 | package=DateTime
|
---|
4 | version=-1.03
|
---|
5 |
|
---|
6 | progname=$0
|
---|
7 |
|
---|
8 | source ../cascade-make/lib/cascade-lib.bash GEXTPARALLELBUILDING ../.. $*
|
---|
9 |
|
---|
10 | # One day these functions should live in their own library
|
---|
11 | opt_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 |
|
---|
42 | opt_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 |
|
---|
64 | prefix=$GEXTPARALLELBUILDING_INSTALLED
|
---|
65 | perlversion=$PERL_VERSION
|
---|
66 |
|
---|
67 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
68 | opt_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
|
---|
72 | if [[ ! -e "$prefix/lib/perl/$perlversion/DateTime.pm" ]]
|
---|
73 | then
|
---|
74 | opt_modulebuild_make $compile $package $version
|
---|
75 | echo "opt_run_make $install $package $version \"install\""
|
---|
76 | opt_modulebuild_make $install $package $version "install"
|
---|
77 | else
|
---|
78 | echo "DateTime Perl module already compiled => no need to recompile"
|
---|
79 | fi
|
---|
80 |
|
---|
81 | opt_modulebuild_make $clean $package $version "clean"
|
---|
82 | opt_modulebuild_make $distclean $package $version "distclean"
|
---|
83 |
|
---|
84 | opt_run_tarclean $tarclean $package $version
|
---|
85 |
|
---|
86 |
|
---|
87 |
|
---|
88 |
|
---|
89 |
|
---|
90 |
|
---|
91 |
|
---|