[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [3003] plugins build script refactoring: razionalizati
From: |
Daniele Perrone |
Subject: |
[myserver-commit] [3003] plugins build script refactoring: razionalization and architecture name added in plugin tar.gz file |
Date: |
Mon, 16 Feb 2009 13:32:19 +0000 |
Revision: 3003
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3003
Author: dperrone
Date: 2009-02-16 13:32:19 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
plugins build script refactoring: razionalization and architecture name added
in plugin tar.gz file
Modified Paths:
--------------
trunk/plugins/SConstruct
Modified: trunk/plugins/SConstruct
===================================================================
--- trunk/plugins/SConstruct 2009-02-15 12:49:50 UTC (rev 3002)
+++ trunk/plugins/SConstruct 2009-02-16 13:32:19 UTC (rev 3003)
@@ -27,7 +27,7 @@
import string
def print_help():
- print "usage: scons [package|release]
plugin=<plugin1>,<plugin2>,...,<pluginN>"
+ print "usage: scons [command=build|package]
plugin=<plugin1>,<plugin2>,...,<pluginN>"
src_dir = "src/"
bin_dir = "bin/"
@@ -37,6 +37,19 @@
command = ARGUMENTS.get('command', "build")
+arch = ""
+import os
+if os.name=="nt":
+ arch = "win32"
+else:
+ import string
+ arch = string.lower(os.uname()[0])
+ if string.find(os.uname()[4],"64")==-1:
+ arch = arch + "32"
+ else:
+ arch = arch + "64"
+
+
if plugin=="":
print_help()
Exit(1)
@@ -56,6 +69,7 @@
]
+
def tar_package(src_dir, name, filename):
import tarfile
tarf = tarfile.open(filename.encode("ascii"),"w|gz")
@@ -68,38 +82,22 @@
Command(dest_dir + "/plugin.xml",src_dir + name + "/plugin.xml",
Copy("$TARGET", "$SOURCE"))
def build_plugins(plugins):
- for name in plugins:
+ for name in plugins:
build_plugin(name)
-
def pack_plugin(name):
doc = xml.dom.minidom.parse(bin_dir + name + "/plugin.xml")
version = doc.getElementsByTagName("VERSION")
- filename = name + "-" + version[0].firstChild.data + ".tar.gz"
+ filename = name + "-" + version[0].firstChild.data + "-" + arch + ".tar.gz"
tar_package(bin_dir, name, release_dir + filename)
+
-
def pack_plugins(plugins):
- for name in plugins:
+ for name in plugins:
pack_plugin(name)
-build = True
-package = False
-release = False
-
-
-
-if command=='package':
- build = False
- package = True
-
-if command=='release':
- package = True
- release = True
-
-
env = Environment(CPPPATH=listinc,CXXFLAGS="-fPIC -DPIC -DHAVE_CONFIG_H",
LINKFLAGS="-rdynamic")
@@ -113,12 +111,17 @@
env = conf.Finish()
-if build:
+if command=='build':
build_plugins(plugins)
-if package:
- pack_plugins(plugins)
+
+if command=='package':
+ pack_plugins(plugins)
+
+
+
+
#TODO: test compile and run.
#if command == "build":
# testsFiles = glob.glob('tests/*.cpp') + files
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [3003] plugins build script refactoring: razionalization and architecture name added in plugin tar.gz file,
Daniele Perrone <=