diff options
author | Brent Eagles <brent@zeroc.com> | 2006-09-25 18:04:10 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2006-09-25 18:04:10 +0000 |
commit | bcc28a30b10a939e29acda1a3efdb5a17a9f5ce6 (patch) | |
tree | 9b4e22fa1993e25597a13ddd4b3411f22c7d56d4 /cpp | |
parent | minor edits (diff) | |
download | ice-bcc28a30b10a939e29acda1a3efdb5a17a9f5ce6.tar.bz2 ice-bcc28a30b10a939e29acda1a3efdb5a17a9f5ce6.tar.xz ice-bcc28a30b10a939e29acda1a3efdb5a17a9f5ce6.zip |
Merging several fixes from the R3_1_branch
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/RPMTools.py | 16 | ||||
-rwxr-xr-x | cpp/makebindist.py | 106 |
2 files changed, 100 insertions, 22 deletions
diff --git a/cpp/RPMTools.py b/cpp/RPMTools.py index 6ddb4731604..427de7ad442 100644 --- a/cpp/RPMTools.py +++ b/cpp/RPMTools.py @@ -665,13 +665,14 @@ def writeUnpackingCommands(ofile, version): # files in place with sed. # sed -i -e 's/^prefix.*$/prefix = $\(RPM_BUILD_ROOT\)/' $RPM_BUILD_DIR/Ice-%{version}/config/Make.rules -%setup -q -n IceJ-%{version} -T -D -b 1 +%setup -q -n IceJ-%{version}-java2 -T -D -b 1 %setup -q -n IcePy-%{version} -T -D -b 2 sed -i -e 's/^prefix.*$/prefix = $\(RPM_BUILD_ROOT\)/' $RPM_BUILD_DIR/IcePy-%{version}/config/Make.rules %setup -q -n IceCS-%{version} -T -D -b 3 sed -i -e 's/^prefix.*$/prefix = $\(RPM_BUILD_ROOT\)/' $RPM_BUILD_DIR/IceCS-%{version}/config/Make.rules.cs sed -i -e 's/^cvs_build.*$/cvs_build = no/' $RPM_BUILD_DIR/IceCS-%{version}/config/Make.rules.cs %setup -q -n Ice-%{version}-demos -T -D -b 4 +%setup -q -n IceJ-%{version}-java5 -T -D -b 11 cd $RPM_BUILD_DIR tar xfz $RPM_SOURCE_DIR/IcePHP-%{version}.tar.gz tar xfj $RPM_SOURCE_DIR/php-5.1.4.tar.bz2 @@ -714,15 +715,15 @@ if test ! -d $RPM_BUILD_ROOT/lib; then mkdir -p $RPM_BUILD_ROOT/lib fi -cp -p $RPM_BUILD_DIR/IceJ-%{version}/lib/Ice.jar $RPM_BUILD_ROOT/lib/Ice.jar +cp -p $RPM_BUILD_DIR/IceJ-%{version}-java2/lib/Ice.jar $RPM_BUILD_ROOT/lib/Ice.jar if test ! -d $RPM_BUILD_ROOT/lib/java5; then mkdir -p $RPM_BUILD_ROOT/lib/java5 fi -cp -p $RPM_BUILD_DIR/IceJ-%{version}/lib/Ice.jar $RPM_BUILD_ROOT/lib/java5/Ice.jar -cp -p $RPM_BUILD_DIR/IceJ-%{version}/lib/IceGridGUI.jar $RPM_BUILD_ROOT/lib/IceGridGUI.jar -cp -pR $RPM_BUILD_DIR/IceJ-%{version}/ant $RPM_BUILD_ROOT +cp -p $RPM_BUILD_DIR/IceJ-%{version}-java5/lib/Ice.jar $RPM_BUILD_ROOT/lib/java5/Ice.jar +cp -p $RPM_BUILD_DIR/IceJ-%{version}-java2/lib/IceGridGUI.jar $RPM_BUILD_ROOT/lib/IceGridGUI.jar +cp -pR $RPM_BUILD_DIR/IceJ-%{version}-java2/ant $RPM_BUILD_ROOT cd $RPM_BUILD_DIR/IcePy-%{version} gmake ICE_HOME=$RPM_BUILD_DIR/Ice-%{version} RPM_BUILD_ROOT=$RPM_BUILD_ROOT install cd $RPM_BUILD_DIR/IceCS-%{version} @@ -772,8 +773,9 @@ def writeTransformCommands(ofile, version): if os.path.dirname(dest) <> '' and source.split('/')[0] == dest.split('/')[0]: ofile.write('# Rule 2\n') ofile.write('mkdir -p $RPM_BUILD_ROOT/arraftmp\n') - ofile.write('mv $RPM_BUILD_ROOT/usr/' + source + ' $RPM_BUILD_ROOT/arraftmp/' + source + '\n') - ofile.write('mkdir -p $RPM_BUILD_ROOT/usr/' + os.path.dirname(dest) + '\n') + ofile.write('mkdir -p $RPM_BUILD_ROOT/arraftmp/%s\n' % os.path.dirname(source)) + ofile.write('mv $RPM_BUILD_ROOT/' + source + ' $RPM_BUILD_ROOT/arraftmp/' + source + '\n') + ofile.write('mkdir -p $RPM_BUILD_ROOT/' + os.path.dirname(dest) + '\n') ofile.write('mv $RPM_BUILD_ROOT/arraftmp/' + source + ' $RPM_BUILD_ROOT/' + dest + '\n') ofile.write('rm -rf $RPM_BUILD_ROOT/arraftmp\n') elif os.path.dirname(dest) <> '': diff --git a/cpp/makebindist.py b/cpp/makebindist.py index 01179054c27..00b1dc8df02 100755 --- a/cpp/makebindist.py +++ b/cpp/makebindist.py @@ -344,11 +344,64 @@ prefix = $(ICE_DIR) if line.startswith('prefix'): state = 'done' # - # Dependency files are all going to be bogus. The makedepend - # script doesn't seem to work properly for the slice files. + # Dependency files are all going to be bogus since they contain relative + # paths to Ice headers. We need to adjust this. + # + # XXX: The following will not work for demos not in demo/A/B type dir # os.chdir("..") - runprog("sh -c 'for f in `find . -name .depend` ; do echo \"\" > $f ; done'") + runprog("for f in `find . -name .depend` ; do sed -i -e 's/\.\.\/\.\.\/\.\./$(ICE_DIR)/g' $f ; done") + makefile.close() + +def editMakeRulesMak(filename, version): + ''' + Ice distributions contain files with useful build rules. However, + these rules are source distribution specific. This script edits + these files to make them appropriate to accompany binary + distributions. + ''' + state = 'header' + reIceLocation = re.compile('^[a-z]*dir.*=\s*\$\(top_srcdir\)') + + makefile = fileinput.input(filename, True) + for line in makefile: + if state == 'done': + if reIceLocation.search(line) <> None: + output = line.rstrip('\n').replace('top_srcdir', 'ICE_DIR', 10) + print output + elif line.startswith('install_'): + # + # Do nothing. + # + pass + else: + print line.rstrip('\n') + elif state == 'header': + # + # Reading header. + # + print line.rstrip('\n') + if line.strip() == "": + state = 'untilprefix' + print """ +# +# Checks for ICE_HOME environment variable. +# + +!if "$(ICE_HOME)" == "" +all:: + @echo Ice distribution not found, please set ICE_HOME! + @exit 1 +!endif + +ICE_DIR = $(ICE_HOME) +prefix = $(ICE_DIR) + +""" + elif state == 'untilprefix': + if line.startswith('prefix'): + state = 'done' + makefile.close() def updateIceVersion(filename, version): @@ -377,7 +430,7 @@ def extractDemos(sources, buildDir, version, distro, demoDir): # be nicer to make the toExtract list more tailored for each # distribution. # - toExtract = "%s/demo %s/config %s/certs" % (distro, distro, distro) + toExtract = "%s/demo %s/config %s/certs ICE_LICENSE" % (distro, distro, distro) runprog("gzip -dc " + sources + "/" + distro + ".tar.gz | tar xf - " + toExtract, False) @@ -431,6 +484,7 @@ def extractDemos(sources, buildDir, version, distro, demoDir): if distro.startswith('Ice-'): editMakeRules(os.path.join(basepath, 'Make.rules'), version) + editMakeRulesMak(os.path.join(basepath, 'Make.rules.mak'), version) elif distro.startswith('IceCS-'): editMakeRulesCS(os.path.join(basepath, 'Make.rules.cs'), version) @@ -444,6 +498,11 @@ def extractDemos(sources, buildDir, version, distro, demoDir): def archiveDemoTree(buildDir, version, installFiles): cwd = os.getcwd() + os.chdir(os.path.join(buildDir, 'Ice-%s-demos' % version)) + filesToRemove = ['certs/makecerts.py', 'certs/ImportKey.java', 'certs/ImportKey.class', 'certs/seed.dat', + 'config/convertssl.py', 'config/upgradeicegrid.py', 'config/PropertyNames.def', 'config/makeprops.py', + 'config/TestUtil.py', 'config/IceGridAdmin.py', 'config/ice_ca.cnf', 'config/icegridgui.pro'] + obliterate(filesToRemove) os.chdir(buildDir) # @@ -463,7 +522,7 @@ def archiveDemoTree(buildDir, version, installFiles): runprog("sh -c 'for f in `find Ice-" + version + "-demos -name \"*\.dsw\" ` ; do rm -rf $f ; done'") runprog("sh -c 'for f in `find Ice-" + version + "-demos/democs -name \"*.sln\" ` ; do rm -rf $f ; done'") runprog("sh -c 'for f in `find Ice-" + version + "-demos/democs -name \"*.csproj\" ` ; do rm -rf $f ; done'") - + runprog("tar cf Ice-" + version + "-demos.tar Ice-" + version + "-demos") runprog("gzip -9 Ice-" + version + "-demos.tar") os.chdir(cwd) @@ -490,11 +549,8 @@ def makeInstall(sources, buildDir, installDir, distro, clean, version): if distro.startswith('IceJ'): if not os.path.exists(os.path.join(installDir, 'lib')): os.mkdir(os.path.join(installDir, 'lib')) - if not os.path.exists(os.path.join(installDir, 'lib', 'java5')): - os.mkdir(os.path.join(installDir, 'lib', 'java5')) shutil.copy(buildDir + '/' + distro + '/lib/Ice.jar', installDir + '/lib') shutil.copy(buildDir + '/' + distro + '/lib/IceGridGUI.jar', installDir + '/lib') - shutil.copy(buildDir + '/' + distro + '/lib/java5/Ice.jar', installDir + '/lib/java5') # # We really just want to copy the files, not move them. # Shelling out to a copy is easier (and more likely to always @@ -805,9 +861,9 @@ def makePHPbinary(sources, buildDir, installDir, version, clean): print line.rstrip('\n') + ' -DCOMPILE_DL_ICE' elif line.startswith('ICE_SHARED_LIBADD'): if platform == 'linux64': - print "ICE_SHARED_LIBADD = -Wl,-rpath,/opt/Ice-%s/lib64 -L/opt/Ice-%s/lib64 -lIce -lSlice -lIceUtil" % (version, version) + print "ICE_SHARED_LIBADD = -Wl,-rpath,/opt/Ice-%s/lib64 -L%s/Ice-%s/lib64 -lIce -lSlice -lIceUtil" % (version, buildDir, version) else: - print "ICE_SHARED_LIBADD = -Wl,-rpath,/opt/Ice-%s/lib -L/opt/Ice-%s/lib -lIce -lSlice -lIceUtil" % (version, version) + print "ICE_SHARED_LIBADD = -Wl,-rpath,/opt/Ice-%s/lib -L%s/Ice-%s/lib -lIce -lSlice -lIceUtil" % (version, buildDir, version) else: print line.strip('\n') @@ -885,6 +941,11 @@ def usage(): print ' If this is omitted makebindist will traverse' print ' ../icej ../icepy ../icecs, etc and make the' print ' distributions for you.' + print ' (Note: makedist.py seems to only work on Linux.' + print ' To use makebindist.py on other UNIX platforms,' + print ' you must copy pre-made source distributions onto' + print ' the host and use this option to reference their' + print ' location.' print '-v, --verbose Print verbose processing messages.' print '-t, --tag Specify the CVS version tag for the packages.' print '--noclean Do not clean up current sources where' @@ -1038,7 +1099,6 @@ def main(): RPMTools.createFullSpecFile(sys.stdout, installDir, version, soVersion) sys.exit(0) - # # We need to clean the directory out to keep obsolete files from # being installed. This needs to happen whether we are running with @@ -1098,15 +1158,19 @@ def main(): if build and not cvsMode: collectSources = False if sources == None: + if not getPlatform().startswith("linux"): + print "makedist.py is not supported on non-Linux platforms. Create the source" + print "distributions on a Linux box, copy them to a location on this host and" + print "specify their location with the --sources argument" sources = buildDir + '/sources' collectSources = clean # # Ice must be first or building the other source distributions will fail. # - sourceTarBalls = [ ('ice', 'Ice-' + version, ''), - ('icephp','IcePHP-' + version, 'php'), - ('icej','IceJ-' + version, 'j') ] + sourceTarBalls = [ ('ice', 'Ice-%s' % version, ''), + ('icephp','IcePHP-%s' % version, 'php'), + ('icej','IceJ-%s-java2' % version, 'j') ] if not getPlatform() in ['aix', 'solaris', 'hpux']: sourceTarBalls.append(('icepy','IcePy-' + version, 'py')) @@ -1150,7 +1214,7 @@ def main(): for cvs, tarball, demoDir in toCollect: extractDemos(sources, buildDir, version, tarball, demoDir) shutil.copy("%s/unix/README.DEMOS" % installFiles, "%s/Ice-%s-demos/README.DEMOS" % (buildDir, version)) - shutil.copy("%s/Ice-%s/ICE_LICENSE" % (buildDir, version), "%s/Ice-%s-demos/ICE_LICENSE" % (buildDir, version)) + # shutil.copy("%s/Ice-%s/ICE_LICENSE" % (buildDir, version), "%s/Ice-%s-demos/ICE_LICENSE" % (buildDir, version)) archiveDemoTree(buildDir, version, installFiles) shutil.move("%s/Ice-%s-demos.tar.gz" % (buildDir, version), "%s/Ice-%s-demos.tar.gz" % (installDir, version)) @@ -1160,6 +1224,18 @@ def main(): for cvs, tarball, demoDir in sourceTarBalls: makeInstall(sources, buildDir, "%s/Ice-%s" % (installDir, version), tarball, clean, version) + # + # XXX- put java5 Ice.jar in place! + # + prevDir = os.getcwd() + os.chdir("%s/Ice-%s/lib" % (installDir, version)) + os.mkdir("java5") + os.chdir("java5") + os.system("gzip -dc %s/IceJ-%s-java5.tar.gz | tar xf - IceJ-%s-java5/lib/Ice.jar" % (sources, version, version)) + shutil.move("IceJ-%s-java5/lib/Ice.jar" % version, "Ice.jar") + shutil.rmtree("IceJ-%s-java5" % version) + os.chdir(prevDir) + elif cvsMode: collectSources = False |