Fixed file eol-style problems as well as issues introduced in the

makesystem with the Windows Install check-in.
This commit is contained in:
Juan Carlos Luciani
2007-01-16 11:21:37 +00:00
parent 3ba102c4f1
commit de3e4457c3
21 changed files with 2855 additions and 2855 deletions

View File

@@ -1,42 +1,42 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# #
####################################################################### #######################################################################
SUBDIRS = src $(TARGET_OS) SUBDIRS = src $(TARGET_OS)
DIST_SUBDIRS = src linux windows DIST_SUBDIRS = src linux windows
EXTRA_DIST = $(JAVAFILES) \ EXTRA_DIST = $(JAVAFILES) \
make_test.sh \ make_test.sh \
run_test.sh run_test.sh
JAVAFILES = src/com/novell/casa/jaas/CasaLoginModule.java \ JAVAFILES = src/com/novell/casa/jaas/CasaLoginModule.java \
src/com/novell/casa/jaas/CasaPrincipal.java src/com/novell/casa/jaas/CasaPrincipal.java
.PHONY: package package-clean package-install package-uninstall .PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall: package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@ $(MAKE) -C $(TARGET_OS) $@
clean-local: clean-local:
if [ -d lib ]; then rm -rf lib; fi if [ -d lib ]; then rm -rf lib; fi
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,85 +1,85 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Juan Carlos Luciani <jluciani@novell.com> # Author: Juan Carlos Luciani <jluciani@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
CFILES = CFILES =
EXTRA_DIST = client_keystore_setup.sh \ EXTRA_DIST = client_keystore_setup.sh \
crypto.properties crypto.properties
ROOT = ../.. ROOT = ../..
LIBDIR = $(ROOT)/$(LIB) LIBDIR = $(ROOT)/$(LIB)
JAVAC= javac JAVAC= javac
MODULE_NAME = CasaJaasSupport MODULE_NAME = CasaJaasSupport
MODULE_EXT = jar MODULE_EXT = jar
JAVAFILES = ../src/com/novell/casa/jaas/CasaLoginModule.java \ JAVAFILES = ../src/com/novell/casa/jaas/CasaLoginModule.java \
../src/com/novell/casa/jaas/CasaPrincipal.java ../src/com/novell/casa/jaas/CasaPrincipal.java
BUILDDIR = ../build BUILDDIR = ../build
CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class)) CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class))
LIBS = LIBS =
CLASSPATH = $(LIBDIR)/java/CasaAuthToken.jar:$(LIBS) CLASSPATH = $(LIBDIR)/java/CasaAuthToken.jar:$(LIBS)
all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(BUILDDIR)/%.class: %.java $(BUILDDIR)/%.class: %.java
@echo [======== Compiling $@ ========] @echo [======== Compiling $@ ========]
$(JAVAC) -g -sourcepath ../src -classpath $(CLASSPATH) -d $(BUILDDIR)/classes $< $(JAVAC) -g -sourcepath ../src -classpath $(CLASSPATH) -d $(BUILDDIR)/classes $<
$(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) -C $(BUILDDIR)/classes . jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) -C $(BUILDDIR)/classes .
cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/ cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/
$(BUILDDIR): $(BUILDDIR):
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR) [ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
[ -d $(BUILDDIR)/classes ] || mkdir -p $(BUILDDIR)/classes [ -d $(BUILDDIR)/classes ] || mkdir -p $(BUILDDIR)/classes
[ -d $(LIBDIR) ] || mkdir -p $(LIBDIR) [ -d $(LIBDIR) ] || mkdir -p $(LIBDIR)
[ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java [ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java
install-exec-local: install-exec-local:
uninstall-local: uninstall-local:
#installcheck-local: install #installcheck-local: install
clean-local: clean-local:
if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi
if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi
distclean-local: distclean-local:
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in
rm -f Makefile rm -f Makefile

View File

@@ -1,81 +1,81 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = EXTRA_DIST =
ROOT = ../.. ROOT = ../..
LIB = lib LIB = lib
LIBDIR = $(ROOT)/$(LIB) LIBDIR = $(ROOT)/$(LIB)
JAVAC= javac JAVAC= javac
MODULE_NAME = CasaJaasSupport MODULE_NAME = CasaJaasSupport
MODULE_EXT = jar MODULE_EXT = jar
JAVAFILES = ../src/com/novell/casa/jaas/CasaLoginModule.java \ JAVAFILES = ../src/com/novell/casa/jaas/CasaLoginModule.java \
../src/com/novell/casa/jaas/CasaPrincipal.java ../src/com/novell/casa/jaas/CasaPrincipal.java
BUILDDIR = ../build BUILDDIR = ../build
CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class)) CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class))
LIBS = LIBS =
CLASSPATH = $(LIBDIR)/java/CasaAuthToken.jar;$(LIBS) CLASSPATH = $(LIBDIR)/java/CasaAuthToken.jar;$(LIBS)
CUR_DIR := $(shell pwd) CUR_DIR := $(shell pwd)
all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) all: $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(BUILDDIR)/%.class: %.java $(BUILDDIR)/%.class: %.java
@echo [======== Compiling $@ ========] @echo [======== Compiling $@ ========]
$(JAVAC) -g -sourcepath ../src -classpath "$(CLASSPATH)" -d $(BUILDDIR)/classes $< $(JAVAC) -g -sourcepath ../src -classpath "$(CLASSPATH)" -d $(BUILDDIR)/classes $<
$(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) -C $(BUILDDIR)/classes . jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) -C $(BUILDDIR)/classes .
cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/ cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/
$(BUILDDIR): $(BUILDDIR):
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR) [ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
[ -d $(BUILDDIR)/classes ] || mkdir -p $(BUILDDIR)/classes [ -d $(BUILDDIR)/classes ] || mkdir -p $(BUILDDIR)/classes
[ -d $(LIBDIR) ] || mkdir -p $(LIBDIR) [ -d $(LIBDIR) ] || mkdir -p $(LIBDIR)
[ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java [ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java
install-exec-local: install-exec-local:
uninstall-local: uninstall-local:
#installcheck-local: install #installcheck-local: install
clean-local: clean-local:
if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi
if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi
distclean-local: distclean-local:
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in
rm -f Makefile rm -f Makefile

View File

@@ -20,7 +20,7 @@
####################################################################### #######################################################################
SUBDIRS = src SUBDIRS = src
DIST_SUBDIRS = src external tomcat5 linux manifest templates DIST_SUBDIRS = src external tomcat5 linux manifest templates windows
EXTRA_DIST = README \ EXTRA_DIST = README \
TODO \ TODO \

View File

@@ -1,43 +1,43 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Juan Carlos Luciani <jluciani@novell.com> # Author: Juan Carlos Luciani <jluciani@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = $(TARGET_OS) SUBDIRS = $(TARGET_OS)
DIST_SUBDIRS = Catalina linux windows DIST_SUBDIRS = Catalina linux windows
CFILES = CFILES =
EXTRA_DIST = catalina.policy \ EXTRA_DIST = catalina.policy \
catalina.properties \ catalina.properties \
jk2.properties \ jk2.properties \
server.xml \ server.xml \
server-minimal.xml \ server-minimal.xml \
tomcat-users.xml \ tomcat-users.xml \
web.xml web.xml
.PHONY: package package-clean package-install package-uninstall .PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall: package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@ $(MAKE) -C $(TARGET_OS) $@
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,37 +1,37 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
CFILES = CFILES =
EXTRA_DIST = server-sun.xml EXTRA_DIST = server-sun.xml
.PHONY: package package-clean package-install package-uninstall .PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall: package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@ $(MAKE) -C $(TARGET_OS) $@
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,382 +1,382 @@
<!-- Example Server Configuration File --> <!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their <!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --> parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM, <!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port. listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level. define subcomponents such as "Valves" or "Loggers" at this level.
--> -->
<Server port="8005" shutdown="SHUTDOWN"> <Server port="8005" shutdown="SHUTDOWN">
<!-- Comment these entries out to disable JMX MBeans support used for the <!-- Comment these entries out to disable JMX MBeans support used for the
administration web application --> administration web application -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/> <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<!-- Global JNDI resources --> <!-- Global JNDI resources -->
<GlobalNamingResources> <GlobalNamingResources>
<!-- Test entry for demonstration purposes --> <!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/> <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by <!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users --> UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container" <Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase" type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved" description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" /> pathname="conf/tomcat-users.xml" />
</GlobalNamingResources> </GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share <!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible a single "Container" (and therefore the web applications visible
within that Container). Normally, that Container is an "Engine", within that Container). Normally, that Container is an "Engine",
but this is not required. but this is not required.
Note: A "Service" is not itself a "Container", so you may not Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level. define subcomponents such as "Valves" or "Loggers" at this level.
--> -->
<!-- Define the Tomcat Stand-Alone Service --> <!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina"> <Service name="Catalina">
<!-- A "Connector" represents an endpoint by which requests are received <!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing. associated "Container" (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080. By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 5 documentation bundle for more detailed HOWTO in the Tomcat 5 documentation bundle for more detailed
instructions): instructions):
* If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
later, and put the JAR files into "$JAVA_HOME/jre/lib/ext". later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
* Execute: * Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows) %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix) $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
with a password value of "changeit" for both the certificate and with a password value of "changeit" for both the certificate and
the keystore itself. the keystore itself.
By default, DNS lookups are enabled when a web application calls By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled, "enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the request.getRemoteHost() will return the String version of the
IP address of the remote client. IP address of the remote client.
--> -->
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192" <Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100" enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value <!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 --> to 0 -->
<!-- Note : To use gzip compression you could set the following properties : <!-- Note : To use gzip compression you could set the following properties :
compression="on" compression="on"
compressionMinSize="2048" compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata" noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml" compressableMimeType="text/html,text/xml"
--> -->
<!-- Define a SSL HTTP/1.1 Connector on port 8443 --> <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!-- <!--
<Connector port="8443" maxHttpHeaderSize="8192" <Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true" enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true" acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" /> clientAuth="false" sslProtocol="TLS" />
--> -->
<!-- Define an AJP 1.3 Connector on port 8009 --> <!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" <Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" /> enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 --> <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. --> <!-- See proxy documentation for more information about using this. -->
<!-- <!--
<Connector port="8082" <Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000" enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" /> proxyPort="80" disableUploadTimeout="true" />
--> -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 2645 --> <!-- Define a SSL Coyote HTTP/1.1 Connector on port 2645 -->
<Connector port="2645" <Connector port="2645"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true" enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true" acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" clientAuth="false" sslProtocol="TLS"
keystoreFile="ATS_INSTALL_DIRats\etc\keys\server\jks-store" keystoreFile="ATS_INSTALL_DIRats\etc\keys\server\jks-store"
keystorePass="secret" algorithm="SunX509" /> keystorePass="secret" algorithm="SunX509" />
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009
<Connector port="8009" <Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0" enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" /> protocol="AJP/1.3" />
--> -->
<!-- An Engine represents the entry point (within Catalina) that processes <!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). --> on to the appropriate Host (virtual host). -->
<!-- You should set jvmRoute to support load-balancing via AJP ie : <!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1"> <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
--> -->
<!-- Define the top level container in our container hierarchy --> <!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost"> <Engine name="Catalina" defaultHost="localhost">
<!-- The request dumper valve dumps useful debugging information about <!-- The request dumper valve dumps useful debugging information about
the request headers and cookies that were received, and the response the request headers and cookies that were received, and the response
headers and cookies that were sent, for all requests received by headers and cookies that were sent, for all requests received by
this instance of Tomcat. If you care only about requests to a this instance of Tomcat. If you care only about requests to a
particular virtual host, or a particular application, nest this particular virtual host, or a particular application, nest this
element inside the corresponding <Host> or <Context> entry instead. element inside the corresponding <Host> or <Context> entry instead.
For a similar mechanism that is portable to all Servlet 2.4 For a similar mechanism that is portable to all Servlet 2.4
containers, check out the "RequestDumperFilter" Filter in the containers, check out the "RequestDumperFilter" Filter in the
example application (the source for this filter may be found in example application (the source for this filter may be found in
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters"). "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
Request dumping is disabled by default. Uncomment the following Request dumping is disabled by default. Uncomment the following
element to enable it. --> element to enable it. -->
<!-- <!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/> <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
--> -->
<!-- Because this Realm is here, an instance will be shared globally --> <!-- Because this Realm is here, an instance will be shared globally -->
<!-- This Realm uses the UserDatabase configured in the global JNDI <!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately that are performed against this UserDatabase are immediately
available for use by the Realm. --> available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/> resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we <!-- Comment out the old realm but leave here for now in case we
need to go back quickly --> need to go back quickly -->
<!-- <!--
<Realm className="org.apache.catalina.realm.MemoryRealm" /> <Realm className="org.apache.catalina.realm.MemoryRealm" />
--> -->
<!-- Replace the above Realm with one of the following to get a Realm <!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC --> stored in a database and accessed via JDBC -->
<!-- <!--
<Realm className="org.apache.catalina.realm.JDBCRealm" <Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.gjt.mm.mysql.Driver" driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority" connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test" connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass" userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" /> userRoleTable="user_roles" roleNameCol="role_name" />
--> -->
<!-- <!--
<Realm className="org.apache.catalina.realm.JDBCRealm" <Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.driver.OracleDriver" driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL" connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger" connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass" userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" /> userRoleTable="user_roles" roleNameCol="role_name" />
--> -->
<!-- <!--
<Realm className="org.apache.catalina.realm.JDBCRealm" <Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="sun.jdbc.odbc.JdbcOdbcDriver" driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA" connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass" userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" /> userRoleTable="user_roles" roleNameCol="role_name" />
--> -->
<!-- Define the default virtual host <!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2. Note: XML Schema validation will not work with Xerces 2.2.
--> -->
<Host name="localhost" appBase="webapps" <Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node, <!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed. By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones. that need to be clustered and remove the other ones.
A cluster has the following parameters: A cluster has the following parameters:
className = the fully qualified name of the cluster class className = the fully qualified name of the cluster class
clusterName = a descriptive name for your cluster, can be anything clusterName = a descriptive name for your cluster, can be anything
mcastAddr = the multicast address, has to be the same for all the nodes mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddress = bind the multicast socket to a specific address mcastBindAddress = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host, tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards. in case of multiple ethernet cards.
auto means that address becomes auto means that address becomes
InetAddress.getLocalHost().getHostAddress() InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called. useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request. false means to replicate the session after each request.
false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager) false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
<% <%
HashMap map = (HashMap)session.getAttribute("map"); HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value"); map.put("key","value");
%> %>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'. replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication. * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the * Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all thread the replicates the data to the other nodes, and will not return until all
nodes have received the information. nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node, * Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue, so the request thread will queue the replication request into a "smart" queue,
and then return to the client. and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay. large network delay.
--> -->
<!-- <!--
When configuring for clustering, you also add in a valve to catch all the requests When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated. coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met: A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND 1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created) 2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute 3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session, The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request. hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out, The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters. ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to. The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted. ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide. The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node. so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true" The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance, When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster. and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide and cluster wide
--> -->
<!-- <!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager" managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false" expireSessionsOnShutdown="false"
useDirtyFlag="true" useDirtyFlag="true"
notifyListenersOnReplication="true"> notifyListenersOnReplication="true">
<Membership <Membership
className="org.apache.catalina.cluster.mcast.McastService" className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4" mcastAddr="228.0.0.4"
mcastPort="45564" mcastPort="45564"
mcastFrequency="500" mcastFrequency="500"
mcastDropTime="3000"/> mcastDropTime="3000"/>
<Receiver <Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener" className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto" tcpListenAddress="auto"
tcpListenPort="4001" tcpListenPort="4001"
tcpSelectorTimeout="100" tcpSelectorTimeout="100"
tcpThreadCount="6"/> tcpThreadCount="6"/>
<Sender <Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter" className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled" replicationMode="pooled"
ackTimeout="15000" ackTimeout="15000"
waitForAck="true"/> waitForAck="true"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve" <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/> filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer" <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/" tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/" deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/" watchDir="/tmp/war-listen/"
watchEnabled="false"/> watchEnabled="false"/>
<ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/> <ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
</Cluster> </Cluster>
--> -->
<!-- Normally, users must authenticate themselves to each web app <!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that resource protected by a security constraint, and then have that
user identity maintained across *all* web applications contained user identity maintained across *all* web applications contained
in this virtual host. --> in this virtual host. -->
<!-- <!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" /> <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
--> -->
<!-- Access log processes all requests for this virtual host. By <!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different $CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory. (to $CATALINA_HOME) or absolute path to the desired directory.
--> -->
<!-- <!--
<Valve className="org.apache.catalina.valves.AccessLogValve" <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt" directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/> pattern="common" resolveHosts="false"/>
--> -->
<!-- Access log processes all requests for this virtual host. By <!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different $CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory. (to $CATALINA_HOME) or absolute path to the desired directory.
This access log implementation is optimized for maximum performance, This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns. but is hardcoded to support only the "common" and "combined" patterns.
--> -->
<!-- <!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve" <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt" directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/> pattern="common" resolveHosts="false"/>
--> -->
</Host> </Host>
</Engine> </Engine>
</Service> </Service>
</Server> </Server>

