summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.mak2
-rw-r--r--config/Make.common.rules32
-rw-r--r--config/Make.common.rules.mak20
-rwxr-xr-xconfig/convertssl.py195
-rw-r--r--config/templates.xml105
-rw-r--r--cpp/Makefile33
-rw-r--r--cpp/Makefile.mak17
-rw-r--r--cpp/config/Make.rules2
-rwxr-xr-xcpp/config/Make.rules.mak4
-rw-r--r--cpp/doc/Makefile41
-rwxr-xr-xcpp/makedist.py439
-rw-r--r--cs/Makefile21
-rw-r--r--cs/Makefile.mak25
-rw-r--r--cs/config/Make.rules.cs6
-rw-r--r--cs/config/Make.rules.mak.cs1
-rw-r--r--java/Makefile9
-rwxr-xr-xjava/Makefile.mak9
-rw-r--r--java/build.xml40
-rw-r--r--java/config/build.properties19
-rw-r--r--java/config/common.xml18
-rwxr-xr-xjava/makedist.py334
-rwxr-xr-xmakedist382
-rwxr-xr-xmakedist.py610
-rw-r--r--php/Makefile23
-rwxr-xr-xphp/Makefile.mak19
-rwxr-xr-xphp/makedist.py147
-rw-r--r--py/Makefile12
-rwxr-xr-xpy/Makefile.mak19
-rwxr-xr-xpy/makedist.py170
-rw-r--r--rb/Makefile23
-rwxr-xr-xrb/Makefile.mak19
-rwxr-xr-xrb/makedist.py159
-rwxr-xr-xvb/makedist.py198
34 files changed, 778 insertions, 2377 deletions
diff --git a/Makefile b/Makefile
index 5aad8ceb685..03e61ca875c 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
SUBDIRS = cpp java cs py rb php
CLEAN_SUBDIRS = java cs py rb php cpp
DEPEND_SUBDIRS = cpp cs py rb php
-INSTALL_SUBDIRS = cpp cs py rb php
+INSTALL_SUBDIRS = cpp java cs py rb php
all::
@for subdir in $(SUBDIRS); \
diff --git a/Makefile.mak b/Makefile.mak
index 8aef01a4802..12a4d29bf09 100644
--- a/Makefile.mak
+++ b/Makefile.mak
@@ -13,7 +13,7 @@ top_srcdir = cpp
SUBDIRS = cpp java py
CLEAN_SUBDIRS = java py cpp
DEPEND_SUBDIRS = cpp py
-INSTALL_SUBDIRS = cpp py
+INSTALL_SUBDIRS = cpp java py
!if "$(CPP_COMPILER)" == "VC60"
SUBDIRS = $(SUBDIRS) php rb
diff --git a/config/Make.common.rules b/config/Make.common.rules
index 028a40db7c1..a58e39c25c8 100644
--- a/config/Make.common.rules
+++ b/config/Make.common.rules
@@ -161,6 +161,8 @@ else
slicedir = $(ice_dir)/slice
endif
+install_slicedir = $(prefix)/slice
+
#
# Set environment variables for the Slice translator.
#
@@ -251,3 +253,33 @@ ifeq ($(mkdir),)
chmod a+rx $(1)
endif
+all::
+
+install-common::
+ @if test ! -d $(prefix) ; \
+ then \
+ echo "Creating $(prefix)..." ; \
+ $(call mkdir,$(prefix)) ; \
+ fi
+
+ @if test ! -d $(install_slicedir) ; \
+ then \
+ echo "Creating $(install_slicedir)..." ; \
+ $(call mkdir,$(install_slicedir)) ; \
+ cd $(top_srcdir)/../slice ; \
+ for subdir in * ; \
+ do \
+ echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
+ cp -fpr $$subdir $(install_slicedir) ; \
+ done ; \
+ fi
+
+ @if test ! -f $(prefix)/ICE_LICENSE ; \
+ then \
+ $(call installdata,$(top_srcdir)/../ICE_LICENSE,$(prefix)) ; \
+ fi
+
+ @if test ! -f $(prefix)/LICENSE ; \
+ then \
+ $(call installdata,$(top_srcdir)/../LICENSE,$(prefix)) ; \
+ fi
diff --git a/config/Make.common.rules.mak b/config/Make.common.rules.mak
index b8018869c95..67e35b7f399 100644
--- a/config/Make.common.rules.mak
+++ b/config/Make.common.rules.mak
@@ -95,7 +95,7 @@ ice_dir = $(ICE_HOME)
!elseif exist ($(top_srcdir)/bin/$(slice_translator))
ice_dir = $(top_srcdir)
!elseif exist ("C:\Ice-$(VERSION)\bin\$(slice_translator)")
-ice_dir = "C:\Ice-$(VERSION)"
+ice_dir = C:\Ice-$(VERSION)
!endif
!if "$(ice_dir)" == ""
@@ -123,3 +123,21 @@ ice_cpp_header = $(ice_dir)\include\Ice\Config.h
#
slicedir = $(ice_dir)\slice
+install_slicedir = $(prefix)\slice
+
+all::
+
+install-common::
+ @if not exist $(prefix) \
+ @echo "Creating $(prefix)..." && \
+ mkdir $(prefix)
+
+ @if not exist $(install_slicedir) \
+ @echo "Creating $(install_slicedir)..." && \
+ mkdir $(install_slicedir) \
+ @echo "Copying slice files..." && \
+ cmd /c "xcopy /s /y ..\slice $(install_slicedir)" || exit 1
+
+ @copy ..\ICE_LICENSE $(prefix)
+ @copy ..\LICENSE $(prefix)
+
diff --git a/config/convertssl.py b/config/convertssl.py
deleted file mode 100755
index 43784992a50..00000000000
--- a/config/convertssl.py
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-#
-# This script converts an XML configuration file for earlier versions of
-# the IceSSL plugin to the new property format in 3.1.
-#
-# Usage:
-#
-# python convertssl.py myconfig.xml
-#
-# The equivalent properties are printed to standard output. If any
-# compatibility issues are detected, a NOTE comment is emitted.
-#
-
-import sys, xml.dom, xml.dom.minidom
-
-#
-# Show usage information.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " xmlfile"
- print
- print "Options:"
- print "-h Show this message."
-
-def isCygwin():
- # The substring on sys.platform is required because some cygwin
- # versions return variations like "cygwin_nt-4.01".
- return sys.platform[:6] == "cygwin"
-
-def isWin32():
- return sys.platform == "win32" or isCygwin()
-
-if isWin32():
- sep = ";"
-else:
- sep = ":"
-
-def findChild(parent, name):
- for i in parent.childNodes:
- if i.localName == name:
- return i
- return None
-
-def printConfig(node, name, comment=""):
- prefix = comment + "IceSSL."
- result = "# These properties were converted from the " + name + " configuration.\n"
- result = result + "#\n# NOTE: You may need to define IceSSL.DefaultDir\n"
- general = findChild(node, "general")
- if general:
- if general.attributes.has_key("version"):
- version = general.attributes["version"].nodeValue
- if version == "SSLv3":
- result = result + prefix + "Protocols=SSLv3\n"
- elif version == "TLSv1":
- result = result + prefix + "Protocols=TLSv1\n"
- elif version != "SSLv23":
- print "unknown value `" + version + "' for version attribute"
- sys.exit(1)
-
- if general.attributes.has_key("cipherlist"):
- result = result + prefix + "Ciphers=" + general.attributes["cipherlist"].nodeValue + "\n"
-
- if general.attributes.has_key("verifymode"):
- verifymode = general.attributes["verifymode"].nodeValue
- if verifymode == "none":
- result = result + prefix + "VerifyPeer=0\n"
- elif verifymode == "peer":
- result = result + prefix + "VerifyPeer=1\n"
- elif verifymode.find("fail") != -1:
- result = result + prefix + "VerifyPeer=2\n"
- elif verifymode.find("client_once") != -1:
- result = result + prefix + "VerifyPeer=2\n"
- else:
- print "unknown value `" + verifymode + "' for verifymode attribute"
- sys.exit(1)
-
- if general.attributes.has_key("verifydepth"):
- result = result + prefix + "VerifyDepthMax=" + general.attributes["verifydepth"].nodeValue + "\n"
-
- if general.attributes.has_key("randombytes"):
- result = result + "# NOTE: You may need to use IceSSL.EntropyDaemon\n"
- result = result + prefix + "Random=" + general.attributes["randombytes"].nodeValue + "\n"
-
- ca = findChild(node, "certauthority")
- if ca:
- if ca.attributes.has_key("file"):
- result = result + prefix + "CertAuthFile=" + ca.attributes["file"].nodeValue + "\n"
- if ca.attributes.has_key("path"):
- result = result + prefix + "CertAuthDir=" + ca.attributes["path"].nodeValue + "\n"
-
- basecerts = findChild(node, "basecerts")
- if basecerts:
- certFile = ""
- keyFile = ""
- rsacert = findChild(basecerts, "rsacert")
- if rsacert:
- pub = findChild(rsacert, "public")
- if pub.attributes.has_key("encoding"):
- if pub.attributes["encoding"].nodeValue != "PEM":
- result = result + "# NOTE: Only PEM encoding is supported for certificates!\n"
- if pub.attributes.has_key("filename"):
- certFile = pub.attributes["filename"].nodeValue
- priv = findChild(rsacert, "private")
- if priv.attributes.has_key("encoding"):
- if priv.attributes["encoding"].nodeValue != "PEM":
- result = result + "# NOTE: Only PEM encoding is supported for private keys!\n"
- if priv.attributes.has_key("filename"):
- keyFile = priv.attributes["filename"].nodeValue
- dsacert = findChild(basecerts, "dsacert")
- if dsacert:
- pub = findChild(dsacert, "public")
- if pub.attributes.has_key("encoding"):
- if pub.attributes["encoding"].nodeValue != "PEM":
- result = result + "# NOTE: Only PEM encoding is supported for certificates!\n"
- if pub.attributes.has_key("filename"):
- if len(certFile) > 0:
- certFile = certFile + sep + pub.attributes["filename"].nodeValue
- else:
- certFile = pub.attributes["filename"].nodeValue
- priv = findChild(rsacert, "private")
- if priv.attributes.has_key("encoding"):
- if priv.attributes["encoding"].nodeValue != "PEM":
- result = result + "# NOTE: Only PEM encoding is supported for private keys!\n"
- if priv.attributes.has_key("filename"):
- if len(keyFile) > 0:
- keyFile = keyFile + sep + priv.attributes["filename"].nodeValue
- else:
- keyFile = priv.attributes["filename"].nodeValue
- if len(certFile) > 0:
- result = result + prefix + "CertFile=" + certFile + "\n"
- if len(keyFile) > 0:
- result = result + prefix + "KeyFile=" + keyFile + "\n"
-
- for child in basecerts.childNodes:
- if child.localName == "dhparams":
- keysize = child.attributes["keysize"].nodeValue
- if child.attributes.has_key("encoding"):
- if child.attributes["encoding"].nodeValue != "PEM":
- result = result + "# NOTE: Only PEM encoding is supported for DH parameters!\n"
- filename = child.attributes["filename"].nodeValue
- result = result + prefix + "DH." + keysize + "=" + filename + "\n"
-
- return result
-
-#
-# Check arguments
-#
-xmlfile = None
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
- else:
- if xmlfile:
- usage()
- sys.exit(1)
- xmlfile = x
-
-if not xmlfile:
- usage()
- sys.exit(1)
-
-f = open(xmlfile, 'r')
-doc = xml.dom.minidom.parse(f)
-f.close()
-
-config = findChild(doc, "SSLConfig")
-if not config:
- print sys.argv[0] + ": unable to find element SSLConfig"
- sys.exit(1)
-
-client = findChild(config, "client")
-server = findChild(config, "server")
-output = None
-if client and server:
- print printConfig(client, "Client")
- print printConfig(server, "Server", "#")
-elif client:
- print printConfig(client, "Client")
-elif server:
- print printConfig(server, "Server")
diff --git a/config/templates.xml b/config/templates.xml
deleted file mode 100644
index b2b76096383..00000000000
--- a/config/templates.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<!--
- **********************************************************************
-
- Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-
- This copy of Ice is licensed to you under the terms described in the
- ICE_LICENSE file included in this distribution.
-
- **********************************************************************
--->
-
-<icegrid>
- <application name="Templates">
-
- <server-template id="IcePatch2">
-
- <parameter name="instance-name" default="${application}.IcePatch2"/>
- <parameter name="endpoints" default="default"/>
- <parameter name="directory"/>
-
- <server id="${instance-name}" exe="icepatch2server" application-distrib="false" activation="on-demand">
-
- <adapter name="IcePatch2" endpoints="${endpoints}">
- <object identity="${instance-name}/server" type="::IcePatch2::FileServer"/>
- </adapter>
-
- <properties>
- <property name="IcePatch2.InstanceName" value="${instance-name}"/>
- <property name="IcePatch2.Directory" value="${directory}"/>
- </properties>
- </server>
-
- </server-template>
-
-
- <server-template id="Glacier2">
-
- <parameter name="instance-name" default="${application}.Glacier2"/>
- <parameter name="client-endpoints"/>
- <parameter name="server-endpoints"/>
- <parameter name="session-timeout" default="0"/>
-
- <server id="${instance-name}" exe="glacier2router">
- <properties>
- <property name="Glacier2.Client.Endpoints" value="${client-endpoints}"/>
- <property name="Glacier2.Server.Endpoints" value="${server-endpoints}"/>
- <property name="Glacier2.InstanceName" value="${instance-name}"/>
- <property name="Glacier2.SessionTimeout" value="${session-timeout}"/>
- </properties>
- </server>
-
- </server-template>
-
-
- <service-template id="IceStorm">
-
- <parameter name="instance-name" default="${application}.IceStorm"/>
- <parameter name="index" default=""/>
- <parameter name="topic-manager-endpoints" default="default"/>
- <parameter name="publish-endpoints" default="default"/>
- <parameter name="flush-timeout" default="1000"/>
-
- <service name="IceStorm${index}" entry="IceStormService,33:createIceStorm">
-
- <dbenv name="${service}"/>
-
- <adapter name="${service}.TopicManager"
- id="${instance-name}.TopicManager"
- endpoints="${topic-manager-endpoints}">
- <object identity="${instance-name}/TopicManager" type="::IceStorm::TopicManager"/>
- </adapter>
-
- <adapter name="${service}.Publish"
- id="${instance-name}.Publish"
- endpoints="${publish-endpoints}"/>
-
- <properties>
- <property name="${service}.InstanceName" value="${instance-name}"/>
- <property name="${service}.Flush.Timeout" value="${flush-timeout}"/>
- </properties>
- </service>
-
- </service-template>
-
-
- <server-template id="IceStorm">
-
- <parameter name="instance-name" default="${application}.IceStorm"/>
- <parameter name="topic-manager-endpoints" default="default"/>
- <parameter name="publish-endpoints" default="default"/>
- <parameter name="flush-timeout" default="1000"/>
-
- <icebox id="${instance-name}" exe="icebox" activation="on-demand">
- <service-instance template="IceStorm"
- instance-name="${instance-name}"
- topic-manager-endpoints="${topic-manager-endpoints}"
- publish-endpoints="${publish-endpoints}"
- flush-timeout="${flush-timeout}"/>
- </icebox>
-
- </server-template>
-
- </application>
-</icegrid>
-
diff --git a/cpp/Makefile b/cpp/Makefile
index ebbf69df8d3..060fadb7e7f 100644
--- a/cpp/Makefile
+++ b/cpp/Makefile
@@ -13,14 +13,9 @@ include $(top_srcdir)/config/Make.rules
SUBDIRS = config src include test demo doc
-INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_slicedir) $(install_docdir)
+INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_docdir)
-install::
- @if test ! -d $(prefix) ; \
- then \
- echo "Creating $(prefix)..." ; \
- $(call mkdir,$(prefix)) ; \
- fi
+install:: install-common
ifneq ($(embedded_runpath_prefix),)
@if test -h $(embedded_runpath_prefix) ; \
then \
@@ -40,13 +35,6 @@ endif
fi ; \
done
- cd ../slice ; \
- for subdir in * ; \
- do \
- echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
- cp -fpr $$subdir $(install_slicedir) ; \
- done ;
-
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
do \
@@ -54,22 +42,5 @@ $(EVERYTHING)::
( cd $$subdir && $(MAKE) $@ ) || exit 1; \
done
-doc::
- @( cd doc && $(MAKE) ) || exit 1
-
-install::
- @if test -d doc ; \
- then \
- ( cd doc && $(MAKE) install ) || exit 1 ; \
- fi
- $(call installdata,ICE_LICENSE,$(prefix))
- $(call installdata,LICENSE,$(prefix))
-
-clean::
- @if test -d doc ; \
- then \
- ( cd doc && $(MAKE) clean ) || exit 1 ; \
- fi
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/cpp/Makefile.mak b/cpp/Makefile.mak
index bc98b309cfc..343fe201c37 100644
--- a/cpp/Makefile.mak
+++ b/cpp/Makefile.mak
@@ -13,15 +13,9 @@ top_srcdir = .
SUBDIRS = config src include test demo doc
-INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_slicedir) $(install_docdir)
-
-install:: createdir
-
-createdir::
- @if not exist $(prefix) \
- @echo "Creating $(prefix)..." && \
- mkdir $(prefix)
+INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_docdir)
+install:: install-common
@for %i in ( $(INSTALL_SUBDIRS) ) do \
@if not exist %i \
@echo "Creating %i..." && \
@@ -31,13 +25,6 @@ $(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-install::
- @echo "Copying slice files..." && \
- cmd /c "xcopy /s /y ..\slice $(install_slicedir)" || exit 1
-
-install::
- copy ICE_LICENSE $(prefix)
- copy LICENSE $(prefix)
test::
@python $(top_srcdir)/allTests.py
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 4536a4e97d4..35947f4f3f6 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -133,8 +133,6 @@ else
endif
install_includedir = $(prefix)/include
-install_slicedir = $(prefix)/slice
-install_schemadir = $(prefix)/schema
install_docdir = $(prefix)/doc
ifdef ice_src_dist
bindir = $(top_srcdir)/bin
diff --git a/cpp/config/Make.rules.mak b/cpp/config/Make.rules.mak
index 1e9bcfdf591..8c147dd040e 100755
--- a/cpp/config/Make.rules.mak
+++ b/cpp/config/Make.rules.mak
@@ -88,7 +88,7 @@ MT = mt.exe
ice_language = cpp
!if !exist ($(top_srcdir)\..\cpp)
# Don't check for slice2cpp in ICE_HOME if building the source distribution
-slice_translator = slice2cpp
+slice_translator = slice2cpp.exe
!endif
!if exist ($(top_srcdir)\..\config\Make.common.rules)
@@ -109,8 +109,6 @@ includedir = $(ice_dir)\include
install_bindir = $(prefix)\bin
install_includedir = $(prefix)\include
-install_slicedir = $(prefix)\slice
-install_schemadir = $(prefix)\schema
install_docdir = $(prefix)\doc
install_libdir = $(prefix)\lib
libsubdir = lib
diff --git a/cpp/doc/Makefile b/cpp/doc/Makefile
index 11c03b57af7..6d2eb1b5b50 100644
--- a/cpp/doc/Makefile
+++ b/cpp/doc/Makefile
@@ -38,27 +38,24 @@ reference/index.html: $(SLICEFILES)
clean::
-rm -rf reference/*
-install::
- @if test -f reference/index.html ; \
+install:: reference/index.html
+ @if test ! -d $(install_docdir)/reference ; \
then \
- if test ! -d $(install_docdir)/reference ; \
- then \
- echo "Creating $(install_docdir)/reference..." ; \
- $(call mkdir,$(install_docdir)/reference) ; \
- fi ; \
- echo "Installing HTML..." ; \
- $(call installdata,reference/*.*,$(install_docdir)/reference) ; \
- for i in reference/*; \
- do if test -d $$i ; \
- then \
- if test ! -d $(install_docdir)/$$i ; \
- then \
- echo "Creating $(install_docdir)/$$i..." ; \
- $(call mkdir,$(install_docdir)/$$i) ; \
- fi ; \
- echo "Installing files in $$i..." ; \
- $(call installdata,$$i/*.*,$(install_docdir)/$$i) ; \
- fi; \
- done ; \
- fi
+ echo "Creating $(install_docdir)/reference..." ; \
+ $(call mkdir,$(install_docdir)/reference) ; \
+ fi ; \
+ echo "Installing HTML..." ; \
+ $(call installdata,reference/*.*,$(install_docdir)/reference) ; \
+ for i in reference/*; \
+ do if test -d $$i ; \
+ then \
+ if test ! -d $(install_docdir)/$$i ; \
+ then \
+ echo "Creating $(install_docdir)/$$i..." ; \
+ $(call mkdir,$(install_docdir)/$$i) ; \
+ fi ; \
+ echo "Installing files in $$i..." ; \
+ $(call installdata,$$i/*.*,$(install_docdir)/$$i) ; \
+ fi; \
+ done ; \
diff --git a/cpp/makedist.py b/cpp/makedist.py
deleted file mode 100755
index 8051c63d8e4..00000000000
--- a/cpp/makedist.py
+++ /dev/null
@@ -1,439 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, glob
-
-#
-# Program usage.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- elif fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- return result
-
-#
-# Comment out rules in a Makefile.
-#
-def fixMakefile(file, target):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldMakefile = open(origfile, "r")
- newMakefile = open(file, "w")
- origLines = oldMakefile.readlines()
-
- doComment = 0
- doCheck = 0
- newLines = []
- for x in origLines:
- #
- # If the rule contains the target string, then
- # comment out this rule.
- #
- if not x.startswith("\t") and x.find(target) != -1 and x.find(target + ".o") == -1:
- doComment = 1
- #
- # If the line starts with "clean::", then check
- # the following lines and comment out any that
- # contain the target string.
- #
- elif x.startswith("clean::"):
- doCheck = 1
- #
- # Stop when we encounter an empty line.
- #
- elif len(x.strip()) == 0:
- doComment = 0
- doCheck = 0
-
- if doComment or (doCheck and x.find(target) != -1):
- x = "#" + x
- newLines.append(x)
-
- newMakefile.writelines(newLines)
- newMakefile.close()
- oldMakefile.close()
- os.remove(origfile)
-
-#
-# Remove lines containing a keyword from a file.
-#
-def editFile(file, target):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- origLines = oldFile.readlines()
-
- newLines = []
- for x in origLines:
- if x.find(target) == -1:
- newLines.append(x)
-
- newFile.writelines(newLines)
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Comment out rules in VC project.
-#
-def fixProject(file, target):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldProject = open(origfile, "r")
- newProject = open(file, "w")
- origLines = oldProject.readlines()
-
- #
- # Find a Source File declaration containing SOURCE=<target>
- # and comment out the entire declaration.
- #
- expr = re.compile("SOURCE=.*" + target.replace(".", "\\.") + ".*")
- inSource = 0
- doComment = 0
- newLines = []
- source = []
- for x in origLines:
- if x.startswith("# Begin Source File"):
- inSource = 1
-
- if inSource:
- if not doComment and expr.match(x) != None:
- doComment = 1
- source.append(x)
- else:
- newLines.append(x)
-
- if x.startswith("# End Source File"):
- inSource = 0
- for s in source:
- if doComment:
- newLines.append('#xxx#' + s)
- else:
- newLines.append(s)
- doComment = 0
- source = []
-
- newProject.writelines(newLines)
- newProject.close()
- oldProject.close()
- os.remove(origfile)
-
-#
-# Comment out implicit parser/scanner rules in config/Make.rules.
-#
-def fixMakeRules(file):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- origLines = oldFile.readlines()
-
- doComment = 0
- newLines = []
- for x in origLines:
- if x.find("%.y") != -1 or x.find("%.l") != -1:
- doComment = 1
- #
- # Stop when we encounter an empty line.
- #
- elif len(x.strip()) == 0:
- doComment = 0
-
- if doComment:
- x = "#" + x
- newLines.append(x)
-
- newFile.writelines(newLines)
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version, mmversion):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- line = oldFile.read();
- line = re.sub("@ver@", version, line)
- line = re.sub("@mmver@", mmversion, line)
- newFile.write(line)
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Check arguments
-#
-verbose = 0
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = 1
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-if os.path.exists("../.git"):
- print "ERROR: Unable to run in repository! Exiting..."
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = "dist"
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-#
-# Get Ice version.
-#
-config = open(os.path.join("include", "IceUtil", "Config.h"), "r")
-version = re.search("ICE_STRING_VERSION \"([0-9\.b]*)\"", config.read()).group(1)
-mmversion = re.search("([0-9]+\.[0-9b]+)[\.0-9]*", version).group(1)
-
-print "Creating Ice-rpmbuild..."
-rpmbuildver = os.path.join("dist", "Ice-rpmbuild-" + version)
-fixVersion(find(os.path.join("install", "rpm"), "icegridregistry.*"), version, mmversion)
-fixVersion(find(os.path.join("install", "rpm"), "icegridnode.*"), version, mmversion)
-fixVersion(find(os.path.join("install", "rpm"), "glacier2router.*"), version, mmversion)
-fixVersion(find(os.path.join("install", "rpm"), "README.RPM"), version, mmversion)
-fixVersion(find(os.path.join("install", "unix"), "THIRD_PARTY_LICENSE.Linux"), version, mmversion)
-fixVersion(find(os.path.join("install", "unix"), "README.Linux-RPM"), version, mmversion)
-fixVersion(find(os.path.join("install", "unix"), "SOURCES.Linux"), version, mmversion)
-
-if os.system("tar c" + quiet + "f " + rpmbuildver + ".tar " +
- "-C .. `[ -e RELEASE_NOTES.txt ] && echo ""RELEASE_NOTES.txt""` " +
- "-C cpp/install -C rpm {icegridregistry,icegridnode,glacier2router}.{conf,suse,redhat} README.RPM " +
- "-C ../unix THIRD_PARTY_LICENSE.Linux README.Linux-RPM SOURCES.Linux " +
- "-C ../thirdparty/php ice.ini"):
- print >> sys.stderr, "ERROR: Archiving failed"
- sys.exit(1)
-
-if os.system("gzip -9 " + rpmbuildver + ".tar"):
- print >> sys.stderr, "ERROR: Archiving failed"
- sys.exit(1)
-
-
-#
-# Create archives.
-#
-print "Creating distribution..."
-icever = "Ice-" + version
-
-print "Creating exclusion file..."
-filesToRemove = [ \
- "makedist.py", \
- "makebindist.py", \
- "iceemakedist.py", \
- "RPMTools.py", \
- "fixCopyright.py", \
- "fixVersion.py", \
- "icee.dsw", \
- "icee.dsp", \
- "allDemos.py", \
- os.path.join("config", "makegitignore.py"), \
- os.path.join("src", "icecpp", "icecppe.dsp"), \
- os.path.join("src", "IceUtil", "iceutile.dsp"), \
- os.path.join("src", "Slice", "slicee.dsp"), \
- "dist", \
- "install", \
- os.path.join("src", "slice2cppe"), \
- os.path.join("src", "slice2javae"), \
- os.path.join("exclusions")
- ]
-
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-os.mkdir(os.path.join("dist", icever))
-if os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join("dist", icever) + " && tar xf - )"):
- print >> sys.stderr, "ERROR: demo script archive caused errors"
- sys.exit(1)
-os.remove("exclusions")
-os.chdir("dist")
-
-if os.system("chmod -R u+rw,go+r-w %s " % icever):
- print >> sys.stderr, "ERROR: unable to set directory permissions"
- sys.exit(1)
-
-#
-# Printing warnings here instead of exiting because these probably
-# are not errors per-se but may reflect an unnecessary operation.
-#
-if os.system("find %s \\( -name \"*.h\" -or -name \"*.cpp\" -or -name \"*.ice\" \\) -exec chmod a-x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-if os.system("find %s \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-if os.system("find %s \\( -name \"*.xml\" -or -name \"*.mc\" \\) -exec chmod a-x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-if os.system("find %s \\( -name \"Makefile\" -or -name \"*.dsp\" \\) -exec chmod a-x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-if os.system("find %s -type d -exec chmod a+x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-if os.system("find %s -perm +111 -exec chmod a+x {} \\;" % icever):
- print >> sys.stderr, "WARNING: find returned non-zero result"
-
-print "Fixing version in various files..."
-fixVersion(find(icever, "README*"), version, mmversion)
-fixVersion(find(icever, "INSTALL*"), version, mmversion)
-fixVersion(find(os.path.join(icever, "config"), "glacier2router.cfg"), version, mmversion)
-fixVersion(find(os.path.join(icever, "config"), "icegridregistry.cfg"), version, mmversion)
-
-#
-# Generate bison files.
-#
-print "Generating bison files..."
-cwd = os.getcwd()
-grammars = find(icever, "*.y")
-for x in grammars:
- #
- # Change to the directory containing the file.
- #
- (dir,file) = os.path.split(x)
- os.chdir(dir)
- (base,ext) = os.path.splitext(file)
- #
- # Run gmake to create the output files.
- #
- if verbose:
- quiet = ""
- else:
- quiet = "-s"
- result = 0
- if file == "cexp.y":
- result = os.system("gmake " + quiet + " cexp.c")
- else:
- result = os.system("gmake " + quiet + " " + base + ".cpp")
- if result:
- print
- #
- # Edit the Makefile to comment out the grammar rules.
- #
- fixMakefile("Makefile", base)
- fixMakefile("Makefile.mak", base)
-
- #
- # Edit the project file(s) to comment out the grammar rules.
- #
- for p in glob.glob("*.dsp"):
- fixProject(p, file)
- os.chdir(cwd)
-
-#
-# Generate flex files.
-#
-print "Generating flex files..."
-scanners = find(icever, "*.l")
-for x in scanners:
- #
- # Change to the directory containing the file.
- #
- (dir,file) = os.path.split(x)
- os.chdir(dir)
- (base,ext) = os.path.splitext(file)
- #
- # Run gmake to create the output files.
- #
- if verbose:
- quiet = ""
- else:
- quiet = "-s"
- if os.system("gmake " + quiet + " " + base + ".cpp"):
- print>>sys.stderr, "Generating flex files failed."
- sys.exit(1)
- #
- # Edit the Makefile to comment out the flex rules.
- #
- fixMakefile("Makefile", base)
- fixMakefile("Makefile.mak", base)
-
- #
- # Edit the project file(s) to comment out the flex rules.
- #
- for p in glob.glob("*.dsp"):
- fixProject(p, file)
- os.chdir(cwd)
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-#
-# Comment out the implicit parser and scanner rules in
-# config/Make.rules.
-#
-print "Fixing makefiles..."
-fixMakeRules(os.path.join(icever, "config", "Make.rules"))
-
-if os.system("tar c" + quiet + "f %s.tar %s" % (icever, icever)):
- print>>sys.stderr, "ERROR: tar command failed"
- sys.exit(1)
-
-if os.system("gzip -9 " + icever + ".tar"):
- print>>sys.stderr, "ERROR: gzip command failed"
- sys.exit(1)
-
-if verbose:
- quiet = ""
-else:
- quiet = "q"
-
-if os.system("zip -9r" + quiet + " " + icever + ".zip " + icever):
- print>>sys.stderr, "ERROR: zip command failed"
- sys.exit(1)
-
-#
-# Copy CHANGES
-#
-shutil.copyfile(os.path.join(icever, "CHANGES"), "Ice-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icever)
-print "Done."
diff --git a/cs/Makefile b/cs/Makefile
index ebfd0f85a29..d4b86843499 100644
--- a/cs/Makefile
+++ b/cs/Makefile
@@ -13,32 +13,13 @@ include $(top_srcdir)/config/Make.rules.cs
SUBDIRS = config src test demo
-install::
- @if test ! -d $(prefix) ; \
- then \
- echo "Creating $(prefix)..." ; \
- $(call mkdir,$(prefix)) ; \
- fi
-
+install:: install-common
@if test ! -d $(install_bindir) ; \
then \
echo "Creating $(install_bindir)..." ; \
$(call mkdir,$(install_bindir)) ; \
fi
- @if test ! -d $(install_slicedir) ; \
- then \
- echo "Creating $(install_slicedir)..." ; \
- $(call mkdir,$(install_slicedir)) ; \
- fi
-
- cd ../slice ; \
- for subdir in * ; \
- do \
- echo "Copying slice/$$subdir to $(install_slicedir)..." ; \
- cp -fpr $$subdir $(install_slicedir) ; \
- done ; \
-
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
do \
diff --git a/cs/Makefile.mak b/cs/Makefile.mak
index cee18ac9948..33a4db31aed 100644
--- a/cs/Makefile.mak
+++ b/cs/Makefile.mak
@@ -13,32 +13,15 @@ top_srcdir = .
SUBDIRS = config src test demo
-INSTALL_SUBDIRS = $(install_bindir) $(install_slicedir)
-
-install:: createdir
-
-createdir::
- @if not exist $(prefix) \
- @echo "Creating $(prefix)..." && \
- mkdir $(prefix)
-
- @for %i in ( $(INSTALL_SUBDIRS) ) do \
- @if not exist %i \
- @echo "Creating %i..." && \
- mkdir %i
+install:: install-common
+ @if not exist $(install_bindir) \
+ @echo "Creating $(install_bindir)..." && \
+ mkdir $(install_bindir)
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-install::
- @echo "Copying slice files..." && \
- cmd /c "xcopy /s /y ..\slice $(install_slicedir)" || exit 1
-
-install::
- copy ICE_LICENSE $(prefix)
- copy LICENSE $(prefix)
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/cs/config/Make.rules.cs b/cs/config/Make.rules.cs
index 288f9d8dbc3..79db835acd1 100644
--- a/cs/config/Make.rules.cs
+++ b/cs/config/Make.rules.cs
@@ -79,7 +79,6 @@ else
endif
install_bindir = $(prefix)/bin
-install_slicedir = $(prefix)/slice
ifneq ($(ice_dir),/usr)
ref = -r:$(bindir)/$(1).dll
@@ -133,6 +132,11 @@ EVERYTHING = all depend clean install config
.SUFFIXES:
.SUFFIXES: .cs .ice
+ifeq ($(installlibrary),)
+ installlibrary = $(INSTALL_LIBRARY) $(1) $(2); \
+ chmod a+rx $(2)/$(notdir $(1))
+endif
+
%.cs: %.ice
$(SLICE2CS) $(SLICE2CSFLAGS) $<
diff --git a/cs/config/Make.rules.mak.cs b/cs/config/Make.rules.mak.cs
index 6bc137149c1..994565652d8 100644
--- a/cs/config/Make.rules.mak.cs
+++ b/cs/config/Make.rules.mak.cs
@@ -73,7 +73,6 @@ bindir = $(ice_dir)\bin
install_bindir = $(prefix)\bin
install_libdir = $(prefix)\lib
-install_slicedir = $(prefix)\slice
!if "$(no_gac)" != ""
NOGAC = $(no_gac)
diff --git a/java/Makefile b/java/Makefile
index d19d79e52ad..c9316495eed 100644
--- a/java/Makefile
+++ b/java/Makefile
@@ -13,5 +13,12 @@ all:
clean:
ant -emacs clean
-test::
+install::
+ifeq ($(prefix),)
+ ant -emacs install
+else
+ ant -emacs -Dprefix=$(prefix) install
+endif
+
+test:
@python ./allTests.py
diff --git a/java/Makefile.mak b/java/Makefile.mak
index 5d6f24933af..ef01974f75e 100755
--- a/java/Makefile.mak
+++ b/java/Makefile.mak
@@ -13,5 +13,12 @@ all:
clean:
ant -emacs clean
-test::
+install::
+!if "$(prefix)" != ""
+ ant -emacs -Dprefix="$(prefix)" install
+!else
+ ant -emacs install
+!endif
+
+test:
@python .\allTests.py
diff --git a/java/build.xml b/java/build.xml
index f014a02c626..f822d04a08e 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -186,19 +186,13 @@
<condition property="build-icegridadmin-pro-jar">
<and>
- <isset property="hasProguard" />
+ <available classname="proguard.ant.ProGuardTask" classpath="${env.CLASSPATH}" />
<available file="${jgoodies.looks}" />
<available file="${jgoodies.forms}" />
</and>
</condition>
- <condition property="build-icegridadmin-plain-jar">
- <not>
- <isset property="build-icegridadmin-pro-jar" />
- </not>
- </condition>
-
- <target name="icegridadmin-plain-jar" depends="icegridadmin-compile" if="build-icegridadmin-plain-jar">
+ <target name="icegridadmin-plain-jar" depends="icegridadmin-compile" unless="build-icegridadmin-pro-jar">
<manifest file="${lib.dir}/icegridgui.mf">
<attribute name="Class-Path" value="Ice.jar ../resources/"/>
</manifest>
@@ -244,6 +238,36 @@
<ant inheritAll="false" dir="test"/>
</target>
+ <target name="install-common">
+ <mkdir dir="${prefix}"/>
+ <mkdir dir="${prefix}/lib"/>
+ <mkdir dir="${prefix}/ant"/>
+ <mkdir dir="${prefix}/help"/>
+ <copy file="${ice.dir}/LICENSE" todir="${prefix}"/>
+ <copy file="${ice.dir}/ICE_LICENSE" todir="${prefix}"/>
+ <copy todir="${prefix}/ant">
+ <fileset dir="${ant.task.dir}">
+ <include name="*.class"/>
+ </fileset>
+ </copy>
+ <copy file="${lib.dir}/IceGridGUI.jar" todir="${prefix}/lib"/>
+ <copy todir="${prefix}/help">
+ <fileset dir="resources" includes="IceGridAdmin/**"/>
+ </copy>
+ </target>
+
+ <target name="install-jar" unless="java2">
+ <copy file="${lib.dir}/Ice.jar" todir="${prefix}/lib"/>
+ </target>
+
+ <target name="install-java2-jar" if="java2">
+ <mkdir dir="${prefix}/lib/java2"/>
+ <copy file="${lib.dir}/Ice.jar" todir="${prefix}/lib/java2"/>
+ </target>
+
+ <target name="install" depends="jar, install-common, install-jar, install-java2-jar">
+ </target>
+
<target name="clean" depends="config-init">
<delete dir="${generated.dir}"/>
<delete deleteonexit="true" dir="${lib.dir}"/>
diff --git a/java/config/build.properties b/java/config/build.properties
index 89b3d87daa9..09b53452b62 100644
--- a/java/config/build.properties
+++ b/java/config/build.properties
@@ -7,20 +7,25 @@
#
# **********************************************************************
+ice.version = 3.3.0
+
+#
+# Select an installation base directory. The directory will be created
+# if it does not exist.
+#
+prefix = /opt/Ice-${ice.version}
+
#
# Define debug as on if you want to build with debug information.
#
debug = on
-
#
# Set to "java2" or "java5" to select the Ice for Java mapping
# version to build. The default value is "java5".
#
#ice.mapping = java2
-ice.version = 3.3
-
#
# Define lint with your preferred -Xlint options.
#
@@ -30,7 +35,7 @@ ice.version = 3.3
# These properties only need to be set if you want to build the
# standalone jar for the IceGrid GUI.
#
-jgoodies.forms = /usr/share/java/forms-1.0.7.jar
-jgoodies.looks = /usr/share/java/looks-2.0.4.jar
-#jgoodies.forms = C:/Ice-3.2.0-ThirdParty-VC80/lib/forms-1.0.7.jar
-#jgoodies.looks = C:/Ice-3.2.0-ThirdParty-VC80/lib/looks-2.0.4.jar
+jgoodies.forms = /usr/share/java/forms-1.1.0.jar
+jgoodies.looks = /usr/share/java/looks-2.1.4.jar
+#jgoodies.forms = C:/Ice-3.3.0-ThirdParty-VC80/lib/forms-1.1.0.jar
+#jgoodies.looks = C:/Ice-3.3.0-ThirdParty-VC80/lib/looks-2.1.4.jar
diff --git a/java/config/common.xml b/java/config/common.xml
index e4912fc3691..5156b028bec 100644
--- a/java/config/common.xml
+++ b/java/config/common.xml
@@ -51,24 +51,6 @@
<property name="class.dir" value="classes"/>
<property name="generated.dir" value="generated"/>
- <!-- Check if proguard and jgoodies are available. -->
- <condition property="hasProguard">
- <available classname="proguard.ant.ProGuardTask" classpath="${env.CLASSPATH}" />
- </condition>
- <condition property="hasJGoodies">
- <and>
- <available classname="com.jgoodies.looks.Options" classpath="${env.CLASSPATH}" />
- <available classname="com.jgoodies.forms.factories.Borders" classpath="${env.CLASSPATH}" />
- </and>
- </condition>
- <condition property="hasProguardAndJGoodies">
- <and>
- <isset property="hasProguard" />
- <isset property="hasJGoodies" />
- </and>
- </condition>
-
-
<!-- We use pathconvert to ensure that ice.top.dir is relative to the path of the build.xml
file insead of the current working directory. -->
<pathconvert property="ice.top.dir">
diff --git a/java/makedist.py b/java/makedist.py
deleted file mode 100755
index 9eb2e8ce198..00000000000
--- a/java/makedist.py
+++ /dev/null
@@ -1,334 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re
-
-#
-# Show usage information.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-t Skip building translators and use the ones in PATH."
- print "-f Keep going if precondition checks fail."
- print "-v Be verbose."
-
-#
-# Taken from ice/config/TestUtil.py
-#
-# If having this duplicated is really a problem we should split these
-# methods out into their own module.
-#
-def isHpUx():
- if sys.platform == "hp-ux11":
- return 1
- else:
- return 0
-
-def isDarwin():
- if sys.platform == "darwin":
- return 1
- else:
- return 0
-
-def isAIX():
- if sys.platform in ['aix4', 'aix5']:
- return 1
- else:
- return 0
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- return result
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Are we on Windows?
-#
-if sys.platform.startswith("win") or sys.platform.startswith("cygwin"):
- print sys.argv[0] + ": this script must be run on a Unix platform."
- sys.exit(1)
-
-#
-# Check arguments
-#
-skipTranslators = False
-verbose = False
-keepGoing = False
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-t":
- print "skipping translators"
- skipTranslators = True
- elif x == "-v":
- verbose = True
- elif x == "-f":
- keepGoing = True
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = os.path.join(os.getcwd(), "dist")
-
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-icedir = os.path.join(os.getcwd(), "..", "cpp")
-
-#
-# Get Ice version.
-#
-config = open(os.path.join("src", "IceUtil", "Version.java"), "r")
-version = re.search("ICE_STRING_VERSION = \"([0-9\.b]*)\"", config.read()).group(1)
-icejver = "IceJ-" + version + "-xxx"
-os.mkdir(os.path.join(distdir, icejver))
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-print "Creating exclusion file..."
-filesToRemove = [ "makedist.py", "exclusions", "dist", "allDemos.py" ]
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-
-os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icejver) + " && tar xf - )")
-
-os.chdir(distdir)
-
-#
-# Check known preconditions for proper distribution building. Failed
-# checks do not result in immediate failure. Error messages are
-# displayed and the precondition checks continue to aide in identifying
-# other problems. If any of the precondition checks fail, the script
-# terminates.
-#
-f = file(os.path.join(icejver, "config", "build.properties"))
-buildProperties = f.readlines();
-f.close()
-
-errorOut = False
-for p in buildProperties:
- checkFilename = None
- d = p.split("=")
- if d[0].strip() in ["jgoodies.looks", "jgoodies.forms", "berkeleydb.jar"]:
- if not os.path.exists(d[1].strip()):
- print "ERROR: %s is not in configured location. IceGridGUI.jar will not build correctly!" % d[1].strip()
- errorOut = True
-
-if not os.environ.has_key("CLASSPATH"):
- print "ERROR: No CLASSPATH, unable to find ProGuard jar file."
- errorOut = True
-else:
- classpath = os.environ["CLASSPATH"]
- found = False
- for e in classpath.split(os.pathsep):
- if e.find("proguard.jar") != -1:
- if os.path.exists(e):
- found = True
- break
- if not found:
- print "ERROR: Unable to find ProGuard in CLASSPATH"
- errorOut = True
-
-if errorOut:
- print "Failed precondition checks! See above messages."
- if not keepGoing:
- sys.exit(1)
-
-
-#
-# Build slice2java and slice2freezej.
-#
-if not skipTranslators:
- print "Building translators..."
- cwd = os.getcwd()
- os.chdir(os.path.join(icedir, "src", "icecpp"))
- os.system("gmake")
- os.chdir(cwd)
- os.chdir(os.path.join(icedir, "src", "IceUtil"))
- os.system("gmake")
- os.chdir(cwd)
- os.chdir(os.path.join(icedir, "src", "Slice"))
- os.system("gmake")
- os.chdir(cwd)
- os.chdir(os.path.join(icedir, "src", "slice2java"))
- os.system("gmake")
- os.chdir(cwd)
- os.chdir(os.path.join(icedir, "src", "slice2freezej"))
- os.system("gmake")
- os.chdir(cwd)
-
- os.environ["PATH"] = os.path.join(icedir, "bin") + ":" + os.getenv("PATH", "")
-
- if isHpUx():
- os.environ["SHLIB_PATH"] = os.path.join(icedir, "lib") + ":" + os.getenv("SHLIB_PATH", "")
- elif isDarwin():
- os.environ["DYLD_LIBRARY_PATH"] = os.path.join(icedir, "lib") + ":" + os.getenv("DYLD_LIBRARY_PATH", "")
- elif isAIX():
- os.environ["LIBPATH"] = os.path.join(icedir, "lib") + ":" + os.getenv("LIBPATH", "")
- else:
- os.environ["LD_LIBRARY_PATH"] = os.path.join(icedir, "lib") + ":" + os.getenv("LD_LIBRARY_PATH", "")
-
- if os.environ.has_key("ICE_HOME"):
- del os.environ["ICE_HOME"]
-
-#
-# Copy Slice directories.
-#
-print "Copying Slice directories..."
-slicedirs = [
- "Freeze",
- "Glacier2",
- "Ice",
- "IceBox",
- "IcePatch2",
- "IceStorm",
- "IceGrid"
-]
-os.mkdir(os.path.join(icejver, "slice"))
-for x in slicedirs:
- shutil.copytree(os.path.join(icedir, "slice", x), os.path.join(icejver, "slice", x), 1)
-
-os.chdir(os.path.join(distdir, icejver))
-
-#
-# Build sources.
-#
-print "Compiling Java sources..."
-
-if verbose:
- quiet = ""
-else:
- quiet = " -q"
-os.system("ant" + quiet)
-
-distroSuffix = "java2"
-#
-# Clean out the lib directory but save the jar files.
-#
-os.rename(os.path.join("lib", "Ice.jar"), "Ice.jar")
-if os.path.exists(os.path.join("lib", "IceGridGUI.jar")):
- print "Found IceGridGUI, is this the Java 2 targeted source distro?"
- os.rename(os.path.join("lib", "IceGridGUI.jar"), "IceGridGUI.jar")
-else:
- print "No IceGridGUI, is this the Java 5 targeted source distro?"
- distroSuffix = "java5"
-
-shutil.rmtree("lib")
-os.mkdir("lib")
-os.rename("Ice.jar", os.path.join("lib", "Ice.jar"))
-if os.path.exists(os.path.join("IceGridGUI.jar")):
- os.rename("IceGridGUI.jar", os.path.join("lib", "IceGridGUI.jar"))
-else:
- os.remove("THIRD_PARTY_LICENSE")
- os.remove("THIRD_PARTY_SOURCES")
-
-#
-# Remove "generated" subdirectories.
-#
-filesToRemove = find(".", "*generated") # generated, cgenerated, sgenerated
-for x in filesToRemove:
- shutil.rmtree(x)
-
-#
-# Remove other unnecessary subdirectories.
-#
-#shutil.rmtree("admin")
-shutil.rmtree("depcache")
-
-os.chdir(distdir)
-
-print "Fixing version in README and INSTALL files..."
-fixVersion(find(icejver, "README*"), version)
-fixVersion(find(icejver, "INSTALL*"), version)
-
-#
-# Create source archives.
-#
-print "Creating distribution archives..."
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-icever = "IceJ-" + version + "-" + distroSuffix
-os.rename(icejver, icever)
-
-os.system("chmod -R u+rw,go+r-w . " + icever)
-os.system("find " + icever + " \\( -name \"*.java\" -or -name \"*.ice\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icever + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icever + " \\( -name \"*.xml\" -or -name \"*.html\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icever + " -type d -exec chmod a+x {} \\;")
-os.system("find " + icever + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar c" + quiet + "zf " + icever + ".tar.gz " + icever)
-if verbose:
- quiet = ""
-else:
- quiet = "-q"
-os.system("zip -9 -r " + quiet + " " + icever + ".zip " + icever)
-
-#
-# Copy files (README, etc.).
-#
-shutil.copyfile(os.path.join(icever, "CHANGES"), "IceJ-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icever)
-cwd = os.getcwd()
-os.chdir(icedir)
-
-#
-# For this to be 'nice' our clean rule has to be perfect.
-#
-os.system("gmake clean")
-os.chdir(cwd)
-print "Done."
diff --git a/makedist b/makedist
deleted file mode 100755
index 1e9d9dbb4fa..00000000000
--- a/makedist
+++ /dev/null
@@ -1,382 +0,0 @@
-#!/bin/bash
-# **********************************************************************
-#
-# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-#
-# **********************************************************************
-
-#
-# Error out on use of undefined variables.
-#
-set -u
-
-#
-# Set to 1 to keep working files around.
-#
-KEEP=0
-
-#
-# Location where working archive is created.
-#
-WORKINGDIR=$HOME/tmp
-
-BASEDIR=`pwd`
-
-#
-# Used to naming the archive.
-#
-LABEL="HEAD"
-
-#
-# The 'tree-ish' arg to the git-archive command.
-#
-REFSPEC="HEAD"
-
-#
-# Build the demo script distribution
-#
-SCRIPTARCHIVE=1
-
-usage()
-{
- echo "makedist [-d working-directory] [-n archive-name] [-t tag] [-M] [-h] [-k]"
- echo ""
- echo " -d Indicate the working directory. 'makedist' will create"
- echo " the source archive in this directory. Defaults to "
- echo " \$HOME/tmp"
- echo ""
- echo " -n Specify a name and prefix for the source archive."
- echo " Defaults to HEAD"
- echo ""
- echo " -t Specify which branch or tag to base the archive on."
- echo " If 'tag' is a branch, the archive will be created from"
- echo " 'tag'/HEAD. Defaults to HEAD of the current branch"
- echo ""
- echo " -E Skip building the demo script archive"
- echo ""
- echo " -k Don't clean up working files when finished"
- echo ""
- echo " -h Display this message."
-
- return 0
-}
-
-validopts="d:n:t:hkE"
-getopts $validopts curopt
-while [ ! "x$curopt" == "x:" ] ;
-do
- case $curopt in
- d)
- WORKINGDIR=$OPTARG
- if [ ! -d $WORKINGDIR ];
- then
- echo "ERROR: $WORKINGDIR does not exist!"
- exit 1
- fi
- ;;
-
- n)
- LABEL=$OPTARG
- ;;
-
- t)
- REFSPEC=$OPTARG
- ;;
-
- h)
- usage
- exit 0
- ;;
-
- E)
- SCRIPTARCHIVE=0
- ;;
-
- k)
- KEEP=1
- ;;
- esac
- getopts $validopts curopt
- [ "$?" -gt 0 ] && break
-done
-
-
-cleanup()
-{
- [ "$KEEP" -eq "0" ] && echo "Cleaning up working files..." && cd $WORKINGDIR && rm -rf $LABEL
-}
-
-trap "{ cleanup ; exit 255; }" INT TERM EXIT
-
-function fquery()
-{
- query=""
- for spec in $*
- do
- [ -z "$spec" ] && continue
- if [ -z "$query" ]
- then
- query="-name $spec"
- else
- query="$query -or -name $spec"
- fi
- done
- echo "$query"
-}
-
-#
-# From here on in we halt by default if a simple command returns a non zero
-# error code.
-#
-set -e
-
-echo "Creating $WORKINGDIR/$LABEL with $REFSPEC"
-
-[ -d $WORKINGDIR/$LABEL ] && rm -rf $LABEL
-git archive --prefix="$LABEL/" $REFSPEC | ( cd $WORKINGDIR && tar xf - )
-currentdir=`pwd`
-
-cd $WORKINGDIR/$LABEL
-
-#
-# Lists of files to exclude from the source distribuion.
-#
-
-#
-# Files common to all language mappings.
-#
-cat > common.exclude.file.list << COMMON_RM_FILES
-makedist.py
-allDemos.py
-ICE_LICENSE
-LICENSE
-COMMON_RM_FILES
-
-#
-# Mapping specific file lists here.
-#
-cat > cpp.exclude.file.list << CPP_RM_FILES
-cpp/makebindist.py
-cpp/iceemakedist.py
-cpp/RPMTools.py
-cpp/fixCopyright.py
-cpp/fixVersion.py
-cpp/icee.dsw
-cpp/icee.dsp
-cpp/config/makegitignore.py
-cpp/config/Make.rules.icee
-cpp/config/Make.rules.mak.icee
-cpp/src/icecpp/icecppe.dsp
-cpp/src/IceUtil/iceutile.dsp
-cpp/src/Slice/slicee.dsp
-cpp/install
-cpp/src/slice2cppe
-cpp/src/slice2javae
-CPP_RM_FILES
-
-#
-# We only need to query the Ice version from one location. We'll use the C++
-# mapping/core runtime as the source.
-#
-ICEVER=`awk "/.*ICE_STRING_VERSION.*/ { print \\$3 }" cpp/include/IceUtil/Config.h | sed -e s/\"//g` # "
-ICEMMVER=`echo $ICEVER | sed -e 's/\.[0-9A-Za-z]*$//' | sed -e 's/\.//g'`
-
-SOURCEDIR="$BASEDIR/../dist-$ICEVER"
-[ ! -d $SOURCEDIR ] && mkdir -p $SOURCEDIR
-
-#
-# DISTRIBUTION is the base directory for the actual source distribution contents.
-#
-DISTRIBUTION="$WORKINGDIR/Ice-$ICEVER"
-[ -d $DISTRIBUTION ] && rm -rf $DISTRIBUTION
-mkdir -p $DISTRIBUTION
-
-echo "Walking directories and creating source distributions"
-currentdir=`pwd`
-for f in `find . -maxdepth 1 -name "*" -type d` ;
-do
- #
- # Skip non-Ice distribution directories.
- #
- mappingdir=`basename $f`
- case "$mappingdir" in
- cpp|java|cs|php|py|vb|rb|certs|config|slice)
- #
- # No-op. We are looking to continue if the path doesn't match any of
- # those specified.
- #
- ;;
- *)
- continue
- ;;
- esac
-
- #
- # Construct base exclusion file out of common filenames and language mapping filenames.
- #
- echo "exclusions.dat" > exclusions.dat
- cat common.exclude.file.list | \
- while read line
- do
- [ -n "$line" ] && { echo "$mappingdir/$line" >> exclusions.dat; }
- done
- [ -e $mappingdir.exclude.file.list ] && cat $mappingdir.exclude.file.list >> exclusions.dat
-
- #
- # Now append wildcard matched exclusions! Scan path, add exclusions for
- # each instance of the provided file specs
- #
- find $mappingdir `fquery .gitignore expect.py` >> exclusions.bat
-
- #
- # Use tar + the exclusion file to copy the archive to a staging location.
- # We don't want to work on the archive in place because it makes it
- # difficult to resolve distribution related issues.
- #
- tar c -X exclusions.dat $mappingdir | tar xf - -C $DISTRIBUTION
-done
-
-cp Makefile $DISTRIBUTION
-cp Makefile.mak $DISTRIBUTION
-cp LICENSE $DISTRIBUTION
-cp ICE_LICENSE $DISTRIBUTION
-cp README $DISTRIBUTION
-cp allTests.py $DISTRIBUTION
-
-echo "Fixing version markup..."
-
-cd $DISTRIBUTION
-for f in "cpp/config/glacier2router.cfg cpp/config/icegridregistry.cfg"
-do
- sed -i "" -e "s/@ver@/$ICEVER/g" $f
- sed -i "" -e "s/@mmver@/$ICEMMVER/g" $f
-done
-
-for f in `find . -name "INSTALL*" -or -name "README*" -type f`
-do
- sed -i "" -e "s/@ver@/$ICEVER/g" $f
- sed -i "" -e "s/@mmver@/$ICEMMVER/g" $f
-done
-
-for f in `find . -name "*.y"`
-do
- cd $DISTRIBUTION/`dirname $f`
- base=`basename $f .y`
-
- #
- # XXX: Comment out bison/yacc rules.
- #
- if test `basename $f` == "cexp.y"
- then
- gmake cexp.c
-
- else
- gmake $base.cpp
- fi
-done
-
-cd $DISTRIBUTION
-
-#
-# Update permissions
-chmod -R u+rw,go+r-w .
-find . `fquery *.cpp *.h *.ice README* INSTALL* *.xml *.java *.cs *.csproj *.vb *.vbproj *.php *.mc Makefile*.* *.dsp` \
- | xargs chmod a-x
-find . -type d -exec chmod a+x {} \;
-find . -perm +111 -exec chmod a+x {} \;
-
-#
-# Should be all ready to go, so we archive it up and blow away the working
-# directory (if required).
-#
-cd $WORKINGDIR
-tar cfz $SOURCEDIR/Ice-$ICEVER.tar.gz Ice-$ICEVER
-zip -9r $SOURCEDIR/Ice-$ICEVER.zip Ice-$ICEVER
-[ $KEEP -eq 0 ] && rm -rf Ice-$ICEVER
-
-cd $currentdir
-
-#
-# Copy binary distribution scripts into sources directory.
-#
-for f in distribution/bin/makebindist.py distribution/bin/makemsi.py;
-do
- [ -e $f ] || { echo "ERROR: `pwd`/$f does not exist" ; exit 1; }
- cp $f $SOURCEDIR
-done
-tar cfz $SOURCEDIR/distfiles.tar.gz --exclude distribution/bin distribution -C cpp/include/IceUtil Config.h -C ../../.. `[ -e RELEASE_NOTES.txt ] && echo "RELEASE_NOTES.txt"` || { echo "ERROR: tar operation returned non-zero status" ; exit 1; }
-
-#
-# Consolidating demoscript archive.
-#
-TMPDIR=$WORKINGDIR/dscrpt/Ice-$ICEVER-demos
-cd $WORKINGDIR/$LABEL
-
-if [ "$SCRIPTARCHIVE" -eq "1" ];
-then
- rm -rf $TMPDIR
- mkdir -p $TMPDIR
- for f in `find . -maxdepth 1 -name "*" -type d` ;
- do
- #
- # Only continue processing this directory if there is an
- # allDemos.py script there.
- #
- [ ! -e $f/allDemos.py ] && continue
-
- mappingdir=`basename $f`
- case $mappingdir in
- cpp)
- demoSuffix="cxx";
- ;;
- java)
- demoSuffix="j";
- ;;
- py)
- demoSuffix="py";
- ;;
- rb)
- demoSuffix="rb";
- ;;
- cs)
- demoSuffix="cs";
- ;;
- php)
- demoSuffix="php";
- ;;
- vb)
- demoSuffix="vb";
- ;;
- *)
- continue;
- ;;
- esac
- currentdir=`pwd`
- cd $mappingdir
- tar cf - `find . -name "expect.py"` | tar xf - -C $TMPDIR
- mv $TMPDIR/demo $TMPDIR/demo$demoSuffix
- cp allDemos.py $TMPDIR/demo$demoSuffix
- cd $currentdir
- done
-
- tar cf - -C $WORKINGDIR/$LABEL demoscript | tar xf - -C $TMPDIR
-
- [ ! -d $TMPDIR/democxx ] && { echo "Failure in creating demo script archive. C++ mapping scripts missing." ; exit 1; }
- mv $TMPDIR/democxx $TMPDIR/demo
- currentdir=`pwd`
- cd $TMPDIR/..
-
- rm -f $SOURCEDIR/Ice-$ICEVER-demo-scripts.tar.gz
- tar cf $SOURCEDIR/Ice-$ICEVER-demo-scripts.tar Ice-$ICEVER-demos
- gzip -9 $SOURCEDIR/Ice-$ICEVER-demo-scripts.tar
- cd $currentdir
-fi
-
-cleanup
-cd $BASEDIR
-echo "Source distributions can be found in $SOURCEDIR"
-exit 1
diff --git a/makedist.py b/makedist.py
new file mode 100755
index 00000000000..25e54902cc2
--- /dev/null
+++ b/makedist.py
@@ -0,0 +1,610 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys, shutil, fnmatch, re, glob, time
+from stat import *
+from shutil import copytree, rmtree
+
+#
+# TODO: The test distribution is currently disabled. There's still some work to do
+# to get it to work. For instance, the test/Ice/background test can't be compiled
+# without the sources. The allTests.py scripts also don't support being run from
+# the test directory.
+#
+
+#
+# Sub-directories to keep to create the source distributions.
+#
+includeSubDirs = [ \
+ "cpp", \
+ "java", \
+ "cs", \
+ "php", \
+ "py", \
+ "vb", \
+ "rb", \
+ "config", \
+ "certs", \
+ "slice", \
+ "distribution", \
+ "demoscript", \
+]
+
+#
+# Files to not include in the source distributions.
+#
+filesToRemove = [ \
+ "fixCopyright.py", \
+ "fixVersion.py", \
+ "cpp/iceemakedist.py", \
+ "cpp/iceslmakedist.py", \
+ "cpp/config/makegitignore.py", \
+ "cpp/config/Make.rules.icee", \
+ "cpp/config/Make.rules.mak.icee", \
+# "cpp/config/Make.rules.icesl", \
+ "cpp/config/Make.rules.mak.icesl", \
+ "rb/config/Make.rules.Darwin", \
+]
+
+#
+# Files from the top-level, cpp, java and cs config directories to include in the demo
+# and test source distribution config directory.
+#
+configFiles = [ \
+ "Make.*", \
+ "common.xml", \
+ "build.properties", \
+]
+
+#
+# Files from the top-level certs directory to include in the demo distribution certs
+# directory.
+#
+certsFiles = [ \
+ "*.jks", \
+ "*.pem", \
+ "*.pfx", \
+]
+
+#
+# Program usage.
+#
+def usage():
+ print "Usage: " + sys.argv[0] + " [options]"
+ print
+ print "Options:"
+ print "-h Show this message."
+ print "-v Be verbose."
+
+#
+# Remove file or directory, warn if it doesn't exist.
+#
+def remove(path):
+
+ if not os.path.exists(path):
+ print "warning: " + path + " doesn't exist"
+ return
+
+ if os.path.isdir(path):
+ rmtree(path)
+ else:
+ os.remove(path)
+
+#
+# Copy srcpath file to destpath
+#
+def copy(srcpath, destpath):
+
+ if os.path.isdir(destpath):
+ destpath = os.path.join(destpath, os.path.basename(srcpath))
+
+ if os.path.exists(destpath):
+ print "warning: overwritting " + destpath
+
+ shutil.copyfile(srcpath, destpath)
+ fixFilePermission(destpath)
+
+#
+# Copy files from srcpath and matching the given patterns to destpath
+#
+def copyMatchingFiles(srcpath, destpath, patterns):
+
+ for p in patterns:
+ for f in glob.glob(os.path.join(srcpath, p)):
+ copy(f, os.path.join(destpath, os.path.basename(f)))
+
+
+#
+# Get the language mapping directory for a given suffix.
+#
+def getMappingDir(suffix, mapping):
+ if mapping == "cpp":
+ return suffix
+ elif mapping == "java":
+ return suffix + "j"
+ else:
+ return suffix + mapping
+
+#
+# Comment out rules in a Makefile.
+#
+def fixMakefile(file, base, ext):
+
+ origfile = file + ".orig"
+ os.rename(file, origfile)
+ oldMakefile = open(origfile, "r")
+ newMakefile = open(file, "w")
+ origLines = oldMakefile.readlines()
+
+ doComment = 0
+ doCheck = 0
+ newLines = []
+ for x in origLines:
+ #
+ # If the rule contains the target string, then
+ # comment out this rule.
+ #
+ if not x.startswith("\t") and x.find(base + ext) != -1:
+ doComment = 1
+ #
+ # If the line starts with "clean::", then check
+ # the following lines and comment out any that
+ # contain the target string.
+ #
+ elif x.startswith("clean::"):
+ doCheck = 1
+ #
+ # Stop when we encounter an empty line.
+ #
+ elif len(x.strip()) == 0:
+ doComment = 0
+ doCheck = 0
+
+ if doComment or (doCheck and x.find(base) != -1):
+ x = "#" + x
+ newLines.append(x)
+
+ newMakefile.writelines(newLines)
+ newMakefile.close()
+ oldMakefile.close()
+ os.remove(origfile)
+
+#
+# Comment out rules in VC project.
+#
+def fixProject(file, target):
+ origfile = file + ".orig"
+ os.rename(file, origfile)
+ oldProject = open(origfile, "r")
+ newProject = open(file, "w")
+ origLines = oldProject.readlines()
+
+ #
+ # Find a Source File declaration containing SOURCE=<target>
+ # and comment out the entire declaration.
+ #
+ expr = re.compile("SOURCE=.*" + target.replace(".", "\\.") + ".*")
+ inSource = 0
+ doComment = 0
+ newLines = []
+ source = []
+ for x in origLines:
+ if x.startswith("# Begin Source File"):
+ inSource = 1
+
+ if inSource:
+ if not doComment and expr.match(x) != None:
+ doComment = 1
+ source.append(x)
+ else:
+ newLines.append(x)
+
+ if x.startswith("# End Source File"):
+ inSource = 0
+ for s in source:
+ if doComment:
+ newLines.append('#xxx#' + s)
+ else:
+ newLines.append(s)
+ doComment = 0
+ source = []
+
+ newProject.writelines(newLines)
+ newProject.close()
+ oldProject.close()
+ os.remove(origfile)
+
+#
+# Comment out implicit parser/scanner rules in config/Make.rules.
+#
+def fixMakeRules(file):
+ origfile = file + ".orig"
+ os.rename(file, origfile)
+ oldFile = open(origfile, "r")
+ newFile = open(file, "w")
+ origLines = oldFile.readlines()
+
+ doComment = 0
+ newLines = []
+ for x in origLines:
+ if x.find("%.y") != -1 or x.find("%.l") != -1:
+ doComment = 1
+ #
+ # Stop when we encounter an empty line.
+ #
+ elif len(x.strip()) == 0:
+ doComment = 0
+
+ if doComment:
+ x = "#" + x
+ newLines.append(x)
+
+ newFile.writelines(newLines)
+ newFile.close()
+ oldFile.close()
+ os.remove(origfile)
+
+#
+# Fix version in README, INSTALL files
+#
+def fixVersion(file):
+
+ global version, mmversion, libversion
+
+ origfile = file + ".orig"
+ os.rename(file, origfile)
+ oldFile = open(origfile, "r")
+ newFile = open(file, "w")
+ line = oldFile.read();
+ line = re.sub("@ver@", version, line)
+ line = re.sub("@mmver@", mmversion, line)
+ line = re.sub("@libver@", libversion, line)
+ newFile.write(line)
+ newFile.close()
+ oldFile.close()
+ os.remove(origfile)
+
+def fixFilePermission(file):
+
+ patterns = [ \
+ "*.h", \
+ "*.cpp", \
+ "*.ice", \
+ "README*", \
+ "INSTALL*", \
+ "*.xml", \
+ "*.mc", \
+ "Makefile", \
+ "Makefile.mak", \
+ "*.dsp", \
+ ]
+
+ st = os.stat(file)
+
+ if st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH):
+ for p in patterns:
+ if fnmatch.fnmatch(file, p):
+ if verbose:
+ print "removing exec permissions on: " + file
+ break
+ else:
+ os.chmod(file, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) # rwxr-xr-x
+ return
+
+ os.chmod(file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) # rw-r--r--
+
+#
+# Generate bison files and comment out the Makefile rule
+#
+def generateBisonFile(file):
+
+ #
+ # Change to the directory containing the file.
+ #
+ (dir,file) = os.path.split(x)
+ os.chdir(dir)
+ (base,ext) = os.path.splitext(file)
+
+ #
+ # Run gmake to create the output files.
+ #
+ if verbose:
+ quiet = ""
+ else:
+ quiet = "-s"
+ if file == "cexp.y":
+ os.system("gmake " + quiet + " cexp.c")
+ else:
+ os.system("gmake " + quiet + " " + base + ".cpp")
+
+ #
+ # Edit the Makefile to comment out the grammar rules.
+ #
+ fixMakefile("Makefile", base, ext)
+ fixMakefile("Makefile.mak", base, ext)
+
+ #
+ # Edit the project file(s) to comment out the grammar rules.
+ #
+ for p in glob.glob("*.dsp"):
+ fixProject(p, file)
+
+ os.chdir(srcDistDir)
+
+#
+# Generate flex files and comment out the Makefile rule
+#
+def generateFlexFile(file):
+
+ #
+ # Change to the directory containing the file.
+ #
+ (dir,file) = os.path.split(file)
+ os.chdir(dir)
+ (base,ext) = os.path.splitext(file)
+
+ #
+ # Run gmake to create the output files.
+ #
+ if verbose:
+ quiet = ""
+ else:
+ quiet = "-s"
+ os.system("gmake " + quiet + " " + base + ".cpp")
+
+ #
+ # Edit the Makefile to comment out the flex rules.
+ #
+ fixMakefile("Makefile", base, ext)
+ fixMakefile("Makefile.mak", base, ext)
+
+ #
+ # Edit the project file(s) to comment out the flex rules.
+ #
+ for p in glob.glob("*.dsp"):
+ fixProject(p, file)
+
+ os.chdir(srcDistDir)
+
+#
+# Check arguments
+#
+verbose = 0
+tag = "HEAD"
+for x in sys.argv[1:]:
+ if x == "-h":
+ usage()
+ sys.exit(0)
+ elif x == "-v":
+ verbose = 1
+ elif x.startswith("-"):
+ print sys.argv[0] + ": unknown option `" + x + "'"
+ print
+ usage()
+ sys.exit(1)
+ else:
+ tag = x
+
+if verbose:
+ quiet = "v"
+else:
+ quiet = ""
+
+#
+# Get Ice version.
+#
+config = open(os.path.join("config", "Make.common.rules"), "r")
+version = re.search("VERSION\s*=\s*([0-9\.b]*)", config.read()).group(1)
+mmversion = re.search("([0-9]+\.[0-9b]+)[\.0-9]*", version).group(1)
+libversion = mmversion.replace('.', '')
+config.close()
+
+#
+# Remove any existing "dist-M.m.p" directory and create a new one
+# and sub-directories for the each source distribution.
+#
+distDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "dist-" + version))
+if os.path.exists(distDir):
+ rmtree(distDir)
+os.mkdir(distDir)
+
+print "Creating " + version + " source distributions in " + distDir
+
+demoscriptDistDir = os.path.join(distDir, "Ice-" + version + "-demo-scripts")
+demoDistDir = os.path.join(distDir, "Ice-" + version + "-demos")
+#testDistDir = os.path.join(distDir, "Ice-" + version + "-tests")
+srcDistDir = os.path.join(distDir, "Ice-" + version)
+os.mkdir(demoscriptDistDir)
+os.mkdir(demoDistDir)
+os.mkdir(os.path.join(demoDistDir, "config"))
+os.mkdir(os.path.join(demoDistDir, "certs"))
+#os.mkdir(testDistDir)
+#os.mkdir(os.path.join(testDistDir, "config"))
+
+#
+# Extract the sources with git archive using the given tag.
+#
+print "Creating git archive using " + tag + "...",
+sys.stdout.flush()
+os.system("git archive --prefix=Ice-" + version + "/ " + tag + " | ( cd " + distDir + " && tar xf - )")
+print "ok"
+
+cwd = os.getcwd()
+
+os.chdir(os.path.join(srcDistDir))
+
+#
+# Remove or move non-public files out of source distribution.
+#
+print "Removing non-Ice directories and files...",
+sys.stdout.flush()
+for x in filesToRemove:
+ remove(x)
+for d in os.listdir('.'):
+ if not d in includeSubDirs:
+ if os.path.isdir(d):
+ rmtree(d)
+print "ok"
+
+print "Walking through distribution to fix permissions, versions, etc...",
+sys.stdout.flush()
+
+fixVersion(os.path.join("cpp", "config", "glacier2router.cfg"))
+fixVersion(os.path.join("cpp", "config", "icegridregistry.cfg"))
+fixVersion(os.path.join("distribution", "src", "rpm", "glacier2router.conf"))
+fixVersion(os.path.join("distribution", "src", "rpm", "icegridregistry.conf"))
+
+bisonFiles = []
+flexFiles = []
+for root, dirnames, filesnames in os.walk('.'):
+
+ for f in filesnames:
+ filepath = os.path.join(root, f)
+ if f == ".gitignore":
+ os.remove(filepath)
+ elif f == "expect.py":
+ if not os.path.exists(os.path.join(distDir, demoscriptDistDir, root)):
+ os.makedirs(os.path.join(distDir, demoscriptDistDir, root))
+ copy(filepath, os.path.join(distDir, demoscriptDistDir, filepath))
+ else:
+ fixFilePermission(filepath)
+
+ # Fix version of README/INSTALL files and keep track of bison/flex files for later processing
+ if fnmatch.fnmatch(f, "README*") or fnmatch.fnmatch(f, "INSTALL*"):
+ fixVersion(filepath)
+ elif fnmatch.fnmatch(f, "*.y"):
+ bisonFiles.append(filepath)
+ elif fnmatch.fnmatch(f, "*.l"):
+ flexFiles.append(filepath)
+
+ for d in dirnames:
+ os.chmod(os.path.join(root, d), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) # rwxr-xr-x
+
+os.rename("distribution", os.path.join("..", "distribution")) # Move the distribution directory to the top-level
+os.rename("demoscript", os.path.join(demoscriptDistDir, "demoscript")) # Move the demoscript directory
+
+print "ok"
+
+#
+# Generate bison & flex files.
+#
+print "Generating bison and flex files...",
+sys.stdout.flush()
+for x in bisonFiles:
+ generateBisonFile(x)
+for x in flexFiles:
+ generateFlexFile(x)
+fixMakeRules(os.path.join("cpp", "config", "Make.rules"))
+print "ok"
+
+#
+# Consolidate demo, demo scripts and test distributions.
+#
+print "Consolidating demo, test and demo scripts distributions...",
+sys.stdout.flush()
+
+# Demo distribution
+copy("ICE_LICENSE", demoDistDir)
+copy(os.path.join(distDir, "distribution", "src", "windows", "README.DEMOS"), os.path.join(demoDistDir))
+
+copyMatchingFiles(os.path.join("certs"), os.path.join(demoDistDir, "certs"), certsFiles)
+copyMatchingFiles(os.path.join("config"), os.path.join(demoDistDir, "config"), configFiles)
+copyMatchingFiles(os.path.join("cpp", "config"), os.path.join(demoDistDir, "config"), configFiles)
+copyMatchingFiles(os.path.join("java", "config"), os.path.join(demoDistDir, "config"), configFiles)
+copyMatchingFiles(os.path.join("cs", "config"), os.path.join(demoDistDir, "config"), configFiles)
+
+# Test distribution
+# copy("ICE_LICENSE", testDistDir)
+# copyMatchingFiles(os.path.join("config"), os.path.join(testDistDir, "config"), configFiles)
+# copyMatchingFiles(os.path.join("cpp", "config"), os.path.join(testDistDir, "config"), configFiles)
+# copyMatchingFiles(os.path.join("java", "config"), os.path.join(testDistDir, "config"), configFiles)
+# copyMatchingFiles(os.path.join("cs", "config"), os.path.join(testDistDir, "config"), configFiles)
+
+# Consolidate demoscript, test and demo distribution with files from each language mapping
+for d in os.listdir('.'):
+
+ if os.path.isdir(d) and os.path.exists(os.path.join(d, "allDemos.py")):
+ os.rename(os.path.join(d, "allDemos.py"), os.path.join(demoscriptDistDir, d, "allDemos.py"))
+ os.rename(os.path.join(demoscriptDistDir, d), os.path.join(demoscriptDistDir, getMappingDir("demo", d)))
+
+# if os.path.isdir(d) and os.path.exists(os.path.join(d, "test")):
+# copytree(os.path.join(d, "test"), os.path.join(testDistDir, getMappingDir("test", d)))
+# copy(os.path.join(d, "allTests.py"), os.path.join(testDistDir, getMappingDir("test", d)))
+
+ if os.path.isdir(d) and os.path.exists(os.path.join(d, "demo")):
+ copytree(os.path.join(d, "demo"), os.path.join(demoDistDir, getMappingDir("demo", d)))
+
+print "ok"
+
+#
+# Everything should be clean now, we can create the source distributions archives
+#
+print "Archiving..."
+sys.stdout.flush()
+os.chdir(distDir)
+
+#for d in [srcDistDir, testDistDir, demoDistDir, demoscriptDistDir]:
+for d in [srcDistDir, demoDistDir, demoscriptDistDir]:
+ dist = os.path.basename(d)
+ print " creating " + dist + ".tar.gz ...",
+ sys.stdout.flush()
+ os.system("tar c" + quiet + "f - " + dist + " | gzip -9 - > " + dist + ".tar.gz")
+ print "ok"
+
+for d in [srcDistDir, demoDistDir]:
+ dist = os.path.basename(d)
+ print " creating " + dist + ".zip ...",
+ sys.stdout.flush()
+ if verbose:
+ os.system("zip -9r " + dist + ".zip " + dist)
+ else:
+ os.system("zip -9rq " + dist +".zip " + dist)
+ print "ok"
+
+#
+# Copy CHANGES and RELEASE_NOTES.txt
+#
+copy(os.path.join("Ice-" + version, "cpp", "CHANGES"), "Ice-" + version + "-CHANGES")
+if os.path.exists(os.path.join("Ice-" + version, "RELEASE_NOTES.txt")):
+ copy(os.path.join("Ice-" + version, "RELEASE_NOTES.txt", "RELEASE_NOTES.txt"))
+else:
+ print "warning: couldn't find ./RELEASE_NOTES.txt file"
+
+readme = open("README.txt", "w")
+print >>readme, "This directory contains the source distributions of Ice " + version + ".\n"
+print >>readme, "Creation time: " + time.strftime("%a %b %d %Y, %I:%M:%S %p (%Z)")
+(sysname, nodename, release, version, machine) = os.uname();
+print >>readme, "Host: " + nodename
+print >>readme, "Platform: " + sysname + " " + release
+if os.path.exists("/etc/redhat-release"):
+ f = open("/etc/redhat-release")
+ print >>readme, "Linux distribution: " + f.readline().strip()
+ f.close()
+else:
+ print >>readme, "Not created on a Linux distribution"
+print >>readme, "User: " + os.environ["USER"]
+print >>readme, ""
+print >>readme, "" + \
+"The `distribution' directory contains the sources for building the\n" + \
+"binary distributions.\n"
+readme.close()
+
+#
+# Done.
+#
+print "Cleaning up...",
+sys.stdout.flush()
+rmtree(srcDistDir)
+rmtree(demoDistDir)
+#rmtree(testDistDir)
+rmtree(demoscriptDistDir)
+print "ok"
+
+os.chdir(cwd)
diff --git a/php/Makefile b/php/Makefile
index 1d33ccbd520..1625f8b2c71 100644
--- a/php/Makefile
+++ b/php/Makefile
@@ -13,23 +13,12 @@ include $(top_srcdir)/config/Make.rules
SUBDIRS = src
-INSTALL_SUBDIRS = $(install_libdir)
-
-install::
- @if test ! -d $(prefix) ; \
+install:: install-common
+ @if test ! -d $(install_libdir) ; \
then \
- echo "Creating $(prefix)..." ; \
- $(call mkdir,$(prefix)) ; \
+ echo "Creating $(install_libdir)..." ; \
+ $(call mkdir,$(install_libdir)) ; \
fi
- @for subdir in $(INSTALL_SUBDIRS); \
- do \
- if test ! -d $$subdir ; \
- then \
- echo "Creating $$subdir..." ; \
- mkdir -p $$subdir ; \
- chmod a+rx $$subdir ; \
- fi ; \
- done
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
@@ -38,9 +27,5 @@ $(EVERYTHING)::
( cd $$subdir && $(MAKE) $@ ) || exit 1; \
done
-install::
- $(call installdata,ICE_LICENSE,$(prefix))
- $(call installdata,LICENSE,$(prefix))
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/php/Makefile.mak b/php/Makefile.mak
index 80aa2cf2432..48598fe038c 100755
--- a/php/Makefile.mak
+++ b/php/Makefile.mak
@@ -13,26 +13,15 @@ top_srcdir = .
SUBDIRS = src
-INSTALL_SUBDIRS = $(install_bindir)
-
-install::
- @if not exist $(prefix) \
- @echo "Creating $(prefix)..." && \
- mkdir $(prefix)
-
- @for %i in ( $(INSTALL_SUBDIRS) ) do \
- @if not exist %i \
- @echo "Creating %i..." && \
- mkdir %i
+install:: install-common
+ @if not exist $(install_libdir) \
+ @echo "Creating $(install_libdir)..." && \
+ mkdir $(install_libdir)
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-install::
- copy ICE_LICENSE $(prefix)
- copy LICENSE $(prefix)
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/php/makedist.py b/php/makedist.py
deleted file mode 100755
index aed19189a0b..00000000000
--- a/php/makedist.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, glob
-
-#
-# Program usage.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- elif fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- return result
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-if os.path.exists("../.git"):
- print "Unable to run in repository! Exiting..."
- sys.exit(1)
-
-verbose = False
-
-#
-# Check arguments
-#
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = True
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = "dist"
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-icedir = os.path.join(os.getcwd(), "..", "cpp")
-
-#
-# Get Ice version.
-#
-config = open(os.path.join(icedir, "include", "IceUtil", "Config.h"), "r")
-version = re.search("ICE_STRING_VERSION \"([0-9\.b]*)\"", config.read()).group(1)
-icephpver = "IcePHP-" + version
-
-os.mkdir(os.path.join(distdir, icephpver))
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-#
-# Remove files.
-#
-filesToRemove = [ "makedist.py", "exclusions", "dist", "allDemos.py" ]
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-
-os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icephpver) + " && tar xf - )")
-
-os.chdir(distdir)
-
-#
-# Copy Make.rules.Linux and Make.rules.msvc
-#
-shutil.copyfile(os.path.join(icedir, "config", "Make.rules.Linux"),
- os.path.join(icephpver, "config", "Make.rules.Linux"))
-
-shutil.copyfile(os.path.join(icedir, "config", "Make.rules.msvc"),
- os.path.join(icephpver, "config", "Make.rules.msvc"))
-
-
-print "Fixing version in README and INSTALL files..."
-fixVersion(find(icephpver, "README*"), version)
-fixVersion(find(icephpver, "INSTALL*"), version)
-
-#
-# Create archives.
-#
-os.system("chmod -R u+rw,go+r-w . " + icephpver)
-os.system("find " + icephpver + " \\( -name \"*.php\" -or -name \"*.ice\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icephpver + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icephpver + " -type d -exec chmod a+x {} \\;")
-os.system("find " + icephpver + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar cf " + icephpver + ".tar " + icephpver)
-os.system("gzip -9 " + icephpver + ".tar")
-os.system("zip -9rq " + icephpver + ".zip " + icephpver)
-
-#
-# Copy files (README, etc.).
-#
-shutil.copyfile(os.path.join(icephpver, "CHANGES"), "IcePHP-" + version + "-CHANGES")
-
-#
-# Done.
-#
-shutil.rmtree(icephpver)
diff --git a/py/Makefile b/py/Makefile
index db44a89f11c..f217a1784cf 100644
--- a/py/Makefile
+++ b/py/Makefile
@@ -13,13 +13,7 @@ include $(top_srcdir)/config/Make.rules
SUBDIRS = python modules
-install::
- @if test ! -d $(prefix) ; \
- then \
- echo "Creating $(prefix)..." ; \
- $(call mkdir,$(prefix)) ; \
- fi
-
+install:: install-common
@if test ! -d $(install_pythondir) ; \
then \
echo "Creating $(install_pythondir)..." ; \
@@ -33,9 +27,5 @@ $(EVERYTHING)::
( cd $$subdir && $(MAKE) $@ ) || exit 1; \
done
-install::
- $(call installdata,ICE_LICENSE,$(prefix))
- $(call installdata,LICENSE,$(prefix))
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/py/Makefile.mak b/py/Makefile.mak
index 392a037334e..d9310b45b7e 100755
--- a/py/Makefile.mak
+++ b/py/Makefile.mak
@@ -13,26 +13,15 @@ top_srcdir = .
SUBDIRS = python modules
-INSTALL_SUBDIRS = $(install_libdir) $(install_pythondir)
-
-install::
- @if not exist $(prefix) \
- @echo "Creating $(prefix)..." && \
- mkdir $(prefix)
-
- @for %i in ( $(INSTALL_SUBDIRS) ) do \
- @if not exist %i \
- @echo "Creating %i..." && \
- mkdir %i
+install:: install-common
+ @if not exist $(install_pythondir) \
+ @echo "Creating $(install_pythondir)..." && \
+ mkdir $(install_pythondir)
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-install::
- copy ICE_LICENSE $(prefix)
- copy LICENSE $(prefix)
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/py/makedist.py b/py/makedist.py
deleted file mode 100755
index a510e87e43c..00000000000
--- a/py/makedist.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, glob
-
-#
-# Show usage information.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- return result
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Are we on Windows?
-#
-win32 = sys.platform.startswith("win") or sys.platform.startswith("cygwin")
-
-if os.path.exists("../.git"):
- print "Unable to run in repository! Exiting..."
- sys.exit(1)
-
-#
-# Check arguments
-#
-verbose = 0
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = 1
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = os.path.join(os.getcwd(), "dist")
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-icedir = os.path.join(os.getcwd(), "..", "cpp")
-
-#
-# Get Ice version.
-#
-config = open(os.path.join("config", "Make.rules"), "r")
-versionMajor = ""
-versionMinor = ""
-version = ""
-for l in config.readlines():
- if l.startswith("VERSION_MAJOR"):
- n, v = l.split('=')
- versionMajor = v.strip()
- elif l.startswith("VERSION_MINOR"):
- n, v = l.split('=')
- versionMinor = v.strip()
- elif l.startswith("VERSION"):
- n, v = l.split('=')
- version = v.strip()
-
-config.close()
-icepyver = "IcePy-" + version
-os.mkdir(os.path.join(distdir, icepyver))
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-#
-# Remove files.
-#
-print "Creating exclusion file..."
-filesToRemove = [ "exclusions", "makedist.py", "makebindist.py", "dist", "allDemos.py"]
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icepyver) + " && tar xf - )")
-
-os.chdir(distdir)
-
-print "Copying Make.rules.* files from ice..."
-for x in glob.glob(os.path.join(icedir, "config", "Make.rules.*")):
- if not os.path.exists(os.path.join(icepyver, "config", os.path.basename(x))):
- shutil.copyfile(x, os.path.join(icepyver, "config", os.path.basename(x)))
-
-print "Fixing version in README and INSTALL files..."
-fixVersion(find(icepyver, "README*"), version)
-fixVersion(find(icepyver, "INSTALL*"), version)
-
-#
-# Create source archives.
-#
-print "Creating distribution archives..."
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-os.system("chmod -R u+rw,go+r-w . " + icepyver)
-os.system("find " + icepyver + " \\( -name \"*.ice\" -or -name \"*.xml\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icepyver + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icepyver + " -type d -exec chmod a+x {} \\;")
-os.system("find " + icepyver + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar c" + quiet + "f " + icepyver + ".tar " + icepyver)
-os.system("gzip -9 " + icepyver + ".tar")
-if verbose:
- quiet = ""
-else:
- quiet = "-q"
-os.system("zip -9 -r " + quiet + " " + icepyver + ".zip " + icepyver)
-
-#
-# Copy files (README, etc.).
-#
-shutil.copyfile(os.path.join(icepyver, "CHANGES"), "IcePy-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icepyver)
-print "Done."
diff --git a/rb/Makefile b/rb/Makefile
index 2295977f360..07c949a9457 100644
--- a/rb/Makefile
+++ b/rb/Makefile
@@ -13,23 +13,12 @@ include $(top_srcdir)/config/Make.rules
SUBDIRS = src ruby
-INSTALL_SUBDIRS = $(install_libdir) $(install_rubydir)
-
-install::
- @if test ! -d $(prefix) ; \
+install:: install-common
+ @if test ! -d $(install_rubydir) ; \
then \
- echo "Creating $(prefix)..." ; \
- $(call mkdir,$(prefix)) ; \
+ echo "Creating $(install_rubydir)..." ; \
+ $(call mkdir,$(install_rubydir)) ; \
fi
- @for subdir in $(INSTALL_SUBDIRS); \
- do \
- if test ! -d $$subdir ; \
- then \
- echo "Creating $$subdir..." ; \
- mkdir -p $$subdir ; \
- chmod a+rx $$subdir ; \
- fi ; \
- done
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
@@ -38,9 +27,5 @@ $(EVERYTHING)::
( cd $$subdir && $(MAKE) $@ ) || exit 1; \
done
-install::
- $(call installdata,ICE_LICENSE,$(prefix))
- $(call installdata,LICENSE,$(prefix))
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/rb/Makefile.mak b/rb/Makefile.mak
index 74a2e84006d..a44eca1b348 100755
--- a/rb/Makefile.mak
+++ b/rb/Makefile.mak
@@ -13,26 +13,15 @@ top_srcdir = .
SUBDIRS = src ruby
-INSTALL_SUBDIRS = $(install_rubydir)
-
-install::
- @if not exist $(prefix) \
- @echo "Creating $(prefix)..." && \
- mkdir $(prefix)
-
- @for %i in ( $(INSTALL_SUBDIRS) ) do \
- @if not exist %i \
- @echo "Creating %i..." && \
- mkdir %i
+install:: install-common
+ @if not exist $(install_rubydir) \
+ @echo "Creating $(install_rubydir)..." && \
+ mkdir $(install_rubydir)
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
@echo "making $@ in %i" && \
cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-install::
- copy ICE_LICENSE $(prefix)
- copy LICENSE $(prefix)
-
test::
@python $(top_srcdir)/allTests.py
diff --git a/rb/makedist.py b/rb/makedist.py
deleted file mode 100755
index bc18c811408..00000000000
--- a/rb/makedist.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, glob
-
-#
-# Show usage information.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- return result
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Are we on Windows?
-#
-win32 = sys.platform.startswith("win") or sys.platform.startswith("cygwin")
-
-if os.path.exists("../.git"):
- print "Unable to run in repository! Exiting..."
- sys.exit(1)
-
-#
-# Check arguments
-#
-verbose = 0
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = 1
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = "dist"
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-icedir = os.path.join(os.getcwd(), "..", "cpp")
-config = open(os.path.join("config", "Make.rules"), "r")
-version = re.search("VERSION[= \t]*([0-9\.b]+)", config.read()).group(1)
-icerbver = "IceRuby-" + version
-
-os.mkdir(os.path.join(distdir, icerbver))
-
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-
-#
-# Remove files.
-#
-print "Creating exclusion file..."
-filesToRemove = [ "makedist.py", "makebindist.py", "makewindist.py", "exclusions", "dist", "allDemos.py"]
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-
-os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icerbver) + " && tar xf - )")
-
-os.chdir(distdir)
-
-#
-# Copy Make.rules.Linux and Make.rules.msvc
-#
-shutil.copyfile(os.path.join(icedir, "config", "Make.rules.Linux"),
- os.path.join(icerbver, "config", "Make.rules.Linux"))
-
-shutil.copyfile(os.path.join(icedir, "config", "Make.rules.msvc"),
- os.path.join(icerbver, "config", "Make.rules.msvc"))
-
-
-print "Fixing version in README and INSTALL files..."
-fixVersion(find(icerbver, "README*"), version)
-fixVersion(find(icerbver, "INSTALL*"), version)
-
-#
-# Create source archives.
-#
-print "Creating distribution archives..."
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-os.system("chmod -R u+rw,go+r-w . " + icerbver)
-os.system("find " + icerbver + " \\( -name \"*.ice\" -or -name \"*.xml\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icerbver + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icerbver + " -type d -exec chmod a+x {} \\;")
-os.system("find " + icerbver + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar c" + quiet + "f " + icerbver + ".tar " + icerbver)
-os.system("gzip -9 " + icerbver + ".tar")
-if verbose:
- quiet = ""
-else:
- quiet = "-q"
-os.system("zip -9 -r " + quiet + " " + icerbver + ".zip " + icerbver)
-
-#
-# Copy files (README, etc.).
-#
-shutil.copyfile(os.path.join(icerbver, "CHANGES"), "IceRuby-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icerbver)
-print "Done."
diff --git a/vb/makedist.py b/vb/makedist.py
deleted file mode 100755
index b5bda5c02e2..00000000000
--- a/vb/makedist.py
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, fileinput
-
-#
-# Show usage information.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- elif fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- return result
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
-
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Do a search and replace on a file using regular expressions a la sed.
-#
-def sedFile(path, patt, replace):
- src = open(path, "r")
- srcLines = src.readlines()
-
- dstLines = []
- for x in srcLines:
- dstLines.append(re.sub(patt, replace, x))
-
- src.close()
- dst = open(path, "w")
- dst.writelines(dstLines)
-
-def editMakefileMak(file):
- makefile = fileinput.input(file, True)
- for line in makefile:
- if line.startswith('!include'):
- print '!include $(top_srcdir)/config/Make.rules.mak.vb'
- else:
- print line.rstrip('\n')
- makefile.close()
-
-#
-# Are we on Windows?
-#
-win32 = sys.platform.startswith("win") or sys.platform.startswith("cygwin")
-
-if os.path.exists("../.git"):
- print "Unable to run in repository! Exiting..."
- sys.exit(1)
-
-#
-# Check arguments
-#
-verbose = 0
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = 1
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
-
-if win32 and not skipDocs:
- print sys.argv[0] + ": the documentation cannot be built on Windows."
- sys.exit(1)
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = "dist"
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-
-icecsdir = os.path.join(os.getcwd(), "..", "cs")
-
-#
-# Get Ice version.
-#
-config = open(os.path.join(icecsdir, "src", "Ice", "AssemblyInfo.cs"), "r")
-version = re.search("AssemblyVersion.*\"([0-9\.]*)\"", config.read()).group(1)
-checkBeta = version.split('.')
-if int(checkBeta[2]) > 50:
- version = "%s.%sb" % (checkBeta[0], checkBeta[1])
- beta = int(checkBeta[2]) - 50
- if beta > 1:
- version = version + str(beta)
-
-icevbver = "IceVB-" + version
-
-os.mkdir(os.path.join(distdir, icevbver))
-
-if verbose:
- quiet = "-v"
-else:
- quiet = ""
-
-#
-# Remove files.
-#
-print "Removing unnecessary files..."
-filesToRemove = [ "makedist.py", "exclusions", "dist", "allDemos.py" ]
-filesToRemove.extend(find(".", ".gitignore"))
-filesToRemove.extend(find(".", "expect.py"))
-
-exclusionFile = open("exclusions", "w")
-for x in filesToRemove:
- exclusionFile.write("%s\n" % x)
-exclusionFile.close()
-
-os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icevbver) + " && tar xf - )")
-
-os.chdir(distdir)
-
-print "Fixing version in README and INSTALL files..."
-fixVersion(find(icevbver, "README*"), version)
-fixVersion(find(icevbver, "INSTALL*"), version)
-
-#
-# Fix source dist demo project files.
-#
-hintPathSearch = r'(HintPath = "(\.\.\\)*)icecs(\\bin\\.*cs\.dll")'
-hintPathReplace = r'\1IceCS-' + version + r'\3'
-projectFiles = find(os.path.join(icevbver, "demo"), "*.vbproj")
-for x in projectFiles:
- if not x.endswith("D.vbproj"):
- sedFile(x, hintPathSearch, hintPathReplace)
-
-#
-# Create source archives.
-#
-print "Creating distribution archives..."
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-os.system("chmod -R u+rw,go+r-w . " + icevbver)
-os.system("find " + icevbver + " \\( -name \"*.vb\" -or -name \"*.ice\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icevbver + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icevbver + " \\( -name \"*.xml\" \\) -exec chmod a-x {} \\;")
-os.system("find " + icevbver + " -type d -exec chmod a+x {} \\;")
-os.system("find " + icevbver + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar c" + quiet + "zf " + icevbver + ".tar.gz " + icevbver)
-if verbose:
- quiet = ""
-else:
- quiet = "-q"
-os.system("zip -9 -r " + quiet + " " + icevbver + ".zip " + icevbver)
-
-#
-# Copy files (README, etc.).
-#
-shutil.copyfile(os.path.join(icevbver, "CHANGES"), "IceVB-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icevbver)
-print "Done."