---
 support/build      |   60 ----------------------------------------------------
 support/build.py   |    4 ++-
 support/run        |   17 --------------
 support/run.py     |   50 +++++++++++++++++++++++++++++++++++++++++++
 support/support.py |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 113 insertions(+), 78 deletions(-)
 delete mode 100755 support/build
 delete mode 100755 support/run
 create mode 100755 support/run.py
 create mode 100755 support/support.py

diff --git a/support/build b/support/build
deleted file mode 100755
index d492e5a..0000000
--- a/support/build
+++ /dev/null
@@ -1,60 +0,0 @@
- #! /bin/sh
-erlc +debug_info -pa _build/development/apps/etask-0.5.0/ebin -I \
-_build/development/apps/etask-0.5.0/include -pa \
-_build/development/apps/sinan-0.10.0.12/ebin -pa \
-_build/development/apps/sinan_web_api-0.1.0.3/ebin \
--pa ../fconf/_build/development/apps/fconf-0.3.0.0/ebin \
--pa ../ktuo/_build/development/apps/ktuo-0.3.0.1/ebin -pa \
-../ktuo/_build/development/apps/ktuo-0.4.0.0/ebin -pa \
-../crary/_build/development/apps/crary-0.2.0/ebin -pa \
-../crary/_build/development/apps/crary-0.2.0/ebin -pa \
-/usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/ebin \
--I /usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/include \
--pa /usr/local/erlware/application_packages/5.5.5/lib/ibrowse-1.4/ebin \
--pa ../erlware/_build/development/apps/cryptographic-0.2.0/ebin \
--pa ../erlware/_build/development/apps/ewlib-0.7.4.0/ebin -pa \
-../erlware/_build/development/apps/ewrepo-0.16.5.7/ebin -pa \
-../erlware/_build/development/apps/gas-5.1.0/ebin \
--I /usr/local/erlware/application_packages/5.5.5/lib/kernel-2.11.5/include \
--o _build/development/apps/etask-0.5.0/ebin  ./server/etask/src/*.erl
-
-erlc +debug_info -pa _build/development/apps/etask-0.5.0/ebin -I \
-_build/development/apps/etask-0.5.0/include -pa \
-_build/development/apps/sinan-0.10.0.12/ebin -pa \
-_build/development/apps/sinan_web_api-0.1.0.3/ebin \
--pa ../fconf/_build/development/apps/fconf-0.3.0.0/ebin \
--pa ../ktuo/_build/development/apps/ktuo-0.3.0.1/ebin \
--pa ../ktuo/_build/development/apps/ktuo-0.4.0.0/ebin \
--pa ../crary/_build/development/apps/crary-0.2.0/ebin \
--pa ../crary/_build/development/apps/crary-0.2.0/ebin \
--pa /usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/ebin \
- -I /usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/include\
- -pa /usr/local/erlware/application_packages/5.5.5/lib/ibrowse-1.4/ebin \
- -pa ../erlware/_build/development/apps/cryptographic-0.2.0/ebin -pa \
- ../erlware/_build/development/apps/ewlib-0.7.4.0/ebin -pa \
- ../erlware/_build/development/apps/ewrepo-0.16.6.1/ebin -pa \
- ../erlware/_build/development/apps/gas-5.1.0/ebin -I \
- /usr/local/erlware/application_packages/5.5.5/lib/kernel-2.11.5/include \
- -o _build/development/apps/sinan-0.10.0.12/ebin  ./server/sinan/src/*.erl
-
-erlc +debug_info -pa _build/development/apps/etask-0.5.0/ebin -I \
- _build/development/apps/etask-0.5.0/include -pa \
- _build/development/apps/sinan-0.10.0.12/ebin -pa \
- _build/development/apps/sinan_web_api-0.1.0.3/ebin -pa \
- ../fconf/_build/development/apps/fconf-0.3.0.0/ebin -pa \
- ../ktuo/_build/development/apps/ktuo-0.3.0.1/ebin -pa \
- ../ktuo/_build/development/apps/ktuo-0.4.0.0/ebin -pa \
- ../crary/_build/development/apps/crary-0.2.0/ebin -I \
- ../crary/_build/development/apps/crary-0.2.0/include  -pa \
- ../crary/_build/development/apps/crary-0.2.0/ebin -pa \
- /usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/ebin \
- -I /usr/local/erlware/application_packages/5.5.5/lib/eunit-2.0/include \
- -pa /usr/local/erlware/application_packages/5.5.5/lib/ibrowse-1.4/ebin \
- -pa ../erlware/_build/development/apps/cryptographic-0.2.0/ebin -pa \
- ../erlware/_build/development/apps/ewlib-0.7.4.0/ebin -pa \
- ../erlware/_build/development/apps/ewrepo-0.16.6.1/ebin -pa \
- ../erlware/_build/development/apps/gas-5.1.0/ebin -I \
- /usr/local/erlware/application_packages/5.5.5/lib/kernel-2.11.5/include -I \
- ../uri/_build/development/apps/uri-0.1.0/include/ -o \
- _build/development/apps/sinan_web_api-0.1.0.3/ebin \
-  ./server/sinan_web_api/src/*.erl
diff --git a/support/build.py b/support/build.py
index c1b18cd..d76707d 100755
--- a/support/build.py
+++ b/support/build.py
@@ -1,4 +1,4 @@
- #! /bin/python
+#! /usr/bin/python
 """Support for building sinan, bootstraping it on a new version of erlang"""
 
 
@@ -18,11 +18,13 @@ def compile_app(app):
                         ebin,
                         app[0]))
 
+    print compile_command
     (status, out) = commands.getstatusoutput(compile_command)
 
     if 0 != status:
         raise BuildError(out)
 
+    print out
 
 def compile_apps():
     for app in support.LOCAL_APPS:
diff --git a/support/run b/support/run
deleted file mode 100755
index 1806f49..0000000
--- a/support/run
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-erl -pa /usr/local/erlware/application_packages/5.6.3/lib/sgte-0.7.1/ebin \
-  -pa _build/development/apps/etask-0.5.0/ebin  -pa \
- _build/development/apps/sinan-0.10.0.13/ebin -pa \
- _build/development/apps/sinan_web_api-0.1.0.4/ebin \
- -pa ../fconf/_build/development/apps/fconf-0.3.0.0/ebin \
- -pa ../ktuo/_build/development/apps/ktuo-0.4.0.1/ebin \
-  -pa ../crary/_build/development/apps/crary-0.2.3/ebin \
- -pa /usr/local/erlware/application_packages/5.6.3/lib/eunit-2.0/ebin\
-  -pa /usr/local/erlware/application_packages/5.6.3/lib/ibrowse-1.4/ebin\
- -pa ../erlware/_build/development/apps/cryptographic-0.2.0/ebin -pa \
- ../erlware/_build/development/apps/ewlib-0.7.4.0/ebin -pa \
- ../erlware/_build/development/apps/ewrepo-0.16.6.1/ebin -pa \
- ../uri/_build/development/apps/uri-0.1.0/ebin -pa \
- ../erlware/_build/development/apps/gas-5.1.0/ebin -pa\
- /usr/local/erlware/application_packages/5.6.3/lib/gtime-0.9.4/ebin\
-
diff --git a/support/run.py b/support/run.py
new file mode 100755
index 0000000..617dbe3
--- /dev/null
+++ b/support/run.py
@@ -0,0 +1,50 @@
+#! /usr/bin/python
+"""Support for building sinan, bootstraping it on a new version of erlang"""
+
+
+import sys
+import os
+import commands
+import support
+from optparse import OptionParser
+
+def get_ebin(app):
+   return "_build/development/apps/%s-%s/ebin" % (app[0], app[1])
+
+def run_app():
+    local_pa = '-pa'.join([get_ebin(app) for app in support.LOCAL_APPS])
+    run = ("%s %s %s -run sinan_web_api start " %
+                       (' '.join(map(support.generate_local_path,
+                                     support.LOCAL_APPS)),
+                        ' '.join(map(support.generate_erlware_path,
+                                     support.ERLWARE_APPS)),
+                        local_pa))
+
+    return run
+
+def main():
+    parser = OptionParser()
+    parser.add_option("-e", "--erlware",
+                      dest="erlware",
+                      type="string",
+                      default="/usr/local/erlware",
+                      help="The location of Erlware")
+
+    (options, args) = parser.parse_args()
+
+    support.ERLWARE_PATH = options.erlware
+
+    run = run_app()
+
+    args = filter(lambda a: a != "", ["erl"] + run.split(" "))
+
+    print "erl ", args
+
+    os.execvp("erl", args)
+
+    if 0 != status:
+        raise BuildError(out)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/support/support.py b/support/support.py
new file mode 100755
index 0000000..adfe814
--- /dev/null
+++ b/support/support.py
@@ -0,0 +1,60 @@
+"""Support for building sinan, bootstraping it on a new version of erlang"""
+
+
+import sys
+import os
+import commands
+from optparse import OptionParser
+
+class BuildError(Exception):
+    def __init__(self, value):
+        self.value = value
+    def __str__(self):
+        return repr(self.value)
+
+ERTS_VERSION = "5.6.3"
+
+BUILD_PATH = "_build/development/apps/%s/ebin"
+
+ERLWARE_PATH = "/usr/local/erlware"
+
+ERLC = "erlc +debug_info "
+
+LOCAL_APPS = [("etask", "0.5.0"),
+              ("sinan", "0.11.0.0"),
+              ("sinan_web_api", "0.1.0.4")]
+
+ERLWARE_APPS = ["fconf-0.3.0.0",
+                "ktuo-0.4.0.1",
+                "crary-0.2.3",
+                "eunit-2.0",
+                "cryptographic-0.2.1",
+                "ewlib-0.8.2.0",
+                "ewrepo-0.19.0.0",
+                "gas-6.1.1",
+                "kernel-2.12.3",
+                "ibrowse-1.4",
+                "uri-0.2.0",
+                "sgte-0.7.1",
+                "gtime-0.9.4",
+                "asn1-1.5.2"]
+
+
+def generate_local_path(app):
+    ebin = "_build/development/apps/%s-%s/ebin" % (app[0], app[1])
+    include = "_build/development/apps/%s-%s/include" % (app[0], app[1])
+
+    if not os.path.isdir(ebin):
+        raise BuildError(ebin + " is not a directory")
+
+    return " -pa %s -I %s " % (ebin, include)
+
+def generate_erlware_path(path):
+    ebin = "%s/packages/%s/lib/%s/ebin" % (ERLWARE_PATH, ERTS_VERSION, path)
+    include = "%s/packages/%s/lib/%s/include" % (ERLWARE_PATH, ERTS_VERSION, 
path)
+
+    if not os.path.isdir(ebin):
+        raise BuildError(ebin + " is not a directory")
+
+
+    return " -pa %s -I %s " % (ebin, include)
-- 
1.6.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlware-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/erlware-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to