View File

@@ -1,209 +1,209 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
CFILES = CFILES =
EXTRA_DIST = crypto.properties EXTRA_DIST = crypto.properties
ROOT = ../.. ROOT = ../..
LIBDIR = $(ROOT)/$(LIB) LIBDIR = $(ROOT)/$(LIB)
IDENT_ABSTRACTION_DIR = $(BANDIT_DIR) IDENT_ABSTRACTION_DIR = $(BANDIT_DIR)
#AXIS_JARS_DIR = $(PWD)/external #AXIS_JARS_DIR = $(PWD)/external
AXIS_JARS_DIR = ../external AXIS_JARS_DIR = ../external
MANIFEST_DIR = ../manifest MANIFEST_DIR = ../manifest
JAVAC= javac JAVAC= javac
WEBAPP_NAME = CasaAuthTokenSvc WEBAPP_NAME = CasaAuthTokenSvc
WEBAPP_EXT = war WEBAPP_EXT = war
MODULE_NAME = CasaAuthToken MODULE_NAME = CasaAuthToken
MODULE_EXT = jar MODULE_EXT = jar
AUTH_TOKEN_SETTINGS_EDITOR_MODULE_NAME = CasaAuthTokenSettingsEditor AUTH_TOKEN_SETTINGS_EDITOR_MODULE_NAME = CasaAuthTokenSettingsEditor
IDEN_TOKEN_SETTINGS_EDITOR_MODULE_NAME = CasaIdenTokenSettingsEditor IDEN_TOKEN_SETTINGS_EDITOR_MODULE_NAME = CasaIdenTokenSettingsEditor
SVC_SETTINGS_EDITOR_MODULE_NAME = CasaSvcSettingsEditor SVC_SETTINGS_EDITOR_MODULE_NAME = CasaSvcSettingsEditor
AUTH_POLICY_EDITOR_MODULE_NAME = CasaAuthPolicyEditor AUTH_POLICY_EDITOR_MODULE_NAME = CasaAuthPolicyEditor
JAVAFILES = ../src/com/novell/casa/authtoksvc/ProtoDefs.java \ JAVAFILES = ../src/com/novell/casa/authtoksvc/ProtoDefs.java \
../src/com/novell/casa/authtoksvc/AuthMechConfig.java \ ../src/com/novell/casa/authtoksvc/AuthMechConfig.java \
../src/com/novell/casa/authtoksvc/SvcConfig.java \ ../src/com/novell/casa/authtoksvc/SvcConfig.java \
../src/com/novell/casa/authtoksvc/IdenTokenConfig.java \ ../src/com/novell/casa/authtoksvc/IdenTokenConfig.java \
../src/com/novell/casa/authtoksvc/AuthTokenConfig.java \ ../src/com/novell/casa/authtoksvc/AuthTokenConfig.java \
../src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java \ ../src/com/novell/casa/authtoksvc/EnabledSvcsConfig.java \
../src/com/novell/casa/authtoksvc/AuthMechanism.java \ ../src/com/novell/casa/authtoksvc/AuthMechanism.java \
../src/com/novell/casa/authtoksvc/WSSecurity.java \ ../src/com/novell/casa/authtoksvc/WSSecurity.java \
../src/com/novell/casa/authtoksvc/SessionToken.java \ ../src/com/novell/casa/authtoksvc/SessionToken.java \
../src/com/novell/casa/authtoksvc/Authenticate.java \ ../src/com/novell/casa/authtoksvc/Authenticate.java \
../src/com/novell/casa/authtoksvc/RpcMethod.java \ ../src/com/novell/casa/authtoksvc/RpcMethod.java \
../src/com/novell/casa/authtoksvc/Rpc.java \ ../src/com/novell/casa/authtoksvc/Rpc.java \
../src/com/novell/casa/authtoksvc/GetAuthPolicy.java \ ../src/com/novell/casa/authtoksvc/GetAuthPolicy.java \
../src/com/novell/casa/authtoksvc/Base64Coder.java \ ../src/com/novell/casa/authtoksvc/Base64Coder.java \
../src/com/novell/casa/authtoksvc/AuthReqMsg.java \ ../src/com/novell/casa/authtoksvc/AuthReqMsg.java \
../src/com/novell/casa/authtoksvc/AuthRespMsg.java \ ../src/com/novell/casa/authtoksvc/AuthRespMsg.java \
../src/com/novell/casa/authtoksvc/IdentityToken.java \ ../src/com/novell/casa/authtoksvc/IdentityToken.java \
../src/com/novell/casa/authtoksvc/CasaIdentityToken.java \ ../src/com/novell/casa/authtoksvc/CasaIdentityToken.java \
../src/com/novell/casa/authtoksvc/AuthToken.java \ ../src/com/novell/casa/authtoksvc/AuthToken.java \
../src/com/novell/casa/authtoksvc/GetAuthPolicyReqMsg.java \ ../src/com/novell/casa/authtoksvc/GetAuthPolicyReqMsg.java \
../src/com/novell/casa/authtoksvc/GetAuthPolicyRespMsg.java \ ../src/com/novell/casa/authtoksvc/GetAuthPolicyRespMsg.java \
../src/com/novell/casa/authtoksvc/GetAuthToken.java \ ../src/com/novell/casa/authtoksvc/GetAuthToken.java \
../src/com/novell/casa/authtoksvc/GetAuthTokReqMsg.java \ ../src/com/novell/casa/authtoksvc/GetAuthTokReqMsg.java \
../src/com/novell/casa/authtoksvc/GetAuthTokRespMsg.java \ ../src/com/novell/casa/authtoksvc/GetAuthTokRespMsg.java \
../src/com/novell/casa/authtoksvc/Krb5Authenticate.java \ ../src/com/novell/casa/authtoksvc/Krb5Authenticate.java \
../src/com/novell/casa/authtoksvc/PwdAuthenticate.java \ ../src/com/novell/casa/authtoksvc/PwdAuthenticate.java \
../src/com/novell/casa/authtoksvc/IVerifySetting.java \ ../src/com/novell/casa/authtoksvc/IVerifySetting.java \
../src/com/novell/casa/authtoksvc/SettingsFileUtil.java \ ../src/com/novell/casa/authtoksvc/SettingsFileUtil.java \
../src/com/novell/casa/authtoksvc/SettingsFileSAXHandler.java \ ../src/com/novell/casa/authtoksvc/SettingsFileSAXHandler.java \
../src/com/novell/casa/authtoksvc/AuthPolicyEditor.java \ ../src/com/novell/casa/authtoksvc/AuthPolicyEditor.java \
../src/com/novell/casa/authtoksvc/AuthTokenSettingsEditor.java \ ../src/com/novell/casa/authtoksvc/AuthTokenSettingsEditor.java \
../src/com/novell/casa/authtoksvc/IdenTokenSettingsEditor.java \ ../src/com/novell/casa/authtoksvc/IdenTokenSettingsEditor.java \
../src/com/novell/casa/authtoksvc/SvcSettingsEditor.java ../src/com/novell/casa/authtoksvc/SvcSettingsEditor.java
BUILDDIR = ../build BUILDDIR = ../build
AUTHTOKEN_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com AUTHTOKEN_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com
AUTH_TOKEN_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \ AUTH_TOKEN_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthTokenSettingsEditor.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthTokenSettingsEditor.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthTokenConfig.class -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthTokenConfig.class
IDEN_TOKEN_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \ IDEN_TOKEN_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IdenTokenSettingsEditor.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IdenTokenSettingsEditor.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IdenTokenConfig.class -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IdenTokenConfig.class
SVC_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \ SVC_SETTINGS_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/IVerifySetting.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SettingsFileUtil.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SvcSettingsEditor.class \ -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SvcSettingsEditor.class \
-C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SvcConfig.class -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/SvcConfig.class
AUTH_POLICY_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthPolicyEditor.class AUTH_POLICY_EDITOR_FILES = -C $(BUILDDIR)/webapp/WEB-INF/classes com/novell/casa/authtoksvc/AuthPolicyEditor.class
WEBAPP = $(WEBAPP_NAME).$(WEBAPP_EXT) WEBAPP = $(WEBAPP_NAME).$(WEBAPP_EXT)
AUTH_TOKEN_SETTINGS_EDITOR = $(AUTH_TOKEN_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT) AUTH_TOKEN_SETTINGS_EDITOR = $(AUTH_TOKEN_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT)
IDEN_TOKEN_SETTINGS_EDITOR = $(IDEN_TOKEN_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT) IDEN_TOKEN_SETTINGS_EDITOR = $(IDEN_TOKEN_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT)
SVC_SETTINGS_EDITOR = $(SVC_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT) SVC_SETTINGS_EDITOR = $(SVC_SETTINGS_EDITOR_MODULE_NAME).$(MODULE_EXT)
AUTH_POLICY_EDITOR = $(AUTH_POLICY_EDITOR_MODULE_NAME).$(MODULE_EXT) AUTH_POLICY_EDITOR = $(AUTH_POLICY_EDITOR_MODULE_NAME).$(MODULE_EXT)
CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class)) CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class))
#AXIS_LIBS = $(AXIS_JARS_DIR)/axis.jar:$(AXIS_JARS_DIR)/axis-ant.jar:$(AXIS_JARS_DIR)/commons-discovery-0.2.jar:$(AXIS_JARS_DIR)/commons-logging-1.0.4.jar:$(AXIS_JARS_DIR)/commons-logging-api.jar:$(AXIS_JARS_DIR)/jaxrpc.jar:$(AXIS_JARS_DIR)/log4j-1.2.8.jar:$(AXIS_JARS_DIR)/saaj.jar:$(AXIS_JARS_DIR)/wsdl4j-1.5.1.jar:$(AXIS_JARS_DIR)/wss4j-1.5.0.jar:$(AXIS_JARS_DIR)/xalan.jar:$(AXIS_JARS_DIR)/xercesImpl.jar:$(AXIS_JARS_DIR)/xml-apis.jar:$(AXIS_JARS_DIR)/xmlsec-1.2.1.jar #AXIS_LIBS = $(AXIS_JARS_DIR)/axis.jar:$(AXIS_JARS_DIR)/axis-ant.jar:$(AXIS_JARS_DIR)/commons-discovery-0.2.jar:$(AXIS_JARS_DIR)/commons-logging-1.0.4.jar:$(AXIS_JARS_DIR)/commons-logging-api.jar:$(AXIS_JARS_DIR)/jaxrpc.jar:$(AXIS_JARS_DIR)/log4j-1.2.8.jar:$(AXIS_JARS_DIR)/saaj.jar:$(AXIS_JARS_DIR)/wsdl4j-1.5.1.jar:$(AXIS_JARS_DIR)/wss4j-1.5.0.jar:$(AXIS_JARS_DIR)/xalan.jar:$(AXIS_JARS_DIR)/xercesImpl.jar:$(AXIS_JARS_DIR)/xml-apis.jar:$(AXIS_JARS_DIR)/xmlsec-1.2.1.jar
AXIS_LIBS = $(AXIS_JARS_DIR)/axis.jar;$(AXIS_JARS_DIR)/saaj.jar;$(AXIS_JARS_DIR)/wss4j-1.5.0.jar;$(AXIS_JARS_DIR)/xml-apis.jar;$(AXIS_JARS_DIR)/xmlsec-1.2.1.jar;$(AXIS_JARS_DIR)/xercesImpl.jar AXIS_LIBS = $(AXIS_JARS_DIR)/axis.jar;$(AXIS_JARS_DIR)/saaj.jar;$(AXIS_JARS_DIR)/wss4j-1.5.0.jar;$(AXIS_JARS_DIR)/xml-apis.jar;$(AXIS_JARS_DIR)/xmlsec-1.2.1.jar;$(AXIS_JARS_DIR)/xercesImpl.jar
#AXIS_LIBS = $(AXIS_JARS_DIR)/wss4j-1.5.0.jar #AXIS_LIBS = $(AXIS_JARS_DIR)/wss4j-1.5.0.jar
LIBS = $(TOMCAT_DIR)/servlet-api.jar LIBS = $(TOMCAT_DIR)/servlet-api.jar
CLASSPATH = $(AXIS_LIBS);$(IDENT_ABSTRACTION_DIR)/identity-abstraction.jar;$(IDENT_ABSTRACTION_DIR)/bandit-util.jar;$(LIBS) CLASSPATH = $(AXIS_LIBS);$(IDENT_ABSTRACTION_DIR)/identity-abstraction.jar;$(IDENT_ABSTRACTION_DIR)/bandit-util.jar;$(LIBS)
CUR_DIR := $(shell pwd) CUR_DIR := $(shell pwd)
all: $(BUILDDIR)/$(WEBAPP) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(BUILDDIR)/$(AUTH_POLICY_EDITOR) all: $(BUILDDIR)/$(WEBAPP) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(BUILDDIR)/$(AUTH_POLICY_EDITOR)
$(BUILDDIR)/%.class: %.java $(BUILDDIR)/%.class: %.java
@echo [======== Compiling $@ ========] @echo [======== Compiling $@ ========]
$(JAVAC) -g -sourcepath ../src -classpath "$(CLASSPATH)" -d $(BUILDDIR)/webapp/WEB-INF/classes $< $(JAVAC) -g -sourcepath ../src -classpath "$(CLASSPATH)" -d $(BUILDDIR)/webapp/WEB-INF/classes $<
# The following two lines may need to be added below before we jar-up the war for builds where there is no identity-abstraction install # The following two lines may need to be added below before we jar-up the war for builds where there is no identity-abstraction install
# cp $(IDENT_ABSTRACTION_DIR)/*.jar $(BUILDDIR)/webapp/WEB-INF/lib/ # cp $(IDENT_ABSTRACTION_DIR)/*.jar $(BUILDDIR)/webapp/WEB-INF/lib/
# rm $(BUILDDIR)/webapp/WEB-INF/lib/identity-abstraction.jar # rm $(BUILDDIR)/webapp/WEB-INF/lib/identity-abstraction.jar
$(BUILDDIR)/$(WEBAPP): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(WEBAPP): $(BUILDDIR) $(CLASSES)
@echo [======== Creating Webapp $@ ========] @echo [======== Creating Webapp $@ ========]
cp ../web.xml $(BUILDDIR)/webapp/WEB-INF/web.xml cp ../web.xml $(BUILDDIR)/webapp/WEB-INF/web.xml
cp ../templates/svc.settings $(BUILDDIR)/webapp/WEB-INF/conf/svc.settings cp ../templates/svc.settings $(BUILDDIR)/webapp/WEB-INF/conf/svc.settings
cp ../templates/authtoken.settings $(BUILDDIR)/webapp/WEB-INF/conf/authtoken.settings cp ../templates/authtoken.settings $(BUILDDIR)/webapp/WEB-INF/conf/authtoken.settings
cp ../templates/identoken.settings $(BUILDDIR)/webapp/WEB-INF/conf/identoken.settings cp ../templates/identoken.settings $(BUILDDIR)/webapp/WEB-INF/conf/identoken.settings
cp ../windows/crypto.properties $(BUILDDIR)/webapp/WEB-INF/classes/crypto.properties cp ../windows/crypto.properties $(BUILDDIR)/webapp/WEB-INF/classes/crypto.properties
cp ../src/com/novell/casa/authtoksvc/Krb5_mechanism.settings $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate/mechanism.settings cp ../src/com/novell/casa/authtoksvc/Krb5_mechanism.settings $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate/mechanism.settings
cp ../src/com/novell/casa/authtoksvc/Pwd_mechanism.settings $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate/mechanism.settings cp ../src/com/novell/casa/authtoksvc/Pwd_mechanism.settings $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate/mechanism.settings
cp $(AXIS_JARS_DIR)/*.jar $(BUILDDIR)/webapp/WEB-INF/lib/ cp $(AXIS_JARS_DIR)/*.jar $(BUILDDIR)/webapp/WEB-INF/lib/
ls $(BUILDDIR)/webapp/WEB-INF/lib/ ls $(BUILDDIR)/webapp/WEB-INF/lib/
jar cvf $(BUILDDIR)/$(WEBAPP) -C $(BUILDDIR)/webapp . jar cvf $(BUILDDIR)/$(WEBAPP) -C $(BUILDDIR)/webapp .
echo "LIBDIR = $(LIBDIR)" echo "LIBDIR = $(LIBDIR)"
cp $(BUILDDIR)/$(WEBAPP) $(LIBDIR)/java/ cp $(BUILDDIR)/$(WEBAPP) $(LIBDIR)/java/
$(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(AUTHTOKEN_FILES) jar cvf $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(AUTHTOKEN_FILES)
cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/ cp $(BUILDDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/java/
$(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvmf $(MANIFEST_DIR)/AuthTokenSettingsEditor.txt $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(AUTH_TOKEN_SETTINGS_EDITOR_FILES) jar cvmf $(MANIFEST_DIR)/AuthTokenSettingsEditor.txt $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(AUTH_TOKEN_SETTINGS_EDITOR_FILES)
cp $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(LIBDIR)/java/ cp $(BUILDDIR)/$(AUTH_TOKEN_SETTINGS_EDITOR) $(LIBDIR)/java/
$(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvmf $(MANIFEST_DIR)/IdenTokenSettingsEditor.txt $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(IDEN_TOKEN_SETTINGS_EDITOR_FILES) jar cvmf $(MANIFEST_DIR)/IdenTokenSettingsEditor.txt $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(IDEN_TOKEN_SETTINGS_EDITOR_FILES)
cp $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(LIBDIR)/java/ cp $(BUILDDIR)/$(IDEN_TOKEN_SETTINGS_EDITOR) $(LIBDIR)/java/
$(BUILDDIR)/$(SVC_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(SVC_SETTINGS_EDITOR): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvmf $(MANIFEST_DIR)/SvcSettingsEditor.txt $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(SVC_SETTINGS_EDITOR_FILES) jar cvmf $(MANIFEST_DIR)/SvcSettingsEditor.txt $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(SVC_SETTINGS_EDITOR_FILES)
cp $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(LIBDIR)/java/ cp $(BUILDDIR)/$(SVC_SETTINGS_EDITOR) $(LIBDIR)/java/
$(BUILDDIR)/$(AUTH_POLICY_EDITOR): $(BUILDDIR) $(CLASSES) $(BUILDDIR)/$(AUTH_POLICY_EDITOR): $(BUILDDIR) $(CLASSES)
@echo [======== Jarring $@ ========] @echo [======== Jarring $@ ========]
jar cvmf $(MANIFEST_DIR)/AuthPolicyEditor.txt $(BUILDDIR)/$(AUTH_POLICY_EDITOR) $(AUTH_POLICY_EDITOR_FILES) jar cvmf $(MANIFEST_DIR)/AuthPolicyEditor.txt $(BUILDDIR)/$(AUTH_POLICY_EDITOR) $(AUTH_POLICY_EDITOR_FILES)
cp $(BUILDDIR)/$(AUTH_POLICY_EDITOR) $(LIBDIR)/java/ cp $(BUILDDIR)/$(AUTH_POLICY_EDITOR) $(LIBDIR)/java/
$(BUILDDIR): $(BUILDDIR):
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR) [ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
[ -d $(BUILDDIR)/webapp ] || mkdir -p $(BUILDDIR)/webapp [ -d $(BUILDDIR)/webapp ] || mkdir -p $(BUILDDIR)/webapp
[ -d $(BUILDDIR)/webapp/WEB-INF ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF [ -d $(BUILDDIR)/webapp/WEB-INF ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF
[ -d $(BUILDDIR)/webapp/WEB-INF/classes ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/classes [ -d $(BUILDDIR)/webapp/WEB-INF/classes ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/classes
[ -d $(BUILDDIR)/webapp/WEB-INF/lib ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/lib [ -d $(BUILDDIR)/webapp/WEB-INF/lib ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/lib
[ -d $(BUILDDIR)/webapp/WEB-INF/conf ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf [ -d $(BUILDDIR)/webapp/WEB-INF/conf ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf
[ -d $(BUILDDIR)/webapp/WEB-INF/conf/enabled_services ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/enabled_services [ -d $(BUILDDIR)/webapp/WEB-INF/conf/enabled_services ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/enabled_services
[ -d $(BUILDDIR)/webapp/WEB-INF/conf/auth_mechanisms ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/auth_mechanisms [ -d $(BUILDDIR)/webapp/WEB-INF/conf/auth_mechanisms ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/auth_mechanisms
[ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms [ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms
[ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate [ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/Krb5Authenticate
[ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate [ -d $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate ] || mkdir -p $(BUILDDIR)/webapp/WEB-INF/conf/installed_auth_mechanisms/PwdAuthenticate
[ -d $(LIBDIR) ] || mkdir -p $(LIBDIR) [ -d $(LIBDIR) ] || mkdir -p $(LIBDIR)
[ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java [ -d $(LIBDIR)/java ] || mkdir -p $(LIBDIR)/java
install-exec-local: install-exec-local:
uninstall-local: uninstall-local:
#installcheck-local: install #installcheck-local: install
clean-local: clean-local:
if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi
if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi if [ -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT) ]; then rm -f $(LIBDIR)/java/$(MODULE_NAME).$(MODULE_EXT); fi
if [ -f $(LIBDIR)/java/$(WEBAPP) ]; then rm -f $(LIBDIR)/java/$(WEBAPP); fi if [ -f $(LIBDIR)/java/$(WEBAPP) ]; then rm -f $(LIBDIR)/java/$(WEBAPP); fi
distclean-local: distclean-local:
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in
rm -f Makefile rm -f Makefile

View File

@@ -1,6 +1,6 @@
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=secret org.apache.ws.security.crypto.merlin.keystore.password=secret
org.apache.ws.security.crypto.merlin.keystore.alias=signingKey org.apache.ws.security.crypto.merlin.keystore.alias=signingKey
org.apache.ws.security.crypto.merlin.alias.password=secret org.apache.ws.security.crypto.merlin.alias.password=secret
org.apache.ws.security.crypto.merlin.file=ATS_INSTALL_DIRats\etc\keys\server\jks-store org.apache.ws.security.crypto.merlin.file=ATS_INSTALL_DIRats\etc\keys\server\jks-store

View File

@@ -1,302 +1,302 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# #
####################################################################### #######################################################################
AC_INIT(CASA_auth_token_svc, 1.7.1,,CASA_auth_token_svc) AC_INIT(CASA_auth_token_svc, 1.7.1,,CASA_auth_token_svc)
AC_CONFIG_SRCDIR(autogen.sh) AC_CONFIG_SRCDIR(autogen.sh)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(tar-pax) AM_INIT_AUTOMAKE(tar-pax)
RELEASE=`date +%Y%m%d_%H%M` RELEASE=`date +%Y%m%d_%H%M`
AC_SUBST(RELEASE) AC_SUBST(RELEASE)
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
# #
# Check for a valid C# compiler # Check for a valid C# compiler
# #
#AC_CHECK_PROG(CSC, csc, csc) #AC_CHECK_PROG(CSC, csc, csc)
#test -z "$CSC" && AC_CHECK_PROG(CSC, mcs, mcs) #test -z "$CSC" && AC_CHECK_PROG(CSC, mcs, mcs)
#test -z "$CSC" && AC_MSG_ERROR([no acceptable C Sharp compiler found in \$PATH]) #test -z "$CSC" && AC_MSG_ERROR([no acceptable C Sharp compiler found in \$PATH])
# #
# Check for valid C# compiler in linux # Check for valid C# compiler in linux
# #
case $host_os in case $host_os in
cygwin*) cygwin*)
;; ;;
*) *)
AC_CHECK_PROG(CSC, csc, csc) AC_CHECK_PROG(CSC, csc, csc)
test -z "$CSC" && AC_CHECK_PROG(CSC, mcs, mcs) test -z "$CSC" && AC_CHECK_PROG(CSC, mcs, mcs)
test -z "$CSC" && AC_MSG_ERROR([no acceptable C Sharp compiler found in \$PATH]) test -z "$CSC" && AC_MSG_ERROR([no acceptable C Sharp compiler found in \$PATH])
;; ;;
esac esac
case $CSC in case $CSC in
# #
# Mono-specific configuration # Mono-specific configuration
# #
mcs) mcs)
CSC_EXEFLAG=/target:exe CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library CSC_LIBFLAG=/target:library
CSC_EXEFLAG=/target:exe CSC_EXEFLAG=/target:exe
CSC_WINEXEFLAG=/target:winexe CSC_WINEXEFLAG=/target:winexe
CSCFLAGS='/d:MONO /warn:4 /d:TRACE -d:LINUX' CSCFLAGS='/d:MONO /warn:4 /d:TRACE -d:LINUX'
CSCFLAGS_DEBUG="/debug+ /d:DEBUG" CSCFLAGS_DEBUG="/debug+ /d:DEBUG"
CSCFLAGS_OPTIMIZE="/optimize+" CSCFLAGS_OPTIMIZE="/optimize+"
MONO=mono MONO=mono
MONO_DEBUG='mono --debug' MONO_DEBUG='mono --debug'
MONO_PATH= MONO_PATH=
SYSTEM_XML='System.Xml.dll' SYSTEM_XML='System.Xml.dll'
;; ;;
# #
# .NET-specific configuration # .NET-specific configuration
# #
csc) csc)
CSC_EXEFLAG=/target:exe CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library CSC_LIBFLAG=/target:library
CSC_EXEFLAG=/target:exe CSC_EXEFLAG=/target:exe
CSC_WINEXEFLAG=/target:winexe CSC_WINEXEFLAG=/target:winexe
CSCFLAGS='/d:DOTNET /warn:4 /d:TRACE /nologo' CSCFLAGS='/d:DOTNET /warn:4 /d:TRACE /nologo'
CSCFLAGS_DEBUG="/debug+ /d:DEBUG" CSCFLAGS_DEBUG="/debug+ /d:DEBUG"
CSCFLAGS_OPTIMIZE="/optimize+" CSCFLAGS_OPTIMIZE="/optimize+"
MONO= MONO=
MONO_DEBUG= MONO_DEBUG=
MONO_PATH= MONO_PATH=
SYSTEM_XML='System.XML.dll' SYSTEM_XML='System.XML.dll'
;; ;;
esac esac
AC_SUBST(CSC) AC_SUBST(CSC)
AC_SUBST(CSC_EXEFLAG) AC_SUBST(CSC_EXEFLAG)
AC_SUBST(CSC_LIBFLAG) AC_SUBST(CSC_LIBFLAG)
AC_SUBST(CSC_WINEXEFLAG) AC_SUBST(CSC_WINEXEFLAG)
AC_SUBST(CSCFLAGS) AC_SUBST(CSCFLAGS)
AC_SUBST(CSCFLAGS_DEBUG) AC_SUBST(CSCFLAGS_DEBUG)
AC_SUBST(MONO) AC_SUBST(MONO)
AC_SUBST(MONO_PATH) AC_SUBST(MONO_PATH)
AC_SUBST(SYSTEM_XML) AC_SUBST(SYSTEM_XML)
SRCDIR='$(top_srcdir)' SRCDIR='$(top_srcdir)'
DOCDIR="$SRCDIR/doc" DOCDIR="$SRCDIR/doc"
TOOLDIR='$(top_srcdir)/tools' TOOLDIR='$(top_srcdir)/tools'
AC_SUBST(SRCDIR) AC_SUBST(SRCDIR)
AC_SUBST(DOCDIR) AC_SUBST(DOCDIR)
AC_SUBST(TOOLDIR) AC_SUBST(TOOLDIR)
EMPTY= EMPTY=
SPACE='$(EMPTY) $(EMPTY)' SPACE='$(EMPTY) $(EMPTY)'
AC_SUBST(EMPTY) AC_SUBST(EMPTY)
AC_SUBST(SPACE) AC_SUBST(SPACE)
# #
# Check for operating system and set TARGET_OS # Check for operating system and set TARGET_OS
# #
case $host_os in case $host_os in
cygwin*) cygwin*)
TARGET_OS='windows' TARGET_OS='windows'
;; ;;
*) *)
TARGET_OS='linux' TARGET_OS='linux'
;; ;;
esac esac
AC_SUBST(TARGET_OS) AC_SUBST(TARGET_OS)
AM_CONDITIONAL(LINUX, test "$TARGET_OS" = "linux") AM_CONDITIONAL(LINUX, test "$TARGET_OS" = "linux")
AM_CONDITIONAL(WINDOWS, test "$TARGET_OS" = "windows") AM_CONDITIONAL(WINDOWS, test "$TARGET_OS" = "windows")
# #
# Check for architecture and set TARGET_ARCH # Check for architecture and set TARGET_ARCH
# ia64 needs to be treated as non64. # ia64 needs to be treated as non64.
case $target_cpu in case $target_cpu in
x86_64|p*pc64|s390x) x86_64|p*pc64|s390x)
LIB=lib64 LIB=lib64
;; ;;
*ia64|*) *ia64|*)
LIB=lib LIB=lib
;; ;;
esac esac
AC_SUBST(LIB) AC_SUBST(LIB)
AM_CONDITIONAL(LIB64, test "$LIB" = lib64) AM_CONDITIONAL(LIB64, test "$LIB" = lib64)
# #
# #
# Set platform-specific variables # Set platform-specific variables
# #
case $TARGET_OS in case $TARGET_OS in
# #
# Linux-specific configuration # Linux-specific configuration
# #
linux) linux)
# #
# Set variables # Set variables
# #
COMMON_CLEAN_FILES='' COMMON_CLEAN_FILES=''
ICON_EXT='.ico' ICON_EXT='.ico'
ICON_FLAG='/resource:' ICON_FLAG='/resource:'
PLATFORM_SUBDIRS=$LINUX_SUBDIRS PLATFORM_SUBDIRS=$LINUX_SUBDIRS
SEP='/' SEP='/'
LINK=gcc LINK=gcc
;; ;;
# #
# Windows-specific configuration # Windows-specific configuration
# #
windows) windows)
COMMON_CLEAN_FILES='*.suo */*.suo *.csproj.user */*.csproj.user bin obj */bin */obj *.xml */*.xml *.pdb */*.pdb' COMMON_CLEAN_FILES='*.suo */*.suo *.csproj.user */*.csproj.user bin obj */bin */obj *.xml */*.xml *.pdb */*.pdb'
ICON_EXT='.ico' ICON_EXT='.ico'
ICON_FLAG='/win32icon:' ICON_FLAG='/win32icon:'
PLATFORM_SUBDIRS=$WINDOWS_SUBDIRS PLATFORM_SUBDIRS=$WINDOWS_SUBDIRS
SEP='$(EMPTY)\\$(EMPTY)' SEP='$(EMPTY)\\$(EMPTY)'
LINK=link.exe LINK=link.exe
;; ;;
esac esac
AC_SUBST(COMMON_CLEAN_FILES) AC_SUBST(COMMON_CLEAN_FILES)
AC_SUBST(ICON_EXT) AC_SUBST(ICON_EXT)
AC_SUBST(ICON_FLAG) AC_SUBST(ICON_FLAG)
AC_SUBST(PLATFORM_SUBDIRS) AC_SUBST(PLATFORM_SUBDIRS)
AC_SUBST(SEP) AC_SUBST(SEP)
AC_SUBST(LINK) AC_SUBST(LINK)
# #
# Run standard macros # Run standard macros
# #
AM_PROG_CC_STDC AM_PROG_CC_STDC
AC_PROG_INSTALL AC_PROG_INSTALL
AC_HEADER_STDC AC_HEADER_STDC
####### #######
# #
# set CFLAGS # set CFLAGS
# #
case $host_os in case $host_os in
linux*) linux*)
CFLAGS="$CFLAGS" CFLAGS="$CFLAGS"
;; ;;
cygwin*) cygwin*)
CC=cl.exe CC=cl.exe
CFLAGS="-D WIN32 -D SSCS_WIN32_PLAT_F -D N_PLAT_CLIENT -MT -Ox" CFLAGS="-D WIN32 -D SSCS_WIN32_PLAT_F -D N_PLAT_CLIENT -MT -Ox"
;; ;;
esac esac
# #
# Handle --enable-debug # Handle --enable-debug
# #
AC_ARG_ENABLE(debug, [ AC_ARG_ENABLE(debug, [
--enable-debug configure the Makefiles to build in DEBUG mode], --enable-debug configure the Makefiles to build in DEBUG mode],
[case "${enableval}" in [case "${enableval}" in
yes) enable_debug=true ;; yes) enable_debug=true ;;
no) enable_debug=false ;; no) enable_debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[enable_debug=false]) esac],[enable_debug=false])
AM_CONDITIONAL(DEBUG, test x$enable_debug = xtrue) AM_CONDITIONAL(DEBUG, test x$enable_debug = xtrue)
if test "$enable_debug" = "true" if test "$enable_debug" = "true"
then then
# Build debug version. # Build debug version.
# CFLAGS="$CFLAGS_DEBUG $CFLAGS -DDBG -DDEBUG" # CFLAGS="$CFLAGS_DEBUG $CFLAGS -DDBG -DDEBUG"
CFLAGS="$CFLAGS_DEBUG $CFLAGS -g -DDBG -DDEBUG \ CFLAGS="$CFLAGS_DEBUG $CFLAGS -g -DDBG -DDEBUG \
-fPIC -DPIC -DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \ -fPIC -DPIC -DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \
-D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \ -D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \
-DUNIX -DLINUX -DIAPX38" -DUNIX -DLINUX -DIAPX38"
CSCFLAGS="$CSCFLAGS_DEBUG $CSCFLAGS" CSCFLAGS="$CSCFLAGS_DEBUG $CSCFLAGS"
CXXFLAGS="$CXXFLAGS_DEBUG $CXXFLAGS" CXXFLAGS="$CXXFLAGS_DEBUG $CXXFLAGS"
DEVENV_CONFIGURATION=Debug DEVENV_CONFIGURATION=Debug
MONO=$MONO_DEBUG MONO=$MONO_DEBUG
else else
# Build optimized version. # Build optimized version.
CFLAGS="$CFLAGS_OPTIMIZE $CFLAGS -g -fPIC -DPIC \ CFLAGS="$CFLAGS_OPTIMIZE $CFLAGS -g -fPIC -DPIC \
-DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \ -DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \
-D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \ -D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \
-DUNIX -DLINUX -DIAPX38" -DUNIX -DLINUX -DIAPX38"
CSCFLAGS="$CSCFLAGS_OPTIMIZE $CSCFLAGS" CSCFLAGS="$CSCFLAGS_OPTIMIZE $CSCFLAGS"
CXXFLAGS="$CXXFLAGS_OPTIMIZE $CXXFLAGS" CXXFLAGS="$CXXFLAGS_OPTIMIZE $CXXFLAGS"
DEVENV_CONFIGURATION=Release DEVENV_CONFIGURATION=Release
fi fi
AC_SUBST(CSCFLAGS) AC_SUBST(CSCFLAGS)
AC_SUBST(DEVENV_CONFIGURATION) AC_SUBST(DEVENV_CONFIGURATION)
##comment out due to build failure ##comment out due to build failure
# Check for GCC version to add fstack-protector flag # Check for GCC version to add fstack-protector flag
# #
#GCC_VER="`gcc -dumpversion`" #GCC_VER="`gcc -dumpversion`"
#case "$GCC_VER" in #case "$GCC_VER" in
# 3*) # 3*)
# ;; # ;;
# 4*) # 4*)
# CFLAGS="$CFLAGS -fstack-protector" # CFLAGS="$CFLAGS -fstack-protector"
# ;; # ;;
# *) # *)
# ;; # ;;
#esac #esac
AC_SUBST(GCC_VER) AC_SUBST(GCC_VER)
# #
# Configure PKG_CONFIG # Configure PKG_CONFIG
# #
AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config]) AC_MSG_ERROR([You need to install pkg-config])
fi fi
# #
# Configure files # Configure files
# #
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
package/Makefile package/Makefile
package/linux/Makefile package/linux/Makefile
package/linux/CASA_auth_token_svc.spec package/linux/CASA_auth_token_svc.spec
package/windows/Makefile package/windows/Makefile
package/windows/ClientKeystoreSetup/Makefile package/windows/ClientKeystoreSetup/Makefile
package/windows/InitConfigFile/Makefile package/windows/InitConfigFile/Makefile
package/windows/MungeCryptoPropertiesFilePath/Makefile package/windows/MungeCryptoPropertiesFilePath/Makefile
package/windows/ServerKeystoreSetup/Makefile package/windows/ServerKeystoreSetup/Makefile
package/windows/UpdateWarFile/Makefile package/windows/UpdateWarFile/Makefile
package/windows/server-java_msi/Makefile package/windows/server-java_msi/Makefile
Svc/Makefile Svc/Makefile
Svc/external/Makefile Svc/external/Makefile
Svc/src/Makefile Svc/src/Makefile
Svc/src/com/Makefile Svc/src/com/Makefile
Svc/src/com/novell/Makefile Svc/src/com/novell/Makefile
Svc/src/com/novell/casa/Makefile Svc/src/com/novell/casa/Makefile
Svc/src/com/novell/casa/authtoksvc/Makefile Svc/src/com/novell/casa/authtoksvc/Makefile
Svc/tomcat5/Makefile Svc/tomcat5/Makefile
Svc/tomcat5/conf/Makefile Svc/tomcat5/conf/Makefile
Svc/tomcat5/conf/Catalina/Makefile Svc/tomcat5/conf/Catalina/Makefile
Svc/tomcat5/conf/Catalina/localhost/Makefile Svc/tomcat5/conf/Catalina/localhost/Makefile
Svc/tomcat5/conf/linux/Makefile Svc/tomcat5/conf/linux/Makefile
Svc/tomcat5/conf/windows/Makefile Svc/tomcat5/conf/windows/Makefile
Svc/linux/Makefile Svc/linux/Makefile
Svc/templates/Makefile Svc/templates/Makefile
Svc/manifest/Makefile Svc/manifest/Makefile
Svc/windows/Makefile Svc/windows/Makefile
Jaas/Makefile Jaas/Makefile
Jaas/src/Makefile Jaas/src/Makefile
Jaas/src/com/Makefile Jaas/src/com/Makefile
Jaas/src/com/novell/Makefile Jaas/src/com/novell/Makefile
Jaas/src/com/novell/casa/Makefile Jaas/src/com/novell/casa/Makefile
Jaas/src/com/novell/casa/jaas/Makefile Jaas/src/com/novell/casa/jaas/Makefile
Jaas/src/com/novell/casa/jaas/sample/Makefile Jaas/src/com/novell/casa/jaas/sample/Makefile
Jaas/linux/Makefile Jaas/linux/Makefile
Jaas/windows/Makefile Jaas/windows/Makefile
]) ])

