updated to modern VTK
[engrid-github.git] / src / scripts / makebindist.py
blobdf20248100b257496da49db996cd35b7591c0151
1 #!/usr/bin/env python
2 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 # + +
4 # + This file is part of enGrid. +
5 # + +
6 # + Copyright 2008-2014 enGits GmbH +
7 # + +
8 # + enGrid is free software: you can redistribute it and/or modify +
9 # + it under the terms of the GNU General Public License as published by +
10 # + the Free Software Foundation, either version 3 of the License, or +
11 # + (at your option) any later version. +
12 # + +
13 # + enGrid is distributed in the hope that it will be useful, +
14 # + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 # + GNU General Public License for more details. +
17 # + +
18 # + You should have received a copy of the GNU General Public License +
19 # + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 # + +
21 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 import os
24 import tempfile
25 import re
26 import shutil
28 #filename = tempfile.mkstemp()[1]
29 tmpdir = tempfile.mkdtemp()
31 print "================"
32 print tmpdir
33 print "================"
35 ldd_log = tmpdir + "/ldd.out"
36 command = "ldd ./engrid > " + ldd_log
37 print command
38 os.system(command)
40 libdir=tmpdir + "/enGrid"
41 os.mkdir(libdir)
43 count = 0
45 liblist = []
47 infile = open(ldd_log, "r")
48 if infile:
49 print "name="+infile.name
50 for line in infile:
51 p1 = re.compile('\s\S+\s=>\s(\S+)\s\(\S+\)\s')
52 p2 = re.compile('\s(\S+)\s\(\S+\)\s')
54 m1 = p1.match(line)
55 if m1:
56 print m1.group(1)
57 count += 1
58 liblist.append(m1.group(1))
60 m2 = p2.match(line)
61 if m2:
62 print m2.group(1)
63 count += 1
64 liblist.append(m2.group(1))
66 infile.close()
68 print "count = ", count
69 print "liblist = ", liblist
70 print "len(liblist) = ", len(liblist)
72 for lib in liblist:
73 print lib
74 shutil.copy(lib,libdir)
76 print "================"
77 print tmpdir
78 print "================"
80 #cp engrid $TMPDIR/enGrid
81 #cp start_engrid enGrid
82 #tar -czvf enGrid_bin.tar.gz $TMPDIR/enGrid/*
83 # rm -rf enGrid
84 # rm ldd.out