Package: astk / 1.13.1-2

0003-debian-install.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
From: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Date: Mon, 7 Apr 2014 09:03:06 +0200
Subject: debian-install

---
 ASTK_SERV/asrun/installation.py |    9 +++------
 ASTK_SERV/asrun/maintenance.py  |   41 +++++++++++++++++++++++----------------
 setup.py                        |    2 +-
 3 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/ASTK_SERV/asrun/installation.py b/ASTK_SERV/asrun/installation.py
index 97244a1..82b9a67 100644
--- a/ASTK_SERV/asrun/installation.py
+++ b/ASTK_SERV/asrun/installation.py
@@ -18,17 +18,14 @@ os.environ['ASTER_ROOT'] = aster_root
 
 # directory for configuration files (profile.sh, config)
 # alternative to /etc/code_aster for non-root install
-prefix = aster_root
-if aster_root == '/usr':
-    prefix = '/'
-confdir = osp.join(prefix, 'etc', 'codeaster')
+confdir = os.path.join('/etc', 'codeaster')
 
 # confdir contains plugins directory
 if confdir not in sys.path:
     sys.path.append(confdir)
 
 # directory containing data files
-datadir = osp.join(aster_root, 'share', 'codeaster', 'asrun', 'data')
+datadir = osp.join('/usr', 'lib', 'codeaster', 'asrun', 'data')
 
 # directory for internationalization
-localedir = osp.join(aster_root, 'share', 'locale')
+localedir = osp.join('/usr', 'share', 'locale')
diff --git a/ASTK_SERV/asrun/maintenance.py b/ASTK_SERV/asrun/maintenance.py
index ff22551..abbdef8 100644
--- a/ASTK_SERV/asrun/maintenance.py
+++ b/ASTK_SERV/asrun/maintenance.py
@@ -830,13 +830,19 @@ def MakeAster(run, *args):
                 subject = subject)
 
     elif target == 'clean':
+        destdir = run.get('destdir')
+        if not destdir:
+            destdir=REPREF
+        else:
+            destdir = destdir + REPREF
+        run.Mess(_(u'cleaning : %s') % destdir, 'TITLE')
         if len(param) == 0:
             l_clean = ['BIN_NODBG', 'BIN_DBG', 'BINCMDE', 'BINCMDE_ZIP', 'BINELE', 'BINPICKLED',
                     'BINLIB_NODBG', 'BINLIB_DBG', 'BINSHLIB_NODBG', 'BINSHLIB_DBG',
                     'BINLIBF_NODBG', 'BINLIBF_DBG', 'BINSHLIBF_NODBG', 'BINSHLIBF_DBG',
                     'BINOBJ_NODBG', 'BINOBJF_NODBG', 'BINOBJ_DBG', 'BINOBJF_DBG']
             for key in l_clean:
-                ficrep = os.path.join(REPREF, conf[key][0])
+                ficrep = os.path.join(destdir, conf[key][0])
                 if conf[key][0] != '':
                     run.Delete(ficrep, verbose=True)
                 remove_empty_dirs(REPREF)
@@ -845,7 +851,7 @@ def MakeAster(run, *args):
                 # source files
                 lf = []
                 for ext in ('*.c', '*.f', '*.F'):
-                    lf.extend(glob.glob(os.path.join(REPREF, dsrc, ext)))
+                    lf.extend(glob.glob(os.path.join(destdir, dsrc, ext)))
                 # object files
                 lo = [os.path.splitext(os.path.basename(f))[0]+'.o' for f in lf]
                 for dobj in ('BINOBJ_NODBG', 'BINOBJ_DBG'):
@@ -883,6 +889,8 @@ def _build_aster(run, conf, iupdate, REPREF, destdir, reptrav, lardv=None):
     debug_mode = [mod for mod in conf['MAKE'][0].split() if mod in ('debug', 'nodebug')]
     if not destdir:
         destdir = REPREF
+    else :
+        destdir = destdir+REPREF
 
     # ----- Initialize MPI_INFO object
     mpi_info = MPI_INFO(conf.get_defines())
@@ -931,11 +939,14 @@ def _build_aster(run, conf, iupdate, REPREF, destdir, reptrav, lardv=None):
         if run.IsDir(libferm):
             libferm = os.path.join(libaster, 'ferm.lib')
         run.Mess(_(u'Start build in %s mode') % mode, 'TITLE')
+        run.Mess(_(u'destdir = %s') % destdir, 'TITLE')
+        run.Mess(_(u'REPPREF = %s') % REPREF, 'TITLE')
 
         # 1.2. compile updated files
         tit = _(u'Compilation in %s mode') % mode
         run.timer.Start(tit)
