Revision 369
trunk/org.gvsig.gdal2/org.gvsig.gdal2.app/org.gvsig.gdal2.app.mainplugin/org.gvsig.gdal2.app.mainplugin.lin.x86_64/src/main/assembly/buildgdaltar.py | ||
---|---|---|
1 |
|
|
2 |
import subprocess |
|
3 |
import os |
|
4 |
import sys |
|
5 |
import shutil |
|
6 |
|
|
7 |
excludes = ( |
|
8 |
"libc", |
|
9 |
"libpthread", |
|
10 |
"libz", |
|
11 |
"libdl", |
|
12 |
"libstdc++", |
|
13 |
"libm", |
|
14 |
"libgcc_s", |
|
15 |
"libfreetype", |
|
16 |
"libfontconfig", |
|
17 |
"libsz", |
|
18 |
"liblzma", |
|
19 |
"libssl", |
|
20 |
"libcrypto", |
|
21 |
"librt", |
|
22 |
"libresolv", |
|
23 |
"libcrypt", |
|
24 |
) |
|
25 |
|
|
26 |
def stdout(cmd): |
|
27 |
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) |
|
28 |
output = proc.communicate()[0] |
|
29 |
return output |
|
30 |
|
|
31 |
def main(): |
|
32 |
x = os.path.dirname(sys.argv[0]) |
|
33 |
if x!="": |
|
34 |
os.chdir(x) |
|
35 |
if not os.path.exists("../../../pom.xml"): |
|
36 |
print "No localizo la carpeta 'target'" |
|
37 |
os.exist(-1) |
|
38 |
if not os.path.exists("../../../target"): |
|
39 |
os.mkdir("../../../target") |
|
40 |
|
|
41 |
pack_sh_path = os.path.join(os.getcwd(),"pack.sh") |
|
42 |
|
|
43 |
os.chdir("../../../target") |
|
44 |
shutil.rmtree("native",True) |
|
45 |
os.makedirs("native/gdal") |
|
46 |
os.chdir("native/gdal") |
|
47 |
|
|
48 |
files = list() |
|
49 |
output = stdout("ldd /usr/bin/gdalinfo") |
|
50 |
for line in output.split("\n"): |
|
51 |
parts = line.split("=>") |
|
52 |
if len(parts)>1: |
|
53 |
f = parts[1].strip().split(" ") |
|
54 |
f = f[0].strip() |
|
55 |
x = os.path.basename(f).split(".")[0] |
|
56 |
if not x in excludes : |
|
57 |
print "copy ", f |
|
58 |
shutil.copy(f,os.path.join(os.getcwd(), os.path.basename(f))) |
|
59 |
|
|
60 |
uname_output = stdout("uname -a") |
|
61 |
lsb_release_output = stdout("lsb_release -a") |
|
62 |
os_name = stdout("lsb_release -si").lower().strip() |
|
63 |
os_version = stdout("lsb_release -sr").strip() |
|
64 |
os_arch = stdout("uname -m").strip() |
|
65 |
gdal_version = stdout("gdal-config --version").strip() |
|
66 |
gdal_datadir = stdout("gdal-config --datadir").strip() |
|
67 |
|
|
68 |
f = open("gdal-version.txt","wt") |
|
69 |
f.write("#\n") |
|
70 |
f.write("+ uname -a\n") |
|
71 |
f.write(uname_output) |
|
72 |
f.write("+ lsb_release -a\n") |
|
73 |
f.write(lsb_release_output) |
|
74 |
f.write("+ gdal-config --version\n") |
|
75 |
f.write(gdal_version) |
|
76 |
f.write("\n#\n") |
|
77 |
f.close() |
|
78 |
|
|
79 |
os.makedirs("data") |
|
80 |
for fname in os.listdir(gdal_datadir): |
|
81 |
shutil.copy(os.path.join(gdal_datadir,fname),os.path.join("data", fname)) |
|
82 |
|
|
83 |
os.makedirs("java") |
|
84 |
shutil.copy("/usr/share/java/gdal.jar","java/gdal.jar") |
|
85 |
|
|
86 |
f = open("pack.cfg","wt") |
|
87 |
f.write('gdal_groupId="org.gdal"\n') |
|
88 |
f.write('gdal_artifactId="gdal"\n') |
|
89 |
f.write('gdal_jar="java/gdal.jar"\n') |
|
90 |
f.write('gdal_classifier="%s-%s-%s"\n' %(os_name, os_version, os_arch)) |
|
91 |
f.write('gdal_version="%s.1"\n' % gdal_version) |
|
92 |
f.close() |
|
93 |
|
|
94 |
shutil.copy(pack_sh_path,"pack.sh") |
|
95 |
|
|
96 |
|
|
97 |
main() |
trunk/org.gvsig.gdal2/org.gvsig.gdal2.app/org.gvsig.gdal2.app.mainplugin/org.gvsig.gdal2.app.mainplugin.lin.x86_64/src/main/assembly/pack.sh | ||
---|---|---|
1 |
#!/bin/bash |
|
2 |
|
|
3 |
set -e |
|
4 |
|
|
5 |
if [ "$BASH" = "" ] ; then |
|
6 |
echo "Need a bash" |
|
7 |
exit 1 |
|
8 |
fi |
|
9 |
if ! type curl ; then |
|
10 |
echo "Need 'curl' command." |
|
11 |
exit 2 |
|
12 |
fi |
|
13 |
if ! type zenity ; then |
|
14 |
echo "Need 'zenity' command." |
|
15 |
exit 2 |
|
16 |
fi |
|
17 |
if ! type mvn ; then |
|
18 |
echo "Need 'mvn' command." |
|
19 |
exit 2 |
|
20 |
fi |
|
21 |
|
|
22 |
GVSIG_REPOSITORY="https://devel.gvsig.org/m2repo/j2se" |
|
23 |
|
|
24 |
do_login() { |
|
25 |
if [ -n "$USERNAME" -a -n "$PASSWORD" ] ; then |
|
26 |
return |
|
27 |
fi |
|
28 |
USERNAME=$(zenity --password --username) |
|
29 |
if [ -z "$USERNAME" ] ; then |
|
30 |
exit 0 |
|
31 |
fi |
|
32 |
PASSWORD="${USERNAME/*|/}" |
|
33 |
USERNAME="${USERNAME/|*/}" |
|
34 |
} |
|
35 |
|
|
36 |
do_deploy() { |
|
37 |
echo "Deploy" |
|
38 |
|
|
39 |
do_login |
|
40 |
|
|
41 |
curl -sf --insecure --user "${USERNAME}:${PASSWORD}" -X MKCOL "${GVSIG_REPOSITORY}/${gdal_groupId/./\/}/${gdal_artifactId}/${gdal_version}" >/dev/null |
|
42 |
if [ "$?" != "0" -a "$?" != "22" ] ; then |
|
43 |
echo "Can't access to the repository for write." |
|
44 |
exit 1 |
|
45 |
fi |
|
46 |
|
|
47 |
mvn deploy:deploy-file \ |
|
48 |
-Durl=https://devel.gvsig.org/m2repo/j2se \ |
|
49 |
-DrepositoryId=gvsig-repository \ |
|
50 |
-DgroupId="${gdal_groupId}" \ |
|
51 |
-DartifactId="${gdal_artifactId}" \ |
|
52 |
-Dversion="${gdal_version}" \ |
|
53 |
-Dpackaging=jar \ |
|
54 |
-Dfile="${gdal_jar}" \ |
|
55 |
-Ddescription="Binarios de GDAL." |
|
56 |
|
|
57 |
mvn deploy:deploy-file \ |
|
58 |
-Durl=https://devel.gvsig.org/m2repo/j2se \ |
|
59 |
-DrepositoryId=gvsig-repository \ |
|
60 |
-DgroupId="${gdal_groupId}" \ |
|
61 |
-DartifactId="${gdal_artifactId}" \ |
|
62 |
-Dversion="${gdal_version}" \ |
|
63 |
-Dpackaging=tar.gz \ |
|
64 |
-Dclassifier="${gdal_classifier}" \ |
|
65 |
-Dfile="../gdal-${gdal_version}-${gdal_classifier}.tar.gz" \ |
|
66 |
-Ddescription="Binarios de GDAL." |
|
67 |
|
|
68 |
} |
|
69 |
|
|
70 |
|
|
71 |
do_package() { |
|
72 |
echo "Package" |
|
73 |
rm -f "../gdal-${gdal_version}-${gdal_classifier}.tar.gz" |
|
74 |
tar zcvf "../gdal-${gdal_version}-${gdal_classifier}.tar.gz" . |
|
75 |
} |
|
76 |
|
|
77 |
|
|
78 |
do_main() { |
|
79 |
cd $(dirname $0) |
|
80 |
|
|
81 |
. ./pack.cfg |
|
82 |
|
|
83 |
case "$1" in |
|
84 |
deploy) |
|
85 |
do_deploy |
|
86 |
;; |
|
87 |
package) |
|
88 |
do_package |
|
89 |
;; |
|
90 |
all) |
|
91 |
do_package |
|
92 |
do_deploy |
|
93 |
;; |
|
94 |
esac |
|
95 |
} |
|
96 |
|
|
97 |
|
|
98 |
do_main $@ |
|
99 |
|
|
100 |
|
|
101 |
|
trunk/org.gvsig.gdal2/org.gvsig.gdal2.app/org.gvsig.gdal2.app.mainplugin/org.gvsig.gdal2.app.mainplugin.lin.x86_64/pom.xml | ||
---|---|---|
15 | 15 |
<gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem> |
16 | 16 |
<gvsig.package.info.architecture>x86_64</gvsig.package.info.architecture> |
17 | 17 |
|
18 |
<gdal.classifier>ubuntu-16.04.2-amd64</gdal.classifier>
|
|
19 |
<gdal.version>1.11.3.3</gdal.version>
|
|
18 |
<gdal.classifier>ubuntu-18.04-x86_64</gdal.classifier>
|
|
19 |
<gdal.version>2.2.3.1</gdal.version>
|
|
20 | 20 |
</properties> |
21 | 21 |
|
22 | 22 |
<dependencyManagement> |
Also available in: Unified diff