View File

@@ -1,38 +1,38 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Juan Carlos Luciani <jluciani@novell.com> # Author: Juan Carlos Luciani <jluciani@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = $(TARGET_OS) SUBDIRS = $(TARGET_OS)
DIST_SUBDIRS = linux windows DIST_SUBDIRS = linux windows
EXTRA_DIST = EXTRA_DIST =
.PHONY: package package-clean package-install package-uninstall .PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall: package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@ $(MAKE) -C $(TARGET_OS) $@
clean-local: clean-local:
if [ -d lib ]; then rm -rf lib; fi if [ -d lib ]; then rm -rf lib; fi
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = ClientKeyStoreSetup.vjsproj Program.jsl EXTRA_DIST = ClientKeystoreSetup.vjsproj Program.jsl
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = ClientKeystoreSetup PACKAGE = ClientKeystoreSetup
TARGET_FILE = $(PACKAGE).exe TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \ ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = InitConfigFile.vjsproj Program.jsl EXTRA_DIST = InitConfigFile.vjsproj Program.jsl
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = InitConfigFile PACKAGE = InitConfigFile
TARGET_FILE = $(PACKAGE).exe TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \ ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,442 +1,442 @@
/*********************************************************************** /***********************************************************************
* *
* Copyright (C) 2006 Novell, Inc. All Rights Reserved. * Copyright (C) 2006 Novell, Inc. All Rights Reserved.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1 * License as published by the Free Software Foundation; version 2.1
* of the License. * of the License.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details. * Library Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc. * License along with this library; if not, Novell, Inc.
* *
* To contact Novell about this file by physical or electronic mail, * To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com. * you may find current contact information at www.novell.com.
* *
* Author: Juan Carlos Luciani <jluciani@novell.com> * Author: Juan Carlos Luciani <jluciani@novell.com>
* *
***********************************************************************/ ***********************************************************************/
package InitConfigFile; package InitConfigFile;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
/** /**
* Summary description for Program * Summary description for Program
*/ */
public class Program public class Program
{ {
final static int ERROR_NO_ERROR = 0; final static int ERROR_NO_ERROR = 0;
final static int ERROR_INVALID_NUMBER_OF_PARAMS = -1; final static int ERROR_INVALID_NUMBER_OF_PARAMS = -1;
final static int ERROR_MISSING_TEMPLATE = -3; final static int ERROR_MISSING_TEMPLATE = -3;
final static int ERROR_MISSING_TEMPLATE_FILE = -8; final static int ERROR_MISSING_TEMPLATE_FILE = -8;
final static int ERROR_OUTPUT_PROPERTY_MISSING = -9; final static int ERROR_OUTPUT_PROPERTY_MISSING = -9;
final static int ERROR_OUTPUT_COPY_FAILED = -12; final static int ERROR_OUTPUT_COPY_FAILED = -12;
final static int ERROR_IO_EXCEPTION = -13; final static int ERROR_IO_EXCEPTION = -13;
final static int ERROR_MISSING_PROPERTIES = -15; final static int ERROR_MISSING_PROPERTIES = -15;
final static int ERROR_UNABLE_TO_READ_PROPERTIES = -16; final static int ERROR_UNABLE_TO_READ_PROPERTIES = -16;
final static int ERROR_PROPERTIES_FILE_IS_EMPTY = -17; final static int ERROR_PROPERTIES_FILE_IS_EMPTY = -17;
final static int ERROR_MISSING_INSTALL_DIR = -18; final static int ERROR_MISSING_INSTALL_DIR = -18;
final static int ERROR_INSTALL_DIR_NOT_A_DIR = -19; final static int ERROR_INSTALL_DIR_NOT_A_DIR = -19;
final static int ERROR_BAD_INSTALL_DIR_PARAM = -20; final static int ERROR_BAD_INSTALL_DIR_PARAM = -20;
final static int ERROR_BAD_PROPERTY_FILE_PARAM = -21; final static int ERROR_BAD_PROPERTY_FILE_PARAM = -21;
final static int ERROR_MISSING_PROPERTIES_FILE = -22; final static int ERROR_MISSING_PROPERTIES_FILE = -22;
final static int ERROR_MISSING_INSTALL_DIR_PARAM = -23; final static int ERROR_MISSING_INSTALL_DIR_PARAM = -23;
final static int ERROR_MISSING_PROPERTY_FILE_PARAM = -24; final static int ERROR_MISSING_PROPERTY_FILE_PARAM = -24;
final static int ERROR_BAD_TEMPLATE_FILE_PARAM = -25; final static int ERROR_BAD_TEMPLATE_FILE_PARAM = -25;
final static int ERROR_BAD_OUTPUT_FILE_PARAM = -26; final static int ERROR_BAD_OUTPUT_FILE_PARAM = -26;
final static int ERROR_MISSING_TEMPLATE_FILE_PARAM = -27; final static int ERROR_MISSING_TEMPLATE_FILE_PARAM = -27;
final static int ERROR_MISSING_OUTPUT_FILE_PARAM = -28; final static int ERROR_MISSING_OUTPUT_FILE_PARAM = -28;
final static int ERROR_BAD_PROPERTY_PARAM = -29; final static int ERROR_BAD_PROPERTY_PARAM = -29;
final static String TEMPLATE_FILE_PARAM = "template="; final static String TEMPLATE_FILE_PARAM = "template=";
final static String OUTPUT_FILE_PARAM = "output="; final static String OUTPUT_FILE_PARAM = "output=";
final static String INSTALL_DIR_PARAM = "ATS_INSTALL_DIR="; final static String INSTALL_DIR_PARAM = "ATS_INSTALL_DIR=";
final static String INSTALL_DIR_PROPERTY = "ATS_INSTALL_DIR"; final static String INSTALL_DIR_PROPERTY = "ATS_INSTALL_DIR";
final static String PROPERTY_FILE_PARAM = "propertyfile="; final static String PROPERTY_FILE_PARAM = "propertyfile=";
Properties properties; Properties properties;
File fileProperties; File fileProperties;
FileInputStream fisProperties; FileInputStream fisProperties;
File fileTemplate; File fileTemplate;
File fileOutput; File fileOutput;
File file; File file;
FileWriter fw; FileWriter fw;
String[] rgsSearchFor; String[] rgsSearchFor;
String[] rgsReplaceWith; String[] rgsReplaceWith;
String sInstallDir; String sInstallDir;
String sTemplate; String sTemplate;
String sOutput; String sOutput;
public static void main(String[] args) public static void main(String[] args)
{ {
Program p = new Program(args); Program p = new Program(args);
} }
Program(String[] args) Program(String[] args)
{ {
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
properties = new Properties(); properties = new Properties();
fileProperties = null; fileProperties = null;
fisProperties = null; fisProperties = null;
fileTemplate = null; fileTemplate = null;
fileOutput = null; fileOutput = null;
try try
{ {
file = new File("c:\\test.log"); file = new File("c:\\test.log");
fw = new FileWriter(file); fw = new FileWriter(file);
log("Here we go: " + args.length); log("Here we go: " + args.length);
for (int i = 0; i < args.length; i++) for (int i = 0; i < args.length; i++)
{ {
log("Arg " + i + " = " + args[i]); log("Arg " + i + " = " + args[i]);
} }
// Process the arguments // Process the arguments
if (ERROR_NO_ERROR == (rc = processArgs(args))) if (ERROR_NO_ERROR == (rc = processArgs(args)))
{ {
// Process the properties // Process the properties
if (ERROR_NO_ERROR == (rc = processProperties())) if (ERROR_NO_ERROR == (rc = processProperties()))
{ {
rc = createOutputFile(); rc = createOutputFile();
} }
} }
} }
catch (IOException e) catch (IOException e)
{ {
rc = ERROR_IO_EXCEPTION; rc = ERROR_IO_EXCEPTION;
} }
finally finally
{ {
try try
{ {
log("return code = " + rc); log("return code = " + rc);
fw.flush(); fw.flush();
fw.close(); fw.close();
} }
catch (Exception e1) catch (Exception e1)
{ {
} }
} }
System.exit(rc); System.exit(rc);
} }
int processArgs(String[] args) int processArgs(String[] args)
{ {
String sProperties; String sProperties;
File fileInstallDir = null; File fileInstallDir = null;
int i; int i;
int iEquals; int iEquals;
String sKey; String sKey;
String sValue; String sValue;
// Validate the number of parameters // Validate the number of parameters
if (args.length < 3) if (args.length < 3)
{ {
return ERROR_INVALID_NUMBER_OF_PARAMS; return ERROR_INVALID_NUMBER_OF_PARAMS;
} }
for (i = 0; i < args.length; i++) for (i = 0; i < args.length; i++)
{ {
log("arg[" + i + "] = " +args[i]); log("arg[" + i + "] = " +args[i]);
// is this the install dir param? // is this the install dir param?
if (args[i].startsWith(INSTALL_DIR_PARAM)) if (args[i].startsWith(INSTALL_DIR_PARAM))
{ {
// Make sure it is more the the param tag // Make sure it is more the the param tag
if (args[i].length() <= INSTALL_DIR_PARAM.length()) if (args[i].length() <= INSTALL_DIR_PARAM.length())
{ {
return ERROR_BAD_INSTALL_DIR_PARAM; return ERROR_BAD_INSTALL_DIR_PARAM;
} }
sInstallDir = args[i].substring(INSTALL_DIR_PARAM.length()).trim(); sInstallDir = args[i].substring(INSTALL_DIR_PARAM.length()).trim();
fileInstallDir = new File(sInstallDir); fileInstallDir = new File(sInstallDir);
// Make sure the install dir can be found // Make sure the install dir can be found
if (!fileInstallDir.exists()) if (!fileInstallDir.exists())
{ {
return ERROR_MISSING_INSTALL_DIR; return ERROR_MISSING_INSTALL_DIR;
} }
// Make sure the install dir is a directory // Make sure the install dir is a directory
if (!fileInstallDir.isDirectory()) if (!fileInstallDir.isDirectory())
{ {
return ERROR_INSTALL_DIR_NOT_A_DIR; return ERROR_INSTALL_DIR_NOT_A_DIR;
} }
properties.setProperty(INSTALL_DIR_PROPERTY, sInstallDir); properties.setProperty(INSTALL_DIR_PROPERTY, sInstallDir);
} }
// is this the properties file param? // is this the properties file param?
else if (args[i].startsWith(PROPERTY_FILE_PARAM)) else if (args[i].startsWith(PROPERTY_FILE_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= PROPERTY_FILE_PARAM.length()) if (args[i].length() <= PROPERTY_FILE_PARAM.length())
{ {
return ERROR_BAD_PROPERTY_FILE_PARAM; return ERROR_BAD_PROPERTY_FILE_PARAM;
} }
sProperties = args[i].substring(PROPERTY_FILE_PARAM.length()).trim(); sProperties = args[i].substring(PROPERTY_FILE_PARAM.length()).trim();
fileProperties = new File(sProperties); fileProperties = new File(sProperties);
// Make sure the properties file can be found // Make sure the properties file can be found
if (!fileProperties.exists()) if (!fileProperties.exists())
{ {
return ERROR_MISSING_PROPERTIES_FILE; return ERROR_MISSING_PROPERTIES_FILE;
} }
// Read the properties // Read the properties
try try
{ {
fisProperties = new FileInputStream(fileProperties); fisProperties = new FileInputStream(fileProperties);
properties.load(fisProperties); properties.load(fisProperties);
} }
catch (IOException ioe) catch (IOException ioe)
{ {
return ERROR_UNABLE_TO_READ_PROPERTIES; return ERROR_UNABLE_TO_READ_PROPERTIES;
} }
} }
else if (args[i].startsWith(TEMPLATE_FILE_PARAM)) else if (args[i].startsWith(TEMPLATE_FILE_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= TEMPLATE_FILE_PARAM.length()) if (args[i].length() <= TEMPLATE_FILE_PARAM.length())
{ {
return ERROR_BAD_TEMPLATE_FILE_PARAM; return ERROR_BAD_TEMPLATE_FILE_PARAM;
} }
sTemplate = args[i].substring(TEMPLATE_FILE_PARAM.length()).trim(); sTemplate = args[i].substring(TEMPLATE_FILE_PARAM.length()).trim();
fileTemplate = new File(sTemplate); fileTemplate = new File(sTemplate);
// Make sure the template file can be found // Make sure the template file can be found
if (!fileTemplate.exists()) if (!fileTemplate.exists())
{ {
log(ERROR_MISSING_TEMPLATE_FILE, sTemplate); log(ERROR_MISSING_TEMPLATE_FILE, sTemplate);
return ERROR_MISSING_TEMPLATE_FILE; return ERROR_MISSING_TEMPLATE_FILE;
} }
} }
else if (args[i].startsWith(OUTPUT_FILE_PARAM)) else if (args[i].startsWith(OUTPUT_FILE_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= OUTPUT_FILE_PARAM.length()) if (args[i].length() <= OUTPUT_FILE_PARAM.length())
{ {
return ERROR_BAD_OUTPUT_FILE_PARAM; return ERROR_BAD_OUTPUT_FILE_PARAM;
} }
sOutput = args[i].substring(OUTPUT_FILE_PARAM.length()).trim(); sOutput = args[i].substring(OUTPUT_FILE_PARAM.length()).trim();
fileOutput = new File(sOutput); fileOutput = new File(sOutput);
} }
// Handle additional parameters // Handle additional parameters
else else
{ {
if (-1 == (iEquals = args[i].indexOf("=")) || if (-1 == (iEquals = args[i].indexOf("=")) ||
0 == iEquals || 0 == iEquals ||
args[i].length() == iEquals) args[i].length() == iEquals)
{ {
return ERROR_BAD_PROPERTY_PARAM; return ERROR_BAD_PROPERTY_PARAM;
} }
sKey = args[i].substring(0, iEquals); sKey = args[i].substring(0, iEquals);
sValue = args[i].substring(iEquals + 1); sValue = args[i].substring(iEquals + 1);
properties.setProperty(sKey, sValue); properties.setProperty(sKey, sValue);
} }
} }
// Make sure we got an install dir // Make sure we got an install dir
if (null == fileInstallDir) if (null == fileInstallDir)
{ {
return ERROR_MISSING_INSTALL_DIR_PARAM; return ERROR_MISSING_INSTALL_DIR_PARAM;
} }
// Make sure we got a template file // Make sure we got a template file
if (null == fileTemplate) if (null == fileTemplate)
{ {
return ERROR_MISSING_TEMPLATE_FILE_PARAM; return ERROR_MISSING_TEMPLATE_FILE_PARAM;
} }
// Make sure we got an output file // Make sure we got an output file
if (null == fileOutput) if (null == fileOutput)
{ {
return ERROR_MISSING_OUTPUT_FILE_PARAM; return ERROR_MISSING_OUTPUT_FILE_PARAM;
} }
// Note: the properties file parameter is optional // Note: the properties file parameter is optional
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
int processProperties() int processProperties()
{ {
try try
{ {
Enumeration e; Enumeration e;
String sKey; String sKey;
String sValue; String sValue;
int i = 0; int i = 0;
e = properties.propertyNames(); e = properties.propertyNames();
rgsSearchFor = new String[properties.size()]; rgsSearchFor = new String[properties.size()];
rgsReplaceWith = new String[properties.size()]; rgsReplaceWith = new String[properties.size()];
while (e.hasMoreElements()) while (e.hasMoreElements())
{ {
sKey = (String)e.nextElement(); sKey = (String)e.nextElement();
sValue = (String)properties.get(sKey); sValue = (String)properties.get(sKey);
log("Property key = " + sKey + " Value = " + sValue); log("Property key = " + sKey + " Value = " + sValue);
rgsSearchFor[i] = sKey; rgsSearchFor[i] = sKey;
rgsReplaceWith[i] = sValue; rgsReplaceWith[i] = sValue;
i++; i++;
} }
} }
catch (Exception ex1) catch (Exception ex1)
{ {
return -111; return -111;
} }
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
int createOutputFile() int createOutputFile()
{ {
LineNumberReader lnr = null; LineNumberReader lnr = null;
FileWriter fwOutput = null; FileWriter fwOutput = null;
String sLineTemplate; String sLineTemplate;
String sLineOutput; String sLineOutput;
int iSearchFor; int iSearchFor;
int i; int i;
try try
{ {
// Open the files // Open the files
lnr = new LineNumberReader(new FileReader(fileTemplate)); lnr = new LineNumberReader(new FileReader(fileTemplate));
} }
catch (Exception e) catch (Exception e)
{ {
return -40; return -40;
} }
try try
{ {
fwOutput = new FileWriter(fileOutput); fwOutput = new FileWriter(fileOutput);
} }
catch (Exception e) catch (Exception e)
{ {
return -41; return -41;
} }
try try
{ {
// For each line of text in the template file... // For each line of text in the template file...
while (null != (sLineTemplate = lnr.readLine())) while (null != (sLineTemplate = lnr.readLine()))
{ {
sLineOutput = sLineTemplate; sLineOutput = sLineTemplate;
log("<-- " + sLineOutput); log("<-- " + sLineOutput);
// For each term to be replaced... // For each term to be replaced...
for (i = 0; i < rgsSearchFor.length; i++) for (i = 0; i < rgsSearchFor.length; i++)
{ {
log("searching for " + rgsSearchFor[i]); log("searching for " + rgsSearchFor[i]);
// Replace all instances of the term on the line // Replace all instances of the term on the line
while (-1 != (iSearchFor = sLineOutput.indexOf(rgsSearchFor[i]))) while (-1 != (iSearchFor = sLineOutput.indexOf(rgsSearchFor[i])))
{ {
log("replacing " + rgsSearchFor[i] + " at position " + iSearchFor + " with " + rgsReplaceWith[i]); log("replacing " + rgsSearchFor[i] + " at position " + iSearchFor + " with " + rgsReplaceWith[i]);
sLineOutput = sLineOutput.substring(0, iSearchFor) + rgsReplaceWith[i] + sLineOutput = sLineOutput.substring(0, iSearchFor) + rgsReplaceWith[i] +
sLineOutput.substring(iSearchFor + rgsSearchFor[i].length()); sLineOutput.substring(iSearchFor + rgsSearchFor[i].length());
} }
} }
try try
{ {
fwOutput.write(sLineOutput + "\r\n"); fwOutput.write(sLineOutput + "\r\n");
log("--> " + sLineOutput); log("--> " + sLineOutput);
} }
catch (Exception e) catch (Exception e)
{ {
return -42; return -42;
} }
} }
// Clean up // Clean up
fwOutput.flush(); fwOutput.flush();
fwOutput.close(); fwOutput.close();
lnr.close(); lnr.close();
} }
catch (Exception e) catch (Exception e)
{ {
return ERROR_OUTPUT_COPY_FAILED; return ERROR_OUTPUT_COPY_FAILED;
} }
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
void log(int err) void log(int err)
{ {
log(err, null); log(err, null);
} }
void log(int err, String s) void log(int err, String s)
{ {
String sMessage = ""; String sMessage = "";
switch (err) switch (err)
{ {
case ERROR_NO_ERROR: case ERROR_NO_ERROR:
sMessage = "No error"; sMessage = "No error";
break; break;
case ERROR_INVALID_NUMBER_OF_PARAMS: case ERROR_INVALID_NUMBER_OF_PARAMS:
sMessage = "Invalid number of parameters: 4 expected"; sMessage = "Invalid number of parameters: 4 expected";
break; break;
case ERROR_MISSING_TEMPLATE: case ERROR_MISSING_TEMPLATE:
sMessage = "Template file not found"; sMessage = "Template file not found";
break; break;
// case ERROR_TEMPLATE_PROPERTY_MISSING: // case ERROR_TEMPLATE_PROPERTY_MISSING:
// sMessage = "Template file parameter missing"; // sMessage = "Template file parameter missing";
// break; // break;
case ERROR_OUTPUT_PROPERTY_MISSING: case ERROR_OUTPUT_PROPERTY_MISSING:
sMessage = "Output file parameter missing"; sMessage = "Output file parameter missing";
break; break;
case ERROR_OUTPUT_COPY_FAILED: case ERROR_OUTPUT_COPY_FAILED:
sMessage = "Unable to create output file"; sMessage = "Unable to create output file";
break; break;
case ERROR_IO_EXCEPTION: case ERROR_IO_EXCEPTION:
sMessage = "IOException"; sMessage = "IOException";
break; break;
case ERROR_MISSING_PROPERTIES: case ERROR_MISSING_PROPERTIES:
sMessage = "Properties file not found"; sMessage = "Properties file not found";
break; break;
case ERROR_UNABLE_TO_READ_PROPERTIES: case ERROR_UNABLE_TO_READ_PROPERTIES:
sMessage = "Unable to read properties file"; sMessage = "Unable to read properties file";
break; break;
default: default:
sMessage = "Unknown error: " + err; sMessage = "Unknown error: " + err;
break; break;
} }
if (null != s) if (null != s)
{ {
sMessage = sMessage + s; sMessage = sMessage + s;
} }
log(sMessage); log(sMessage);
} }
void log(String s) void log(String s)
{ {
try try
{ {
fw.write(this.getClass().getName() + ": " + s + "\r\n"); fw.write(this.getClass().getName() + ": " + s + "\r\n");
} }
catch (IOException ioe) catch (IOException ioe)
{ {
} }
} }
} }

View File

@@ -1,44 +1,44 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2006 Novell, Inc. # Copyright (C) 2006 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = ClientKeystoreSetup InitConfigFile MungeCryptoPropertiesFilePath ServerKeystoreSetup UpdateWarFile server-java_msi SUBDIRS = ClientKeystoreSetup InitConfigFile MungeCryptoPropertiesFilePath ServerKeystoreSetup UpdateWarFile server-java_msi
DIST_SUBDIRS = ClientKeystoreSetup InitConfigFile MungeCryptoPropertiesFilePath ServerKeystoreSetup UpdateWarFile server-java_msi DIST_SUBDIRS = ClientKeystoreSetup InitConfigFile MungeCryptoPropertiesFilePath ServerKeystoreSetup UpdateWarFile server-java_msi
EXTRA_DIST = EXTRA_DIST =
.PHONY: package package-clean package-install package-uninstall .PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall: package package-clean package-install package-uninstall:
$(MAKE) -C ClientKeystoreSetup $@ $(MAKE) -C ClientKeystoreSetup $@
$(MAKE) -C InitConfigFile $@ $(MAKE) -C InitConfigFile $@
$(MAKE) -C MungeCryptoPropertiesFilePath $@ $(MAKE) -C MungeCryptoPropertiesFilePath $@
$(MAKE) -C ServerKeystoreSetup $@ $(MAKE) -C ServerKeystoreSetup $@
$(MAKE) -C UpdateWarFile $@ $(MAKE) -C UpdateWarFile $@
$(MAKE) -C server-java_msi $@ $(MAKE) -C server-java_msi $@
clean-local: clean-local:
if [ -d lib ]; then rm -rf lib; fi if [ -d lib ]; then rm -rf lib; fi
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in
rm -f Makefile rm -f Makefile

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = MungeCryptoPropertiesFilePath.vjsproj Program.jsl EXTRA_DIST = MungeCryptoPropertiesFilePath.vjsproj Program.jsl
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = MungeCryptoPropertiesFilePath PACKAGE = MungeCryptoPropertiesFilePath
TARGET_FILE = $(PACKAGE).exe TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \ ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,312 +1,312 @@
/*********************************************************************** /***********************************************************************
* *
* Copyright (C) 2006 Novell, Inc. All Rights Reserved. * Copyright (C) 2006 Novell, Inc. All Rights Reserved.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1 * License as published by the Free Software Foundation; version 2.1
* of the License. * of the License.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details. * Library Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc. * License along with this library; if not, Novell, Inc.
* *
* To contact Novell about this file by physical or electronic mail, * To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com. * you may find current contact information at www.novell.com.
* *
* Author: Juan Carlos Luciani <jluciani@novell.com> * Author: Juan Carlos Luciani <jluciani@novell.com>
* *
***********************************************************************/ ***********************************************************************/
package MungeCryptoPropertiesFilePath; package MungeCryptoPropertiesFilePath;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
/** /**
* Summary description for Program * Summary description for Program
*/ */
public class Program public class Program
{ {
final static int ERROR_NO_ERROR = 0; final static int ERROR_NO_ERROR = 0;
final static int ERROR_INVALID_NUMBER_OF_PARAMS = -1; final static int ERROR_INVALID_NUMBER_OF_PARAMS = -1;
final static int ERROR_MISSING_INPUT_FILE = -2; final static int ERROR_MISSING_INPUT_FILE = -2;
final static int ERROR_OUTPUT_COPY_FAILED = -3; final static int ERROR_OUTPUT_COPY_FAILED = -3;
final static int ERROR_IO_EXCEPTION = -4; final static int ERROR_IO_EXCEPTION = -4;
final static int ERROR_BAD_INPUT_FILE_PARAM = -5; final static int ERROR_BAD_INPUT_FILE_PARAM = -5;
final static int ERROR_BAD_OUTPUT_FILE_PARAM = -6; final static int ERROR_BAD_OUTPUT_FILE_PARAM = -6;
final static int ERROR_MISSING_INPUT_FILE_PARAM = -7; final static int ERROR_MISSING_INPUT_FILE_PARAM = -7;
final static int ERROR_MISSING_OUTPUT_FILE_PARAM = -8; final static int ERROR_MISSING_OUTPUT_FILE_PARAM = -8;
final static int ERROR_CANNOT_READ_FILE = -9; final static int ERROR_CANNOT_READ_FILE = -9;
final static int ERROR_CANNOT_CREATE_FILE = -10; final static int ERROR_CANNOT_CREATE_FILE = -10;
final static String INPUT_FILE_PARAM = "input="; final static String INPUT_FILE_PARAM = "input=";
final static String OUTPUT_FILE_PARAM = "output="; final static String OUTPUT_FILE_PARAM = "output=";
final static String FILE_KEY = "org.apache.ws.security.crypto.merlin.file="; final static String FILE_KEY = "org.apache.ws.security.crypto.merlin.file=";
File fileInput; File fileInput;
File fileOutput; File fileOutput;
File file; File file;
FileWriter fw; FileWriter fw;
String sInput; String sInput;
String sOutput; String sOutput;
public static void main(String[] args) public static void main(String[] args)
{ {
Program p = new Program(args); Program p = new Program(args);
} }
Program(String[] args) Program(String[] args)
{ {
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
fileInput = null; fileInput = null;
fileOutput = null; fileOutput = null;
try try
{ {
file = new File("c:\\test5.log"); file = new File("c:\\test5.log");
fw = new FileWriter(file); fw = new FileWriter(file);
log("Here we go: " + args.length); log("Here we go: " + args.length);
for (int i = 0; i < args.length; i++) for (int i = 0; i < args.length; i++)
{ {
log("Arg " + i + " = " + args[i]); log("Arg " + i + " = " + args[i]);
} }
// Process the arguments // Process the arguments
if (ERROR_NO_ERROR == (rc = processArgs(args))) if (ERROR_NO_ERROR == (rc = processArgs(args)))
{ {
// Process the file // Process the file
rc = createOutputFile(); rc = createOutputFile();
} }
} }
catch (IOException e) catch (IOException e)
{ {
rc = ERROR_IO_EXCEPTION; rc = ERROR_IO_EXCEPTION;
} }
finally finally
{ {
try try
{ {
log("return code = " + rc); log("return code = " + rc);
fw.flush(); fw.flush();
fw.close(); fw.close();
} }
catch (Exception e1) catch (Exception e1)
{ {
} }
} }
System.exit(rc); System.exit(rc);
} }
int processArgs(String[] args) int processArgs(String[] args)
{ {
int i; int i;
// Validate the number of parameters // Validate the number of parameters
if (args.length != 2) if (args.length != 2)
{ {
return ERROR_INVALID_NUMBER_OF_PARAMS; return ERROR_INVALID_NUMBER_OF_PARAMS;
} }
for (i = 0; i < args.length; i++) for (i = 0; i < args.length; i++)
{ {
log("arg[" + i + "] = " +args[i]); log("arg[" + i + "] = " +args[i]);
if (args[i].startsWith(INPUT_FILE_PARAM)) if (args[i].startsWith(INPUT_FILE_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= INPUT_FILE_PARAM.length()) if (args[i].length() <= INPUT_FILE_PARAM.length())
{ {
return ERROR_BAD_INPUT_FILE_PARAM; return ERROR_BAD_INPUT_FILE_PARAM;
} }
sInput = args[i].substring(INPUT_FILE_PARAM.length()).trim(); sInput = args[i].substring(INPUT_FILE_PARAM.length()).trim();
fileInput = new File(sInput); fileInput = new File(sInput);
// Make sure the input file can be found // Make sure the input file can be found
if (!fileInput.exists()) if (!fileInput.exists())
{ {
log(ERROR_MISSING_INPUT_FILE, sInput); log(ERROR_MISSING_INPUT_FILE, sInput);
return ERROR_MISSING_INPUT_FILE; return ERROR_MISSING_INPUT_FILE;
} }
} }
else if (args[i].startsWith(OUTPUT_FILE_PARAM)) else if (args[i].startsWith(OUTPUT_FILE_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= OUTPUT_FILE_PARAM.length()) if (args[i].length() <= OUTPUT_FILE_PARAM.length())
{ {
return ERROR_BAD_OUTPUT_FILE_PARAM; return ERROR_BAD_OUTPUT_FILE_PARAM;
} }
sOutput = args[i].substring(OUTPUT_FILE_PARAM.length()).trim(); sOutput = args[i].substring(OUTPUT_FILE_PARAM.length()).trim();
fileOutput = new File(sOutput); fileOutput = new File(sOutput);
} }
} }
// Make sure we got an input file // Make sure we got an input file
if (null == fileInput) if (null == fileInput)
{ {
return ERROR_MISSING_INPUT_FILE_PARAM; return ERROR_MISSING_INPUT_FILE_PARAM;
} }
// Make sure we got an output file // Make sure we got an output file
if (null == fileOutput) if (null == fileOutput)
{ {
return ERROR_MISSING_OUTPUT_FILE_PARAM; return ERROR_MISSING_OUTPUT_FILE_PARAM;
} }
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
int createOutputFile() int createOutputFile()
{ {
LineNumberReader lnr = null; LineNumberReader lnr = null;
FileWriter fwOutput = null; FileWriter fwOutput = null;
String sLineTemplate; String sLineTemplate;
String sLineOutput; String sLineOutput;
int iSearchFor; int iSearchFor;
try try
{ {
// Open the file // Open the file
lnr = new LineNumberReader(new FileReader(fileInput)); lnr = new LineNumberReader(new FileReader(fileInput));
} }
catch (Exception e) catch (Exception e)
{ {
return ERROR_CANNOT_READ_FILE; return ERROR_CANNOT_READ_FILE;
} }
try try
{ {
fwOutput = new FileWriter(fileOutput); fwOutput = new FileWriter(fileOutput);
} }
catch (Exception e) catch (Exception e)
{ {
return ERROR_CANNOT_CREATE_FILE; return ERROR_CANNOT_CREATE_FILE;
} }
try try
{ {
// For each line of text in the template file... // For each line of text in the template file...
while (null != (sLineTemplate = lnr.readLine())) while (null != (sLineTemplate = lnr.readLine()))
{ {
sLineOutput = sLineTemplate; sLineOutput = sLineTemplate;
log("<-- " + sLineOutput); log("<-- " + sLineOutput);
if (sLineOutput.trim().startsWith(FILE_KEY)) if (sLineOutput.trim().startsWith(FILE_KEY))
{ {
// Replace all instances of the line separator on the line // Replace all instances of the line separator on the line
while (-1 != (iSearchFor = sLineOutput.indexOf("\\"))) while (-1 != (iSearchFor = sLineOutput.indexOf("\\")))
{ {
log("replacing \\ at position " + iSearchFor + " with //"); log("replacing \\ at position " + iSearchFor + " with //");
sLineOutput = sLineOutput.substring(0, iSearchFor) + "//" + sLineOutput = sLineOutput.substring(0, iSearchFor) + "//" +
sLineOutput.substring(iSearchFor + 1); sLineOutput.substring(iSearchFor + 1);
} }
} }
try try
{ {
fwOutput.write(sLineOutput + "\r\n"); fwOutput.write(sLineOutput + "\r\n");
log("--> " + sLineOutput); log("--> " + sLineOutput);
} }
catch (Exception e) catch (Exception e)
{ {
return -42; return -42;
} }
} }
// Clean up // Clean up
fwOutput.flush(); fwOutput.flush();
fwOutput.close(); fwOutput.close();
lnr.close(); lnr.close();
} }
catch (Exception e) catch (Exception e)
{ {
return ERROR_OUTPUT_COPY_FAILED; return ERROR_OUTPUT_COPY_FAILED;
} }
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
void log(int err) void log(int err)
{ {
log(err, null); log(err, null);
} }
void log(int err, String s) void log(int err, String s)
{ {
String sMessage = ""; String sMessage = "";
switch (err) switch (err)
{ {
case ERROR_NO_ERROR: case ERROR_NO_ERROR:
sMessage = "No error"; sMessage = "No error";
break; break;
case ERROR_INVALID_NUMBER_OF_PARAMS: case ERROR_INVALID_NUMBER_OF_PARAMS:
sMessage = "Invalid number of parameters: 2 expected"; sMessage = "Invalid number of parameters: 2 expected";
break; break;
case ERROR_MISSING_INPUT_FILE: case ERROR_MISSING_INPUT_FILE:
sMessage = "Invalid number of parameters: 2 expected"; sMessage = "Invalid number of parameters: 2 expected";
break; break;
case ERROR_OUTPUT_COPY_FAILED: case ERROR_OUTPUT_COPY_FAILED:
sMessage = "Unable to create output file"; sMessage = "Unable to create output file";
break; break;
case ERROR_IO_EXCEPTION: case ERROR_IO_EXCEPTION:
sMessage = "IOException"; sMessage = "IOException";
break; break;
case ERROR_BAD_INPUT_FILE_PARAM: case ERROR_BAD_INPUT_FILE_PARAM:
sMessage = "Invalid input file parameter"; sMessage = "Invalid input file parameter";
break; break;
case ERROR_BAD_OUTPUT_FILE_PARAM: case ERROR_BAD_OUTPUT_FILE_PARAM:
sMessage = "Invalid output file parameter"; sMessage = "Invalid output file parameter";
break; break;
case ERROR_MISSING_INPUT_FILE_PARAM: case ERROR_MISSING_INPUT_FILE_PARAM:
sMessage = "Missing input file parameter"; sMessage = "Missing input file parameter";
break; break;
case ERROR_MISSING_OUTPUT_FILE_PARAM: case ERROR_MISSING_OUTPUT_FILE_PARAM:
sMessage = "Missing output file parameter"; sMessage = "Missing output file parameter";
break; break;
case ERROR_CANNOT_READ_FILE: case ERROR_CANNOT_READ_FILE:
sMessage = "Cannot read file"; sMessage = "Cannot read file";
break; break;
case ERROR_CANNOT_CREATE_FILE: case ERROR_CANNOT_CREATE_FILE:
sMessage = "Cannot create file"; sMessage = "Cannot create file";
break; break;
default: default:
sMessage = "Unknown error: " + err; sMessage = "Unknown error: " + err;
break; break;
} }
if (null != s) if (null != s)
{ {
sMessage = sMessage + s; sMessage = sMessage + s;
} }
log(sMessage); log(sMessage);
} }
void log(String s) void log(String s)
{ {
try try
{ {
fw.write(this.getClass().getName() + ": " + s + "\r\n"); fw.write(this.getClass().getName() + ": " + s + "\r\n");
} }
catch (IOException ioe) catch (IOException ioe)
{ {
} }
} }
} }

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = ServerKeystoreSetup.vjsproj Program.jsl EXTRA_DIST = ServerKeystoreSetup.vjsproj Program.jsl
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = ServerKeystoreSetup PACKAGE = ServerKeystoreSetup
TARGET_FILE = $(PACKAGE).exe TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \ ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = UpdateWarFile.vjsproj Program.jsl EXTRA_DIST = UpdateWarFile.vjsproj Program.jsl
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = UpdateWarFile PACKAGE = UpdateWarFile
TARGET_FILE = $(PACKAGE).exe TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \ ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in

View File

@@ -1,417 +1,417 @@
/*********************************************************************** /***********************************************************************
* *
* Copyright (C) 2006 Novell, Inc. All Rights Reserved. * Copyright (C) 2006 Novell, Inc. All Rights Reserved.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1 * License as published by the Free Software Foundation; version 2.1
* of the License. * of the License.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details. * Library Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc. * License along with this library; if not, Novell, Inc.
* *
* To contact Novell about this file by physical or electronic mail, * To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com. * you may find current contact information at www.novell.com.
* *
* Author: Juan Carlos Luciani <jluciani@novell.com> * Author: Juan Carlos Luciani <jluciani@novell.com>
* *
***********************************************************************/ ***********************************************************************/
package UpdateWarFile; package UpdateWarFile;
import java.lang.Throwable; import java.lang.Throwable;
import java.lang.NullPointerException; import java.lang.NullPointerException;
import com.zerog.ia.api.pub.*; import com.zerog.ia.api.pub.*;
import java.util.*; import java.util.*;
import java.net.*; import java.net.*;
import java.io.*; import java.io.*;
import java.util.zip.*; import java.util.zip.*;
import java.util.jar.*; import java.util.jar.*;
/** /**
* Summary description for Program * Summary description for Program
*/ */
public class Program public class Program
{ {
final static String INSTALL_DIR_PARAM = "ATS_INSTALL_DIR="; final static String INSTALL_DIR_PARAM = "ATS_INSTALL_DIR=";
final static int ERROR_NO_ERROR = 0; final static int ERROR_NO_ERROR = 0;
final static int ERROR_IO_EXCEPTION = -1; final static int ERROR_IO_EXCEPTION = -1;
final static int ERROR_INVALID_NUMBER_OF_PARAMS = -2; final static int ERROR_INVALID_NUMBER_OF_PARAMS = -2;
final static int ERROR_BAD_INSTALL_DIR_PARAM = -3; final static int ERROR_BAD_INSTALL_DIR_PARAM = -3;
final static int ERROR_MISSING_INSTALL_DIR = -4; final static int ERROR_MISSING_INSTALL_DIR = -4;
final static int ERROR_INSTALL_DIR_NOT_A_DIR = -5; final static int ERROR_INSTALL_DIR_NOT_A_DIR = -5;
final static int ERROR_MISSING_INSTALL_DIR_PARAM = -6; final static int ERROR_MISSING_INSTALL_DIR_PARAM = -6;
final static int ERROR_WAR_TEMPLATE_FILE_MISSING = -7; final static int ERROR_WAR_TEMPLATE_FILE_MISSING = -7;
final static int ERROR_NEW_JAR_CANNOT_BE_REPLACED = -8; final static int ERROR_NEW_JAR_CANNOT_BE_REPLACED = -8;
final static int ERROR_JAR_COPY_FAILED = -9; final static int ERROR_JAR_COPY_FAILED = -9;
final static int ERROR_CREATE_WAR_FILE_FAILED = -10; final static int ERROR_CREATE_WAR_FILE_FAILED = -10;
final static int ERROR_CREATE_WAR_FOS_FAILED = -11; final static int ERROR_CREATE_WAR_FOS_FAILED = -11;
final static int ERROR_OPEN_JAR_TEMPLATE_FAILED = -12; final static int ERROR_OPEN_JAR_TEMPLATE_FAILED = -12;
final static int ERROR_JOS_FLUSH_FAILED = -13; final static int ERROR_JOS_FLUSH_FAILED = -13;
final static int ERROR_ADD_FILE_TO_JAR_FAILED = -14; final static int ERROR_ADD_FILE_TO_JAR_FAILED = -14;
final static int ERROR_JOS_CLOSE_FAILED = -15; final static int ERROR_JOS_CLOSE_FAILED = -15;
final static int ERROR_FOS_CLOSE_FAILED = -16; final static int ERROR_FOS_CLOSE_FAILED = -16;
final static int ERROR_JFTEMPLATE_CLOSE_FAILED = -17; final static int ERROR_JFTEMPLATE_CLOSE_FAILED = -17;
String sInstallDir; String sInstallDir;
File file; File file;
FileWriter fw; FileWriter fw;
public static void main(String[] args) public static void main(String[] args)
{ {
Program p = new Program(args); Program p = new Program(args);
} }
Program(String[] args) Program(String[] args)
{ {
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
sInstallDir = null; sInstallDir = null;
try try
{ {
file = new File("c:\\test3.log"); file = new File("c:\\test3.log");
fw = new FileWriter(file); fw = new FileWriter(file);
log("Here we go: " + args.length); log("Here we go: " + args.length);
for (int i = 0; i < args.length; i++) for (int i = 0; i < args.length; i++)
{ {
log("Arg " + i + " = " + args[i]); log("Arg " + i + " = " + args[i]);
} }
// Process the arguments // Process the arguments
if (ERROR_NO_ERROR == (rc = processArgs(args))) if (ERROR_NO_ERROR == (rc = processArgs(args)))
{ {
// Create the modified war file // Create the modified war file
rc = createWarFile(); rc = createWarFile();
} }
} }
catch (IOException e) catch (IOException e)
{ {
rc = ERROR_IO_EXCEPTION; rc = ERROR_IO_EXCEPTION;
} }
finally finally
{ {
try try
{ {
log("return code = " + rc); log("return code = " + rc);
fw.flush(); fw.flush();
fw.close(); fw.close();
} }
catch (Exception e1) catch (Exception e1)
{ {
} }
} }
System.exit(rc); System.exit(rc);
} }
int processArgs(String[] args) int processArgs(String[] args)
{ {
File fileInstallDir = null; File fileInstallDir = null;
int i; int i;
// Validate the number of parameters // Validate the number of parameters
if (args.length != 1) if (args.length != 1)
{ {
return ERROR_INVALID_NUMBER_OF_PARAMS; return ERROR_INVALID_NUMBER_OF_PARAMS;
} }
for (i = 0; i < args.length; i++) for (i = 0; i < args.length; i++)
{ {
log("arg[" + i + "] = " + args[i]); log("arg[" + i + "] = " + args[i]);
// is this the install dir param? // is this the install dir param?
if (args[i].startsWith(INSTALL_DIR_PARAM)) if (args[i].startsWith(INSTALL_DIR_PARAM))
{ {
// Make sure it is more than the param tag // Make sure it is more than the param tag
if (args[i].length() <= INSTALL_DIR_PARAM.length()) if (args[i].length() <= INSTALL_DIR_PARAM.length())
{ {
return ERROR_BAD_INSTALL_DIR_PARAM; return ERROR_BAD_INSTALL_DIR_PARAM;
} }
sInstallDir = args[i].substring(INSTALL_DIR_PARAM.length()).trim(); sInstallDir = args[i].substring(INSTALL_DIR_PARAM.length()).trim();
fileInstallDir = new File(sInstallDir); fileInstallDir = new File(sInstallDir);
// Make sure the install dir can be found // Make sure the install dir can be found
if (!fileInstallDir.exists()) if (!fileInstallDir.exists())
{ {
return ERROR_MISSING_INSTALL_DIR; return ERROR_MISSING_INSTALL_DIR;
} }
// Make sure the install dir is a directory // Make sure the install dir is a directory
if (!fileInstallDir.isDirectory()) if (!fileInstallDir.isDirectory())
{ {
return ERROR_INSTALL_DIR_NOT_A_DIR; return ERROR_INSTALL_DIR_NOT_A_DIR;
} }
} }
} }
// Make sure we got an install dir // Make sure we got an install dir
if (null == fileInstallDir) if (null == fileInstallDir)
{ {
return ERROR_MISSING_INSTALL_DIR_PARAM; return ERROR_MISSING_INSTALL_DIR_PARAM;
} }
return ERROR_NO_ERROR; return ERROR_NO_ERROR;
} }
int createWarFile() int createWarFile()
{ {
String sWarTemplate = sInstallDir + "ats\\etc\\svc\\templates\\CasaAuthTokenSvc.war"; String sWarTemplate = sInstallDir + "ats\\etc\\svc\\templates\\CasaAuthTokenSvc.war";
String sWarNew = sInstallDir + "ats\\catalinabase\\webapps\\CasaAuthTokenSvc.war"; String sWarNew = sInstallDir + "ats\\catalinabase\\webapps\\CasaAuthTokenSvc.war";
File fileWarTemplate = new File(sWarTemplate);; File fileWarTemplate = new File(sWarTemplate);;
File fileWarNew = new File(sWarNew); File fileWarNew = new File(sWarNew);
FileOutputStream fosWarNew = null; FileOutputStream fosWarNew = null;
ZipOutputStream josWarNew = null; ZipOutputStream josWarNew = null;
ZipFile jfTemplate = null; ZipFile jfTemplate = null;
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
// Ensure that the war template exists // Ensure that the war template exists
log("looking for war template: " + sWarTemplate); log("looking for war template: " + sWarTemplate);
if (!fileWarTemplate.exists()) if (!fileWarTemplate.exists())
{ {
rc = ERROR_WAR_TEMPLATE_FILE_MISSING; rc = ERROR_WAR_TEMPLATE_FILE_MISSING;
} }
if (rc == ERROR_NO_ERROR) if (rc == ERROR_NO_ERROR)
{ {
// Ensure that the new jar name does not exist // Ensure that the new jar name does not exist
if (fileWarNew.exists()) if (fileWarNew.exists())
{ {
log("war file already exists: " + sWarNew); log("war file already exists: " + sWarNew);
if (!fileWarNew.delete()) if (!fileWarNew.delete())
{ {
log("could not delete war file: " + sWarNew); log("could not delete war file: " + sWarNew);
rc = ERROR_NEW_JAR_CANNOT_BE_REPLACED; rc = ERROR_NEW_JAR_CANNOT_BE_REPLACED;
} }
} }
} }
if (rc == ERROR_NO_ERROR) if (rc == ERROR_NO_ERROR)
{ {
// Create/open the new jar // Create/open the new jar
try try
{ {
log("create new war file output stream: " + sWarNew); log("create new war file output stream: " + sWarNew);
fosWarNew = new FileOutputStream(fileWarNew); fosWarNew = new FileOutputStream(fileWarNew);
josWarNew = new ZipOutputStream(fosWarNew); josWarNew = new ZipOutputStream(fosWarNew);
} }
catch (IOException ioe0) catch (IOException ioe0)
{ {
log(ioe0.toString()); log(ioe0.toString());
rc = ERROR_CREATE_WAR_FOS_FAILED; rc = ERROR_CREATE_WAR_FOS_FAILED;
} }
} }
if (rc == ERROR_NO_ERROR) if (rc == ERROR_NO_ERROR)
{ {
// Open the old jar // Open the old jar
try try
{ {
jfTemplate = new ZipFile(sWarTemplate); jfTemplate = new ZipFile(sWarTemplate);
} }
catch (IOException ioe1) catch (IOException ioe1)
{ {
rc = ERROR_OPEN_JAR_TEMPLATE_FAILED; rc = ERROR_OPEN_JAR_TEMPLATE_FAILED;
} }
} }
if (rc == ERROR_NO_ERROR) if (rc == ERROR_NO_ERROR)
{ {
// Transfer the files // Transfer the files
rc = moveFilesFromJarToJar(josWarNew, jfTemplate); rc = moveFilesFromJarToJar(josWarNew, jfTemplate);
} }
// Add the files // Add the files
if (rc == ERROR_NO_ERROR) if (rc == ERROR_NO_ERROR)
{ {
int i; int i;
String [] rgsFilesToAdd = new String[1]; String [] rgsFilesToAdd = new String[1];
rgsFilesToAdd[0] = sInstallDir + "ats\\etc\\svc\\templates\\crypto.properties"; rgsFilesToAdd[0] = sInstallDir + "ats\\etc\\svc\\templates\\crypto.properties";
String [] rgsNames = new String[1]; String [] rgsNames = new String[1];
rgsNames[0] = "WEB-INF/classes/crypto.properties"; rgsNames[0] = "WEB-INF/classes/crypto.properties";
for (i = 0; i < rgsFilesToAdd.length; i++) for (i = 0; i < rgsFilesToAdd.length; i++)
{ {
log("Adding file: " + rgsFilesToAdd[i] + " with name " + rgsNames[i]); log("Adding file: " + rgsFilesToAdd[i] + " with name " + rgsNames[i]);
rc = addFileToJar(rgsFilesToAdd[i], rgsNames[i], josWarNew); rc = addFileToJar(rgsFilesToAdd[i], rgsNames[i], josWarNew);
} }
} }
// Close up // Close up
if (null != josWarNew) if (null != josWarNew)
{ {
try try
{ {
josWarNew.flush(); josWarNew.flush();
} }
catch (IOException ioe2) catch (IOException ioe2)
{ {
rc = ERROR_JOS_FLUSH_FAILED; rc = ERROR_JOS_FLUSH_FAILED;
} }
try try
{ {
josWarNew.close(); josWarNew.close();
} }
catch (IOException ioe3) catch (IOException ioe3)
{ {
rc = ERROR_JOS_CLOSE_FAILED; rc = ERROR_JOS_CLOSE_FAILED;
} }
try try
{ {
fosWarNew.close(); fosWarNew.close();
} }
catch (IOException ioe4) catch (IOException ioe4)
{ {
rc = ERROR_FOS_CLOSE_FAILED; rc = ERROR_FOS_CLOSE_FAILED;
} }
} }
if (null != jfTemplate) if (null != jfTemplate)
{ {
try try
{ {
jfTemplate.close(); jfTemplate.close();
} }
catch (IOException ioe5) catch (IOException ioe5)
{ {
rc = ERROR_JFTEMPLATE_CLOSE_FAILED; rc = ERROR_JFTEMPLATE_CLOSE_FAILED;
} }
} }
return rc; return rc;
} }
int moveFilesFromJarToJar(ZipOutputStream josDst, ZipFile jfSrc) int moveFilesFromJarToJar(ZipOutputStream josDst, ZipFile jfSrc)
{ {
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
try try
{ {
Enumeration entries = jfSrc.entries(); Enumeration entries = jfSrc.entries();
ZipEntry jeLoop; ZipEntry jeLoop;
InputStream isLoop; InputStream isLoop;
ZipEntry zeIndex; ZipEntry zeIndex;
int bRead; int bRead;
byte [] b = new byte[4096]; byte [] b = new byte[4096];
while (entries.hasMoreElements()) while (entries.hasMoreElements())
{ {
jeLoop = (ZipEntry)entries.nextElement(); jeLoop = (ZipEntry)entries.nextElement();
// Skip WEB-INF/classes/cypto.properties // Skip WEB-INF/classes/cypto.properties
if (jeLoop.getName().equalsIgnoreCase("WEB-INF/classes/crypto.properties")) if (jeLoop.getName().equalsIgnoreCase("WEB-INF/classes/crypto.properties"))
{ {
log("skipping: " + "WEB-INF/classes/crypto.properties"); log("skipping: " + "WEB-INF/classes/crypto.properties");
continue; continue;
} }
// Move the rest of the files over // Move the rest of the files over
else else
{ {
log("Transferring jar file: " + jeLoop.getName()); log("Transferring jar file: " + jeLoop.getName());
// Create the input stream // Create the input stream
isLoop = jfSrc.getInputStream(jeLoop); isLoop = jfSrc.getInputStream(jeLoop);
// Set up the output stream // Set up the output stream
zeIndex = new ZipEntry(jeLoop.getName()); zeIndex = new ZipEntry(jeLoop.getName());
josDst.putNextEntry( zeIndex); josDst.putNextEntry( zeIndex);
// Transfer the file contents // Transfer the file contents
while (-1 != (bRead = isLoop.read(b))) while (-1 != (bRead = isLoop.read(b)))
{ {
josDst.write(b, 0, bRead); josDst.write(b, 0, bRead);
} }
// all done // all done
josDst.closeEntry(); josDst.closeEntry();
isLoop.close(); isLoop.close();
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
rc = ERROR_JAR_COPY_FAILED; rc = ERROR_JAR_COPY_FAILED;
} }
return rc; return rc;
} }
int addFileToJar(String sFilename, String sName, ZipOutputStream josJarNew) int addFileToJar(String sFilename, String sName, ZipOutputStream josJarNew)
{ {
FileInputStream fis; FileInputStream fis;
ZipEntry je; ZipEntry je;
int bRead; int bRead;
byte [] b = new byte[4096]; byte [] b = new byte[4096];
int rc = ERROR_NO_ERROR; int rc = ERROR_NO_ERROR;
try try
{ {
// Create the input stream // Create the input stream
fis = new FileInputStream(sFilename); fis = new FileInputStream(sFilename);
// Set up the output stream // Set up the output stream
je = new ZipEntry(sName); je = new ZipEntry(sName);
josJarNew.putNextEntry(je); josJarNew.putNextEntry(je);
// Tansfer the contents of the file // Tansfer the contents of the file
while (-1 != (bRead = fis.read(b))) while (-1 != (bRead = fis.read(b)))
{ {
josJarNew.write(b, 0, bRead); josJarNew.write(b, 0, bRead);
} }
// All done // All done
fis.close(); fis.close();
josJarNew.closeEntry(); josJarNew.closeEntry();
} }
catch (Exception e) catch (Exception e)
{ {
log(e.toString()); log(e.toString());
rc = ERROR_ADD_FILE_TO_JAR_FAILED; rc = ERROR_ADD_FILE_TO_JAR_FAILED;
} }
return rc; return rc;
} }
void log(int err) void log(int err)
{ {
log(err, null); log(err, null);
} }
void log(int err, String s) void log(int err, String s)
{ {
String sMessage = ""; String sMessage = "";
switch (err) switch (err)
{ {
case ERROR_NO_ERROR: case ERROR_NO_ERROR:
sMessage = "No error"; sMessage = "No error";
break; break;
case ERROR_INVALID_NUMBER_OF_PARAMS: case ERROR_INVALID_NUMBER_OF_PARAMS:
sMessage = "Invalid number of parameters: 4 expected"; sMessage = "Invalid number of parameters: 4 expected";
break; break;
default: default:
sMessage = "Unknown error: " + err; sMessage = "Unknown error: " + err;
break; break;
} }
if (null != s) if (null != s)
{ {
sMessage = sMessage + s; sMessage = sMessage + s;
} }
log(sMessage); log(sMessage);
} }
void log(String s) void log(String s)
{ {
try try
{ {
fw.write(this.getClass().getName() + ": " + s + "\r\n"); fw.write(this.getClass().getName() + ": " + s + "\r\n");
} }
catch (IOException ioe) catch (IOException ioe)
{ {
} }
} }
} }

View File

@@ -1,69 +1,69 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2004 Novell, Inc. # Copyright (C) 2004 Novell, Inc.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public # modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. # version 2 of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public # You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free # License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# Author: Greg Richardson <grichardson@novell.com> # Author: Greg Richardson <grichardson@novell.com>
# #
####################################################################### #######################################################################
SUBDIRS = SUBDIRS =
DIST_SUBDIRS = DIST_SUBDIRS =
EXTRA_DIST = server-java_msi.vdproj EXTRA_DIST = server-java_msi.vdproj
if DEBUG if DEBUG
TARGET_CFG = Debug TARGET_CFG = Debug
else else
TARGET_CFG = Release TARGET_CFG = Release
endif endif
PACKAGE = server-java_msi PACKAGE = server-java_msi
TARGET_FILE = $(PACKAGE).msi TARGET_FILE = $(PACKAGE).msi
LOG_FILE = $(PACKAGE).log LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv .PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE) package: $(TARGET_FILE)
devenv: devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi @if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv $(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@ @rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ @CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \ echo $$CMD; \
if eval $$CMD; then \ if eval $$CMD; then \
ls -l $(TARGET_CFG)/$(TARGET_FILE); \ ls -l $(TARGET_CFG)/$(TARGET_FILE); \
else \ else \
grep -a "ERROR:" $(LOG_FILE); \ grep -a "ERROR:" $(LOG_FILE); \
fi fi
package-clean clean-local: package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean: clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean distclean-local: package-clean
rm -f Makefile rm -f Makefile
maintainer-clean-local: maintainer-clean-local:
rm -f Makefile.in rm -f Makefile.in