-        kret = build.CompilAster(REPREF, dbg=mode)
+	#kret = build.CompilAster(REPREF, dbg=mode)
+	kret = build.CompilAster(destdir, dbg=mode)
         run.timer.Stop(tit)
         run.CheckOK()
 
@@ -943,13 +954,13 @@ def _build_aster(run, conf, iupdate, REPREF, destdir, reptrav, lardv=None):
         # 1.3.1. obj or dbg
         tit = _(u'Add object files to library')
         run.timer.Start(tit)
-        kret = build.Archive(repobj=os.path.join(REPREF, DbgPara[mode]['suff']),
+        kret = build.Archive(repobj=os.path.join(destdir, DbgPara[mode]['suff']),
                 lib=libaster)
         run.CheckOK()
 
         # 1.3.2. obj_f or dbg_f
         kret = build.Archive(
-                repobj=os.path.join(REPREF, DbgPara[mode]['suffer']),
+                repobj=os.path.join(destdir, DbgPara[mode]['suffer']),
                 lib=libferm)
         run.CheckOK()
         run.timer.Stop(tit)
@@ -968,7 +979,10 @@ def _build_aster(run, conf, iupdate, REPREF, destdir, reptrav, lardv=None):
         # - required Python modules are present
         tit = _(u'Test executables')
         run.timer.Start(tit)
-        cmd = exec_name + ' -c '
+	if not destdir :
+            cmd = exec_name + ' -c '
+	else :
+	    cmd = 'LD_LIBRARY_PATH='+ destdir + 'lib ' + exec_name + ' -c '
         cpyt = ['import traceback']
         cmd_import = """
 print '%(cmd)s :',
@@ -1005,7 +1019,7 @@ except:
         kargs['exe'] = os.path.join(destdir, DbgPara['debug']['exe'])
     tit = _(u'Compilation of commands catalogue')
     run.timer.Start(tit)
-    kret = build.CompilCapy(REPREF, reptrav, i18n=True, **kargs)
+    kret = build.CompilCapy(destdir, reptrav, i18n=True, **kargs)
     run.timer.Stop(tit)
     run.CheckOK()
 
@@ -1016,24 +1030,17 @@ except:
     })
     tit = _(u'Make pickled of elements')
     run.timer.Start(tit)
-    kret = build.MakePickled(REPREF, reptrav, repdest=destdir, **kargs)
+    kret = build.MakePickled(destdir, reptrav, repdest=destdir, **kargs)
     run.timer.Stop(tit)
     run.CheckOK()
 
     tit = _(u'Elements compilation')
     run.timer.Start(tit)
-    kret = build.CompilEle(REPREF, reptrav, **kargs)
+    kret = build.CompilEle(destdir, reptrav, **kargs)
     run.timer.Stop(tit)
     run.CheckOK()
 
     # 4. ----- copy of auxiliary files
-    if os.path.abspath(destdir) != os.path.abspath(REPREF):
-        lsrc = [os.path.join(REPREF, fsrc) for fsrc in [conf['SRCPY'][0], conf.get_filename()]]
-        run.Copy(destdir, *lsrc)
-        #XXX only works if the files are in REPREF
-        lsrc = [os.path.join(REPREF, fsrc) for fsrc in conf['ENV_SH'] \
-                if fsrc == os.path.basename(fsrc)]
-        run.Copy(destdir, *lsrc)
 
     # 9. ----- end
     run.Mess(_(u'Code_Aster has been successfully built'), 'OK')
@@ -1235,7 +1242,7 @@ def Update(run, *args, **kwargs):
     run.Mess(_(u'Apply unigest directives'), 'TITLE')
     lardv = []
     for f in lunig:
-        run.Delete(os.path.join(REPREF, f), verbose=True)
+        run.Delete(os.path.join(destdir, f), verbose=True)
         if re.search('^'+conf['SRCC'][0]+'/' + \
                         '|^'+conf['SRCFOR'][0]+'/' + \
                         '|^'+conf['SRCF90'][0]+'/', f):
diff --git a/setup.py b/setup.py
index 6635e26..7070d0a 100644
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,7 @@ def start_setup(prefix):
     data_files.extend(build_data_files(osp.join(confdir, "astkrc"), 'ASTK_CLIENT/etc/astkrc'))
     data_files.extend(build_data_files('lib/astk', 'ASTK_CLIENT/lib'))
     data_files.extend(build_data_files('share', 'ASTK_SERV/share'))
-    data_files.extend(build_data_files('share/codeaster/asrun/unittest', 'ASTK_SERV/unittest'))
+    data_files.extend(build_data_files('lib/codeaster/asrun/unittest', 'ASTK_SERV/unittest'))
     if sys.hexversion >= 0x020500F0:
         data_files.extend(build_data_files('share/locale', 'ASTK_SERV/i18n/locale'))