Browse Source

Fix and revamp OpenLMI build code

Alois Mahdal 10 years ago
parent
commit
6a3cec9fa5
1 changed files with 21 additions and 10 deletions
  1. 21
    10
      bin/eemk.in

+ 21
- 10
bin/eemk.in View File

@@ -12,6 +12,7 @@ ffoo import yummy
12 12
 
13 13
 ENVIRON_SCRIPT="$HOME/.eemk-env"
14 14
 FFOO_VERBOSE=true
15
+OL_TRY_JM=${OL_TRY_JM:-false}
15 16
 TEST_STATUS=0
16 17
 
17 18
 # tmp needs to be shared to children
@@ -27,6 +28,21 @@ fi
27 28
 
28 29
 yum_install_if_needed wget
29 30
 
31
+fc22plus() {
32
+    test "$(guess_rtag_word)" == "fc" -a 0$(guess_rtag_num) -ge 22
33
+}
34
+
35
+maybe_with_jobmanager() {
36
+    debug -v OL_TRY_JM
37
+    debug -c fc22plus
38
+    if $OL_TRY_JM || fc22plus;
39
+    then
40
+        echo -DWITH-JOBMANAGER=1
41
+    else
42
+        echo -DWITH-JOBMANAGER=0
43
+    fi
44
+}
45
+
30 46
 case "$1" in
31 47
 
32 48
 
@@ -119,12 +135,6 @@ case "$1" in
119 135
         # let's build *anything*
120 136
         case $2 in
121 137
             p|openlmi-providers)
122
-                withjm=0
123
-                rtag_word=$(guess_rtag_word)
124
-                rtag_num=$(guess_rtag_num)
125
-                test "$rtag_word" == "fc" \
126
-                    -a 0$rtag_num -ge 22 \
127
-                    && withjm=1
128 138
                 (
129 139
                     mkdir -p openlmi-providers/build
130 140
                     cd openlmi-providers/build
@@ -132,7 +142,7 @@ case "$1" in
132 142
                              -DWITH-FAN=0 \
133 143
                              -DWITH-POWER=0 \
134 144
                              -DWITH-SSSD=0 \
135
-                             -DWITH-JOBMANAGER=$withjm
145
+                             $(maybe_with_jobmanager)
136 146
                     make
137 147
                     make doc
138 148
                     make install
@@ -141,10 +151,11 @@ case "$1" in
141 151
                 ;;
142 152
             t|openlmi-tools)
143 153
                 (
144
-                    cd openlmi-tools
154
+                    cd openlmi-tools/cli
155
+                    make clean
156
+                    make
157
+                    python setup.py install || die "could not install openlmi-tools"
145 158
                     make clean
146
-                    make setup
147
-                    python setup.py install
148 159
                 )
149 160
                 ;;
150 161
             *)