Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 409c48ee7ed224bad18e09daa12c9f26 > files > 1

java-1.5.0-gcj-1.5.0.0-17.1.7mdv2009.0.src.rpm

--- java-gcj-compat-1.0.76/aot-compile-rpm	5 Sep 2006 15:04:01 -0000	1.4
+++ java-gcj-compat-1.0.76/aot-compile-rpm	12 Oct 2007 08:05:58 -0000
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-## Copyright (C) 2005, 2006 Red Hat, Inc.
+## Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
 ## Written by Gary Benson <gbenson@redhat.com>
 ##
 ## This program is free software; you can redistribute it and/or modify
@@ -28,6 +28,12 @@
         raise aotcompile.Error, "%s: unexpected output" % cmd
     return dir
 
+def copy(srcdir, dstdir, suffix):
+    srcdir = os.path.join(srcdir, suffix.lstrip(os.sep))
+    dstdir = os.path.join(dstdir, suffix.lstrip(os.sep))
+    os.makedirs(os.path.dirname(dstdir))
+    aotcompile.system(("/bin/cp", "-a", srcdir, dstdir))
+
 try:
     name = os.environ.get("RPM_PACKAGE_NAME")
     if name is None:
@@ -38,9 +44,12 @@
     srcdir = os.environ.get("RPM_BUILD_ROOT")
     if srcdir in (None, "/"):
         raise aotcompile.Error, "bad $RPM_BUILD_ROOT"
+    tmpdir = os.path.join(os.getcwd(), "aot-compile-rpm")
+    #if os.path.exists(tmpdir):
+    #    raise aotcompile.Error, "%s exists" % tmpdir
     dstdir = os.path.join(libdir(), "gcj", name)
 
-    compiler = aotcompile.Compiler(srcdir, dstdir, srcdir)
+    compiler = aotcompile.Compiler(srcdir, dstdir, tmpdir)
     compiler.gcjflags[0:0] = os.environ.get("RPM_OPT_FLAGS", "").split() 
 
     # XXX: This script should not accept options, because having
@@ -64,6 +73,7 @@
         sys.exit(1)
 
     compiler.compile()
+    copy(tmpdir, srcdir, dstdir)
 
 except aotcompile.Error, e:
     print >>sys.stderr, "%s: error: %s" % (