directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r371447 - in /directory/trunks/apacheds/standalone: daemon/src/main/java/org/apache/directory/server/standalone/daemon/ installers/plugin/ installers/plugin/reference/ installers/plugin/src/ installers/plugin/src/main/ installers/plugin/src...
Date Mon, 23 Jan 2006 03:07:13 GMT
Author: akarasulu
Date: Sun Jan 22 19:07:01 2006
New Revision: 371447

URL: http://svn.apache.org/viewcvs?rev=371447&view=rev
Log:
initial commit for commons-daemon installer builder plugin

Added:
    directory/trunks/apacheds/standalone/installers/plugin/   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/pom.xml   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/reference/
    directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init   (with props)
    directory/trunks/apacheds/standalone/installers/plugin/src/test/
    directory/trunks/apacheds/standalone/installers/plugin/src/test/java/
    directory/trunks/apacheds/standalone/installers/test/   (with props)
    directory/trunks/apacheds/standalone/installers/test/pom.xml
    directory/trunks/apacheds/standalone/installers/test/src/
    directory/trunks/apacheds/standalone/installers/test/src/main/
    directory/trunks/apacheds/standalone/installers/test/src/main/installers/
    directory/trunks/apacheds/standalone/installers/test/src/main/installers/bootstrapper.properties
    directory/trunks/apacheds/standalone/installers/test/src/main/installers/log4j.properties
    directory/trunks/apacheds/standalone/installers/test/src/main/installers/server.xml
    directory/trunks/apacheds/standalone/installers/test/src/main/java/
Modified:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java?rev=371447&r1=371446&r2=371447&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java (original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java Sun Jan 22 19:07:01 2006
@@ -117,6 +117,12 @@
     }
     
     
+    public File getInitScript()
+    {
+        return new File( getBinDirectory(), "server.init" );
+    }
+    
+    
     public File getExtensionsDirectory()
     {
         return new File( getLibDirectory(), "ext" );
@@ -141,7 +147,7 @@
     }
 
     
-    public File getLog4jConfigurationFile()
+    public File getLoggerConfigurationFile()
     {
         return new File( getConfigurationDirectory(), "log4j.properties" );
     }

Propchange: directory/trunks/apacheds/standalone/installers/plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 22 19:07:01 2006
@@ -0,0 +1,10 @@
+.settings
+.project
+.classpath
+.deployables
+.wtpmodules
+*.iml
+target
+*.iws
+*.ipr
+*.log

Added: directory/trunks/apacheds/standalone/installers/plugin/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/pom.xml?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/pom.xml (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/pom.xml Sun Jan 22 19:07:01 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory</groupId>
+    <artifactId>build</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <version>0.9.4-SNAPSHOT</version>
+  <artifactId>plugin</artifactId>
+  <groupId>org.apache.directory.server.standalone.installers.plugin</groupId>
+  <name>installers-plugin</name>
+  <packaging>maven-plugin</packaging>
+  <description>
+  </description>
+  <distributionManagement>
+    <site>
+      <id>apache.websites</id>
+      <url>scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/apacheds/projects/apacheds-standalone/</url>
+    </site>
+  </distributionManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <version>1.2.19</version>
+    </dependency>  
+    <dependency>
+      <groupId>org.apache.directory.server.standalone.daemon</groupId>
+      <artifactId>org.apache.directory.server.standalone.daemon</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+    </dependency>  
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.0.2</version>
+    </dependency>
+  </dependencies>
+</project>
+

Propchange: directory/trunks/apacheds/standalone/installers/plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,50 @@
+
+file.encoding.pkg=sun.io
+file.encoding=UTF-8
+file.separator=/
+java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
+java.awt.printerjob=sun.print.PSPrinterJob
+java.class.path=.
+java.class.version=48.0
+java.endorsed.dirs=/usr/java/j2sdk1.4.2_08/jre/lib/endorsed
+java.ext.dirs=/usr/java/j2sdk1.4.2_08/jre/lib/ext
+java.home=/usr/java/j2sdk1.4.2_08/jre
+java.io.tmpdir=/tmp
+java.library.path=/usr/java/j2sdk1.4.2_08/jre/lib/i386/...
+java.runtime.name=Java(TM) 2 Runtime Environment, Stand...
+java.runtime.version=1.4.2_08-b03
+java.specification.name=Java Platform API Specification
+java.specification.vendor=Sun Microsystems Inc.
+java.specification.version=1.4
+java.util.prefs.PreferencesFactory=java.util.prefs.FileSystemPreferences...
+java.vendor=Sun Microsystems Inc.
+java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
+java.vendor.url=http://java.sun.com/
+java.version=1.4.2_08
+java.vm.info=mixed mode
+java.vm.name=Java HotSpot(TM) Client VM
+java.vm.specification.name=Java Virtual Machine Specification
+java.vm.specification.vendor=Sun Microsystems Inc.
+java.vm.specification.version=1.0
+java.vm.vendor=Sun Microsystems Inc.
+java.vm.version=1.4.2_08-b03
+line.separator=
+-- listing properties --
+os.arch=i386
+os.name=Linux
+os.version=2.6.12-1.1381_FC3
+path.separator=:
+sun.arch.data.model=32
+sun.boot.class.path=/usr/java/j2sdk1.4.2_08/jre/lib/rt.ja...
+sun.boot.library.path=/usr/java/j2sdk1.4.2_08/jre/lib/i386
+sun.cpu.endian=little
+sun.cpu.isalist=
+sun.io.unicode.encoding=UnicodeLittle
+sun.java2d.fontpath=
+sun.os.patch.level=unknown
+user.country=US
+user.dir=/home/akarasulu
+user.home=/home/akarasulu
+user.language=en
+user.name=akarasulu
+user.timezone=

Propchange: directory/trunks/apacheds/standalone/installers/plugin/reference/linux.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,53 @@
+
+awt.nativeDoubleBuffering: true
+awt.toolkit: apple.awt.CToolkit
+file.encoding.pkg: sun.io
+file.encoding: MacRoman
+file.separator: /
+gopherProxySet: false
+java.awt.graphicsenv: apple.awt.CGraphicsEnvironment
+java.awt.printerjob: apple.awt.CPrinterJob
+java.class.path: .
+java.class.version: 49.0
+java.endorsed.dirs: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/endorsed
+java.ext.dirs: /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext
+java.home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
+java.io.tmpdir: /tmp
+java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
+java.runtime.name: Java(TM) 2 Runtime Environment, Standard Edition
+java.runtime.version: 1.5.0_05-83
+java.specification.name: Java Platform API Specification
+java.specification.vendor: Sun Microsystems Inc.
+java.specification.version: 1.5
+java.vendor.url.bug: http://developer.apple.com/java/
+java.vendor.url: http://apple.com/
+java.vendor: Apple Computer, Inc.
+java.version: 1.5.0_05
+java.vm.info: mixed mode, sharing
+java.vm.name: Java HotSpot(TM) Client VM
+java.vm.specification.name: Java Virtual Machine Specification
+java.vm.specification.vendor: Sun Microsystems Inc.
+java.vm.specification.version: 1.0
+java.vm.vendor: "Apple Computer, Inc."
+java.vm.version: 1.5.0_05-48
+line.separator: 
+mrj.version: 1040.1.5.0_05-83
+os.arch: ppc
+os.name: Mac OS X
+os.version: 10.4.4
+path.separator: :
+sun.arch.data.model: 32
+sun.boot.class.path: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar
+sun.boot.library.path: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries
+sun.cpu.endian: big
+sun.cpu.isalist: 
+sun.io.unicode.encoding: UnicodeBig
+sun.jnu.encoding: MacRoman
+sun.management.compiler: HotSpot Client Compiler
+sun.os.patch.level: unknown
+user.country: US
+user.dir: /Users/akarasulu
+user.home: /Users/akarasulu
+user.language: en
+user.name: akarasulu
+user.timezone: 

Propchange: directory/trunks/apacheds/standalone/installers/plugin/reference/mac.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,48 @@
+
+file.encoding.pkg: sun.io
+file.encoding: ISO646-US
+file.separator: /
+java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
+java.awt.printerjob: sun.print.PSPrinterJob
+java.class.path: .
+java.class.version: 49.0
+java.endorsed.dirs: /usr/jdk/instances/jdk1.5.0/jre/lib/endorsed
+java.ext.dirs: /usr/jdk/instances/jdk1.5.0/jre/lib/ext
+java.home: /usr/jdk/instances/jdk1.5.0/jre
+java.io.tmpdir: /var/tmp/
+java.library.path: /usr/jdk/instances/jdk1.5.0/jre/lib/sparc/server:/usr/jdk/instances/jdk1.5.0/jre/lib/sparc:/usr/jdk/instances/jdk1.5.0/jre/../lib/sparc:/usr/lib
+java.runtime.name: Java(TM) 2 Runtime Environment, Standard Edition
+java.runtime.version: 1.5.0_05-b05
+java.specification.name: Java Platform API Specification
+java.specification.vendor: Sun Microsystems Inc.
+java.specification.version: 1.5
+java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
+java.vendor.url: http://java.sun.com/
+java.vendor: Sun Microsystems Inc.
+java.version: 1.5.0_05
+java.vm.info: mixed mode
+java.vm.name: Java HotSpot(TM) Server VM
+java.vm.specification.name: Java Virtual Machine Specification
+java.vm.specification.vendor: Sun Microsystems Inc.
+java.vm.specification.version: 1.0
+java.vm.vendor: Sun Microsystems Inc.
+java.vm.version: 1.5.0_05-b05
+line.separator: 
+os.arch: sparc
+os.name: SunOS
+os.version: 5.10
+path.separator: :
+sun.arch.data.model: 32
+sun.boot.class.path: /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/i18n.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/sunrsasign.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jsse.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/jce.jar:/usr/jdk/instances/jdk1.5.0/jre/lib/charsets.jar:/usr/jdk/instances/jdk1.5.0/jre/classes
+sun.boot.library.path: /usr/jdk/instances/jdk1.5.0/jre/lib/sparc
+sun.cpu.endian: big
+sun.cpu.isalist: sparcv9+vis2 sparcv9+vis sparcv9 sparcv8plus+vis2 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
+sun.io.unicode.encoding: UnicodeBig
+sun.jnu.encoding: ISO646-US
+sun.management.compiler: HotSpot Server Compiler
+sun.os.patch.level: unknown
+user.dir: /home/akarasulu
+user.home: /home/akarasulu
+user.language: en
+user.name: akarasulu
+user.timezone: 

Propchange: directory/trunks/apacheds/standalone/installers/plugin/reference/sunos.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,52 @@
+
+awt.toolkit: sun.awt.windows.WToolkit
+file.encoding.pkg: sun.io
+file.encoding: Cp1252
+file.separator: \
+java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment
+java.awt.printerjob: sun.awt.windows.WPrinterJob
+java.class.path: .
+java.class.version: 49.0
+java.endorsed.dirs: C:\Program Files\Java\jre1.5.0_06\lib\endorsed
+java.ext.dirs: C:\Program Files\Java\jre1.5.0_06\lib\ext
+java.home: C:\Program Files\Java\jre1.5.0_06
+java.io.tmpdir: C:\DOCUME~1\AKARAS~1\LOCALS~1\Temp\
+java.library.path: c:\WINDOWS\system32;.;C:\WINDOWS\system32;C:\WINDOWS;C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;c:\WINDOWS\system32;c:\Perl\bin\;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\Program Files\Subversion\bin;C:\cygwin\bin;c:\program files\vim\vim62;c:\Program Files\Common Files\Adobe\AGL;c:\WINDOWS\system32;c:\Perl\bin\;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\Program Files\Subversion\bin;C:\cygwin\bin;c:\program files\vim\vim62;c:\Program Files\Common Files\Adobe\AGL;C:\cygwin\opt\tools\maven\maven-1.0.2\bin;C:\cygwin\opt\tools\maven\maven-2.0.1\bin;c:\java\jdk1.5.0_05\bin;C:\cygwin\opt\tools\ant\apache-ant-1.6.5\bin
+java.runtime.name: Java(TM) 2 Runtime Environment, Standard Edition
+java.runtime.version: 1.5.0_06-b05
+java.specification.name: Java Platform API Specification
+java.specification.vendor: Sun Microsystems Inc.
+java.specification.version: 1.5
+java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
+java.vendor.url: http://java.sun.com/
+java.vendor: Sun Microsystems Inc.
+java.version: 1.5.0_06
+java.vm.info: mixed mode, sharing
+java.vm.name: Java HotSpot(TM) Client VM
+java.vm.specification.name: Java Virtual Machine Specification
+java.vm.specification.vendor: Sun Microsystems Inc.
+java.vm.specification.version: 1.0
+java.vm.vendor: Sun Microsystems Inc.
+java.vm.version: 1.5.0_06-b05
+line.separator: 
+os.arch: x86
+os.name: Windows XP
+os.version: 5.1
+path.separator: ;
+sun.arch.data.model: 32
+sun.boot.class.path: C:\Program Files\Java\jre1.5.0_06\lib\rt.jar;C:\Program Files\Java\jre1.5.0_06\lib\i18n.jar;C:\Program Files\Java\jre1.5.0_06\lib\sunrsasign.jar;C:\Program Files\Java\jre1.5.0_06\lib\jsse.jar;C:\Program Files\Java\jre1.5.0_06\lib\jce.jar;C:\Program Files\Java\jre1.5.0_06\lib\charsets.jar;C:\Program Files\Java\jre1.5.0_06\classes
+sun.boot.library.path: C:\Program Files\Java\jre1.5.0_06\bin
+sun.cpu.endian: little
+sun.cpu.isalist: 
+sun.desktop: windows
+sun.io.unicode.encoding: UnicodeLittle
+sun.jnu.encoding: Cp1252
+sun.management.compiler: HotSpot Client Compiler
+sun.os.patch.level: Service Pack 2
+user.country: US
+user.dir: c:\cygwin\home\akarasulu
+user.home: C:\Documents and Settings\akarasulu
+user.language: en
+user.name: akarasulu
+user.timezone: 
+user.variant: 

Propchange: directory/trunks/apacheds/standalone/installers/plugin/reference/windows.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 22 19:07:01 2006
@@ -0,0 +1 @@
+META-INF

Added: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java Sun Jan 22 19:07:01 2006
@@ -0,0 +1,375 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.directory.server.standalone.installers;
+
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.apache.directory.server.standalone.daemon.InstallationLayout;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.InterpolationFilterReader;
+
+
+/**
+ * Maven 2 mojo creating the platform specific installation layout images.
+ * 
+ * @goal create
+ * @description Creates platform specific installation layout images.
+ * @phase package
+ * @requiresDependencyResolution runtime
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class CreateImage extends AbstractMojo
+{
+    private static final String BOOTSTRAPPER_ARTIFACT_ID = "org.apache.directory.server.standalone.daemon";
+    private static final String BOOTSTRAPPER_GROUP_ID = "org.apache.directory.server.standalone.daemon";
+
+    
+    /**
+     * The target directory into which the mojo creates os and platform 
+     * specific images.
+     * @parameter expression="target/images"
+     */
+    private File outputDirectory;
+
+    /**
+     * The source directory where various configuration files for the installer 
+     * are stored.
+     * 
+     * @parameter expression="src/main/installers"
+     */
+    private File sourceDirectory;
+
+    /**
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter
+     */
+    private Target[] targets;
+
+    /**
+     * @parameter 
+     * @required
+     */
+    private String applicationName;
+    
+    /**
+     * @parameter 
+     * @required
+     */
+    private String applicationClass;
+
+    /**
+     * @parameter 
+     * @required
+     */
+    private String applicationVersion;
+
+    /**
+     * @parameter 
+     */
+    private String applicationDescription;
+
+    /**
+     * @parameter
+     */
+    private String encoding;
+
+
+    private Properties filterProperties;
+
+    
+    public void execute() throws MojoExecutionException, MojoFailureException
+    {
+        // initialize filters
+        initializeFiltering();
+        
+        // makes sure global values and report targets if have any
+        setDefaults();
+        if ( targets == null )
+        {
+            getLog().info( "===================================================================" );
+            getLog().info( "[installers:create]" );
+            getLog().info( "No installer targets to create." );
+            getLog().info( "===================================================================" );
+            return;
+        }
+        reportSetup();
+
+        Artifact bootstrapper = getBootstrapperArtifact();
+        for ( int ii = 0; ii < targets.length; ii++ )
+        {
+            // make the layout directories
+            File dir = new File( outputDirectory, targets[ii].getId() );
+            InstallationLayout layout = new InstallationLayout( dir );
+            layout.mkdirs();
+            
+            // copy over the REQUIRED bootstrapper.jar file 
+            try
+            {
+                FileUtils.copyFile( bootstrapper.getFile(), layout.getBootstrapper() );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy bootstrapper.jar " + bootstrapper.getFile() 
+                    + " into position " + layout.getBootstrapper() );
+            }
+            
+            // copy over the REQUIRED bootstrapper configuration file
+            try
+            {
+                FileUtils.copyFile( targets[ii].getBootstrapperConfiguraitonFile(), layout.getBootstrapperConfigurationFile() );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy bootstrapper configuration file "  
+                    + targets[ii].getBootstrapperConfiguraitonFile() 
+                    + " into position " + layout.getBootstrapperConfigurationFile() );
+            }
+            
+            // copy over the optional logging configuration file
+            if ( targets[ii].getLoggerConfigurationFile().exists() )
+            {
+                try
+                {
+                    FileUtils.copyFile( targets[ii].getLoggerConfigurationFile(), layout.getLoggerConfigurationFile() );
+                }
+                catch ( IOException e )
+                {
+                    getLog().error( "Failed to copy logger configuration file "  
+                        + targets[ii].getLoggerConfigurationFile() 
+                        + " into position " + layout.getLoggerConfigurationFile(), e );
+                }
+            }
+            
+            // copy over the optional server configuration file
+            if ( targets[ii].getServerConfigurationFile().exists() )
+            {
+                try
+                {
+                    FileUtils.copyFile( targets[ii].getServerConfigurationFile(), layout.getConfigurationFile() );
+                }
+                catch ( IOException e )
+                {
+                    getLog().error( "Failed to copy server configuration file "  
+                        + targets[ii].getServerConfigurationFile()
+                        + " into position " + layout.getConfigurationFile(), e );
+                }
+            }
+            
+            // copy over the init script template
+            if ( targets[ii].isFamily( "unix" ) )
+            {
+                try
+                {
+                    copyFile( getClass().getResourceAsStream( "template.init" ), layout.getInitScript(), true );
+                }
+                catch ( IOException e )
+                {
+                    getLog().error( "Failed to copy server configuration file "  
+                        + targets[ii].getServerConfigurationFile()
+                        + " into position " + layout.getConfigurationFile(), e );
+                }
+            }
+        }        
+    }
+    
+    
+    private void setDefaults()
+    {
+        if ( targets == null )
+        {
+            return;
+        }
+        
+        for ( int ii = 0; ii < targets.length; ii++ )
+        {
+            Target target = targets[ii];
+
+            if ( target.getLoggerConfigurationFile() == null )
+            {
+                target.setLoggerConfigurationFile( new File( sourceDirectory, "log4j.properties" ) );
+            }
+            if ( target.getBootstrapperConfiguraitonFile() == null )
+            {
+                target.setBootstrapperConfiguraitonFile( new File( sourceDirectory, "bootstrapper.properties" ) );
+            }
+            if ( target.getServerConfigurationFile() == null )
+            {
+                target.setServerConfigurationFile( new File( sourceDirectory, "server.xml" ) );
+            }
+        }
+    }
+    
+    
+    private Artifact getBootstrapperArtifact() throws MojoFailureException
+    {
+        Artifact artifact = null;
+        Iterator artifacts = project.getDependencyArtifacts().iterator();
+        while ( artifacts.hasNext() )
+        {
+            artifact = ( Artifact ) artifacts.next();
+            if ( artifact.getArtifactId().equals( BOOTSTRAPPER_ARTIFACT_ID ) || artifact.getGroupId().equals( BOOTSTRAPPER_GROUP_ID ) )
+            {
+                getLog().info( "Found bootstrapper dependency with version: " + artifact.getVersion() );
+                return artifact;
+            }
+        }
+
+        throw new MojoFailureException( "Bootstrapper dependency artifact required: " 
+            + BOOTSTRAPPER_GROUP_ID + ":" + BOOTSTRAPPER_ARTIFACT_ID );
+    }
+    
+    
+    public void reportSetup()
+    {
+        getLog().info( "===================================================================" );
+        getLog().info( "[installers:create]" );
+        getLog().info( "applicationName = " + applicationName );
+        getLog().info( "sourceDirectory = " + sourceDirectory );
+        getLog().info( "outputDirectory = " + outputDirectory );
+        getLog().info( "----------------------------- targets -----------------------------" );
+        
+        if ( targets != null )
+        {
+            for ( int ii = 0; ii < targets.length; ii++ )
+            {
+                getLog().info( "id: " + targets[ii].getId() );
+                
+//                if ( targets[ii].getDependencies() != null )
+//                {
+//                    StringBuffer buf = new StringBuffer();
+//                    for ( int jj = 0; jj < targets[ii].getDependencies().length; jj++ )
+//                    {
+//                        buf.append( targets[ii].getDependencies()[jj] );
+//                        buf.append( " " );
+//                    }
+//                    getLog().info( "DEPENDENCIES: " + buf.toString() );
+//                }
+                
+                getLog().info( "osName: " + targets[ii].getOsName() );
+                getLog().info( "osArch: " + targets[ii].getOsArch() );
+                getLog().info( "osVersion: " + targets[ii].getOsVersion() );
+                getLog().info( "installer: " + targets[ii].getInstaller() );
+                getLog().info( "daemonFramework: " + targets[ii].getDaemonFramework() );
+                getLog().info( "log4jProperties: " + targets[ii].getLoggerConfigurationFile() );
+                getLog().info( "bootstrapperProperties: " + targets[ii].getBootstrapperConfiguraitonFile() );
+                getLog().info( "serverXml: " + targets[ii].getServerConfigurationFile() );
+                
+                if ( ii + 1 < targets.length )
+                {
+                    getLog().info( "" );
+                }
+            }
+        }
+        
+        getLog().info( "===================================================================" );
+    }
+
+    
+    private void initializeFiltering() throws MojoExecutionException
+    {
+        // System properties
+        filterProperties = new Properties( System.getProperties() );
+        // Project properties
+        filterProperties.putAll( project.getProperties() );
+
+        filterProperties.put( "app" , applicationName );
+        filterProperties.put( "app.caps" , applicationName.toUpperCase() );
+        filterProperties.put( "app.server.class", applicationClass );
+        if ( applicationVersion != null )
+        {
+            filterProperties.put( "app.version", applicationVersion );
+        }
+        if ( applicationDescription != null )
+        {
+            filterProperties.put( "app.init.message", applicationDescription );
+        }
+    }
+
+    
+    private void copyFile( InputStream from, File to, boolean filtering ) throws IOException
+    {
+        // buffer so it isn't reading a byte at a time!
+        Reader fileReader = null;
+        Writer fileWriter = null;
+        try
+        {
+            if ( encoding == null || encoding.length() < 1 )
+            {
+                fileReader = new BufferedReader( new InputStreamReader( from ) );
+                fileWriter = new FileWriter( to );
+            }
+            else
+            {
+                FileOutputStream outstream = new FileOutputStream( to );
+                fileReader = new BufferedReader( new InputStreamReader( from, encoding ) );
+                fileWriter = new OutputStreamWriter( outstream, encoding );
+            }
+
+            Reader reader = null;
+            if ( filtering )
+            {
+                // support ${token}
+                reader = new InterpolationFilterReader( fileReader, filterProperties, "${", "}" );
+                // support @token@
+                reader = new InterpolationFilterReader( reader, filterProperties, "@", "@" );
+    
+                boolean isPropertiesFile = false;
+                if ( to.isFile() && to.getName().endsWith( ".properties" ) )
+                {
+                    isPropertiesFile = true;
+                }
+                reader = new InterpolationFilterReader( reader, 
+                    new ReflectionProperties( project, isPropertiesFile ), "${", "}" );
+            }
+            else
+            {
+                reader = fileReader;
+            }
+            IOUtil.copy( reader, fileWriter );
+        }
+        finally
+        {
+            IOUtil.close( fileReader );
+            IOUtil.close( fileWriter );
+        }
+    }
+}

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java Sun Jan 22 19:07:01 2006
@@ -0,0 +1,72 @@
+package org.apache.directory.server.standalone.installers;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.introspection.ReflectionValueExtractor;
+
+import java.util.Properties;
+
+
+/**
+ * Took this from the maven resource plugin in trunk or else I would have added it 
+ * as a dep.  This can be removed once the 2.2 release of the resource plugin comes
+ * out.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class ReflectionProperties extends Properties
+{
+    private static final long serialVersionUID = -4748409484925117841L;
+    private MavenProject project;
+    boolean escapedBackslashesInFilePath;
+
+    public ReflectionProperties( MavenProject aProject, boolean escapedBackslashesInFilePath ) 
+    {
+       super();
+       project = aProject;
+       this.escapedBackslashesInFilePath = escapedBackslashesInFilePath;
+    }
+    
+    public Object get( Object key )
+    {
+        Object value = null;
+        try 
+        {
+            value = ReflectionValueExtractor.evaluate( "" + key , project );
+            if ( escapedBackslashesInFilePath && value != null &&
+                "java.lang.String".equals( value.getClass().getName() ) )
+            {
+                String val = (String) value;
+
+                // Check if it's a windows path
+                if ( val.indexOf( ":\\" ) == 1 )
+                {
+                    value = StringUtils.replace( (String)value, "\\", "\\\\" );
+                    value = StringUtils.replace( (String)value, ":", "\\:" );
+                }
+            }
+        }
+        catch ( Exception e ) 
+        {
+            //TODO: remove the try-catch block when ReflectionValueExtractor.evaluate() throws no more exceptions
+        } 
+        return value;
+    }
+}

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ReflectionProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java Sun Jan 22 19:07:01 2006
@@ -0,0 +1,329 @@
+package org.apache.directory.server.standalone.installers;
+
+
+import java.io.File;
+import java.util.Locale;
+
+
+public class Target
+{
+    /**
+     * Possible values:<br />
+     *    <ul>
+     *      <li>dos</li>
+     *      <li>mac</li>
+     *      <li>netware</li>
+     *      <li>os/2</li>
+     *      <li>tandem</li>
+     *      <li>unix</li>
+     *      <li>windows</li>
+     *      <li>win9x</li>
+     *      <li>z/os</li>
+     *      <li>os/400</li>
+     *    </ul>
+     */
+    public final static String[] OS_FAMILIES = new String[] { 
+        "dos", "mac", "netware", "os/2", "tandem", "unix", "windows", "win9x", "z/os", "os/400" };
+    public final static String[] OPERATING_SYSTEMS = new String[] { "Linux", "SunOS", "Windows", "Mac OS X" };
+    public final static String[] ARCHITECTURES = new String[] { "intel", "sparc", "ppc" };
+    public final static String[] DAEMON_FRAMEWORKS = new String[] { "jsvc", "procrun" };
+    public final static String[] INSTALLERS = new String[] { "izpack", "inno", "rpm", "deb", "pkg" };
+
+    // required stuff
+    private String id;
+    private String osName;
+    private String osArch;
+    private String osFamily;
+    private String daemonFramework;
+    private String installer;
+    
+    // optional stuff
+    private String minVersion;
+    private String maxVersion;
+    private String osVersion;
+    private File loggerConfigurationFile;
+    private File serverConfigurationFile;
+    private File bootstrapperConfiguraitonFile;
+    
+    
+    public void setOsName( String osName )
+    {
+        this.osName = osName.toLowerCase( Locale.US );
+    }
+    
+    
+    public String getOsName()
+    {
+        return osName;
+    }
+
+
+    public void setOsArch( String osArch )
+    {
+        this.osArch = osArch.toLowerCase( Locale.US );
+    }
+
+
+    public String getOsArch()
+    {
+        return osArch;
+    }
+
+
+    public void setDaemonFramework(String daemonFramework)
+    {
+        this.daemonFramework = daemonFramework.toLowerCase( Locale.US );
+    }
+
+
+    public String getDaemonFramework()
+    {
+        return daemonFramework;
+    }
+
+
+    public void setInstaller(String installer)
+    {
+        this.installer = installer.toLowerCase( Locale.US );
+    }
+
+
+    public String getInstaller()
+    {
+        return installer;
+    }
+
+
+    public void setMaxVersion(String maxVersion)
+    {
+        this.maxVersion = maxVersion.toLowerCase( Locale.US );
+    }
+
+
+    public String getMaxVersion()
+    {
+        return maxVersion;
+    }
+
+
+    public void setMinVersion(String minVersion)
+    {
+        this.minVersion = minVersion.toLowerCase( Locale.US );
+    }
+
+
+    public String getMinVersion()
+    {
+        return minVersion.toLowerCase( Locale.US );
+    }
+
+
+    public void setOsVersion(String osVersion)
+    {
+        this.osVersion = osVersion.toLowerCase( Locale.US );
+    }
+
+
+    public String getOsVersion()
+    {
+        return osVersion.toLowerCase( Locale.US );
+    }
+
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+
+    public String getId()
+    {
+        return id;
+    }
+
+
+    public void setLoggerConfigurationFile(File loggerConfigurationFile)
+    {
+        this.loggerConfigurationFile = loggerConfigurationFile;
+    }
+
+
+    public File getLoggerConfigurationFile()
+    {
+        return loggerConfigurationFile;
+    }
+
+
+    public void setServerConfigurationFile(File serverConfigurationFile)
+    {
+        this.serverConfigurationFile = serverConfigurationFile;
+    }
+
+
+    public File getServerConfigurationFile()
+    {
+        return serverConfigurationFile;
+    }
+
+
+    public void setBootstrapperConfiguraitonFile(File bootstrapperConfiguraitonFile)
+    {
+        this.bootstrapperConfiguraitonFile = bootstrapperConfiguraitonFile;
+    }
+
+
+    public File getBootstrapperConfiguraitonFile()
+    {
+        return bootstrapperConfiguraitonFile;
+    }
+
+
+    public void setOsFamily(String osFamily)
+    {
+        this.osFamily = osFamily;
+    }
+
+
+    public String getOsFamily()
+    {
+        return osFamily;
+    }
+
+
+    /**
+     * Determines if the target OS family matches the given OS family.
+     * @param family the family to check for
+     * @return true if the target OS matches
+     */
+    public boolean isFamily( String family )
+    {
+        return isOs( family, null, null, null );
+    }
+
+    
+    /**
+     * Determines if the target OS matches the given OS name.
+     *
+     * @param name the OS name to check for
+     * @return true if the target OS matches
+     */
+    public boolean isName( String name )
+    {
+        return isOs( null, name, null, null );
+    }
+    
+
+    /**
+     * Determines if the target OS matches the given OS architecture.
+     *
+     * @param arch the OS architecture to check for
+     * @return true if the target OS matches
+     */
+    public boolean isArch( String arch )
+    {
+        return isOs( null, null, arch, null );
+    }
+    
+
+    /**
+     * Determines if the target OS matches the given OS version.
+     *
+     * @param version the OS version to check for
+     * @return true if the OS matches
+     */
+    public boolean isVersion( String version )
+    {
+        return isOs( null, null, null, version );
+    }
+
+    
+    /**
+     * Determines if the OS matches the target's OS family, name, architecture and version
+     *
+     * @param family   The OS family
+     * @param name   The OS name
+     * @param arch   The OS architecture
+     * @param version   The OS version
+     * @return true if the OS matches
+     */
+    public boolean isOs( String family, String name, String arch, String version )
+    {
+        boolean retValue = false;
+
+        if ( family != null || name != null || arch != null || version != null )
+        {
+            boolean isFamily = true;
+            boolean isName = true;
+            boolean isArch = true;
+            boolean isVersion = true;
+
+            if ( family != null )
+            {
+                if ( family.equals( "windows" ) )
+                {
+                    isFamily = osName.indexOf( "windows" ) > -1;
+                }
+                else if ( family.equals( "os/2" ) )
+                {
+                    isFamily = osName.indexOf( "os/2" ) > -1;
+                }
+                else if ( family.equals( "netware" ) )
+                {
+                    isFamily = osName.indexOf( "netware" ) > -1;
+                }
+                else if ( family.equals( "dos" ) )
+                {
+                    isFamily = !isFamily( "netware" );
+                }
+                else if ( family.equals( "mac" ) )
+                {
+                    isFamily = osName.indexOf( "mac" ) > -1;
+                }
+                else if ( family.equals( "tandem" ) )
+                {
+                    isFamily = osName.indexOf( "nonstop_kernel" ) > -1;
+                }
+                else if ( family.equals( "unix" ) )
+                {
+                    isFamily = !isFamily( "openvms" )
+                        && ( !isFamily( "mac" ) || osName.endsWith( "x" ) );
+                }
+                else if ( family.equals( "win9x" ) )
+                {
+                    isFamily = isFamily( "windows" )
+                        && ( osName.indexOf( "95" ) >= 0
+                        || osName.indexOf( "98" ) >= 0
+                        || osName.indexOf( "me" ) >= 0
+                        || osName.indexOf( "ce" ) >= 0 );
+                }
+                else if ( family.equals( "z/os" ) )
+                {
+                    isFamily = osName.indexOf( "z/os" ) > -1
+                        || osName.indexOf( "os/390" ) > -1;
+                }
+                else if ( family.equals( "os/400" ) )
+                {
+                    isFamily = osName.indexOf( "os/400" ) > -1;
+                }
+                else if ( family.equals( "openvms" ) )
+                {
+                    isFamily = osName.indexOf( "openvms" ) > -1;
+                }
+            }
+            if ( name != null )
+            {
+                isName = name.equals( osName );
+            }
+            if ( arch != null )
+            {
+                isArch = arch.equals( osName );
+            }
+            if ( version != null )
+            {
+                isVersion = version.equals( osVersion );
+            }
+            retValue = isFamily && isName && isArch && isVersion;
+        }
+        return retValue;
+    }
+}

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init (added)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init Sun Jan 22 19:07:01 2006
@@ -0,0 +1,216 @@
+#!/bin/bash
+#
+# chkconfig: - 91 35
+# description: Starts and stops ${app} server. 
+#
+# Shell script to start/stop ${app} 
+# If you want to change ${app} service settings please modify the server.xml
+# file.
+
+DISPLAY=localhost:1.0
+export DISPLAY
+
+# Source function library.
+if [ -f /etc/init.d/functions ] ; then
+     . /etc/init.d/functions
+fi
+
+# Source networking configuration.
+if [ -f /etc/sysconfig/network ] ; then
+     . /etc/sysconfig/network
+fi
+
+# Check that networking is up.
+if [ ! -z "$NETWORKING" ] ; then
+      if [ "$NETWORKING" = "no" ] ; then
+           exit 0
+      fi
+fi
+
+unset SERVERARGS
+SERVERS=""
+[ -f /etc/sysconfig/${app} ] && . /etc/sysconfig/${app}
+
+prog=$"${app} server"
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true 
+           if [ -z "$JAVA_VERSION" ] ; then
+             JAVA_VERSION="CurrentJDK"
+           else
+             echo "Using Java version: $JAVA_VERSION"
+           fi
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/$JAVA_VERSION/Home
+           fi
+           ;;
+  *) 
+           if [ -z "$JAVA_HOME" ] ; then
+              # take a wild guess then the logic execute below
+              JAVA_HOME=/usr/java/j2sdk1.4.2_08
+           fi
+
+           if [ ! -d "$JAVA_HOME" ] ; then
+             # look for java home in /usr/java
+             if [ -d /usr/java/jre ] ; then
+		JAVA_HOME=/usr/java
+             elif [ `uname` = Linux ] ; then
+                for jdkhome in `find /usr/java/ -type d -regex '.*\/j2sdk1.4.2_0.$' | sort`; do
+                   JAVA_HOME=$jdkhome;
+                done
+             fi 
+	   fi
+	   ;;
+esac
+
+if [ -z "$${app.caps}_HOME" ] ; then
+  # try to find install home 
+  if [ -d ${app.install.base}/${app}-${version} ] ; then
+    ${app.caps}_HOME=${app.install.base}/${app}-${version}
+  fi
+
+  if [ -d "$HOME/${app}-${version}" ] ; then
+    ${app.caps}_HOME="$HOME/${app}-${version}"
+  fi
+
+  if [ -d "/Applications/${app}-${version}" ] ; then
+    ${app.caps}_HOME=/Applications/${app}-${version}
+  fi
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+  echo "  If scrip fails because sun.* classes could not be found"
+  echo "  you will need to set the JAVA_HOME environment variable"
+  echo "  to the installation directory of java."
+else
+  echo JAVA_HOME=$JAVA_HOME
+fi
+
+if [ -z "$${app.caps}_HOME" ] ; then
+  echo "Warning: ${app.caps}_HOME environment variable is not set."
+  echo "  If script fails because classes could not be found"
+  echo "  you will need to set the ${app.caps}_HOME environment variable"
+  echo "  to the installation directory of ${app}."
+else
+  echo ${app.caps}_HOME=$${app.caps}_HOME
+fi
+CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$${app.caps}_HOME" ] &&
+    ${app.caps}_HOME=`cygpath --unix "$${app.caps}_HOME"`
+  [ -n "$${app.caps}_HOME_LOCAL" ] &&
+    ${app.caps}_HOME_LOCAL=`cygpath --unix "$${app.caps}_HOME_LOCAL"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+SERVER_HOME=$${app.caps}_HOME
+DAEMON_HOME=$SERVER_HOME/bin
+CLASSPATH=$CLASSPATH:$DAEMON_HOME/bootstrapper.jar
+echo CLASSPATH=$CLASSPATH
+${app.caps}_USER=root
+
+TMP_DIR=$SERVER_HOME/var/tmp
+PID_FILE=$SERVER_HOME/var/run/server.pid
+
+cd $SERVER_HOME
+
+case "$1" in
+  start)
+    #
+    # Start ${app}
+    #
+    echo -n $"Starting $prog: "
+    ulimit -S -c 0 >/dev/null 2>&1
+    RETVAL=0
+    
+    $DAEMON_HOME/${app} \
+    -user $${app.caps}_USER \
+    -home $JAVA_HOME \
+    -Djava.io.tmpdir=$TMP_DIR \
+    -Dlog4j.configuration=file://$SERVER_HOME/conf/log4j.properties\
+    -wait 10 \
+    -pidfile $PID_FILE \
+    -outfile $SERVER_HOME/var/log/${app}-stdout.log \
+    -errfile $SERVER_HOME/var/log/${app}-stderr.log \
+    -cp $CLASSPATH \
+    org.apache.directory.server.standalone.daemon.Bootstrapper \
+    $${app.caps}_HOME start
+
+    #
+    # To get a verbose JVM
+    #-verbose \
+    # To get a debug of jsvc.
+    #-debug \
+
+    if [ `uname` = "Darwin" ] ; then
+        [ "$RETVAL" -eq 0 ] && echo successful ${app} server startup || \
+             echo failed ${app} server start
+    elif [ `uname` = "SunOS" ] ; then
+        [ "$RETVAL" -eq 0 ] && echo success ${app} server startup || \
+             echo failure ${app} server start
+    else
+        [ "$RETVAL" -eq 0 ] && success $"${app} server startup" || \
+             failure $"${app} server start"
+        echo
+        if [ -d /var/lock/subsys ] ; then
+               [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/${app}
+        fi
+    fi
+
+    exit $?
+    ;;
+
+  stop)
+    #
+    # Stop ${app}
+    #
+    echo -n $"Shutting down $prog: "
+
+    $DAEMON_HOME/${app} \
+    -stop \
+    -pidfile $PID_FILE \
+    -Dlog4j.configuration=file://$SERVER_HOME/conf/log4j.properties\
+    org.apache.directory.server.standalone.daemon.Bootstrapper 
+    exit $?
+    ;;
+
+  debug)
+    #
+    # Debug ${app}
+    #
+    echo -n $"Starting $prog in debug mode: "
+    ulimit -S -c 0 >/dev/null 2>&1
+    RETVAL=0
+    
+    if [ -z "$2" ] ; then
+      echo
+      echo ================================================
+      echo "Warning: the debug port is not set using 5005."
+      echo ================================================
+      echo
+      DEBUG_PORT=5005
+    else
+      DEBUG_PORT="$2"
+    fi
+    
+    $JAVA_HOME/bin/java\
+    -Dlog4j.configuration=file://$SERVER_HOME/conf/log4j.properties\
+    -Xdebug -Xnoagent -Djava.compiler=NONE\
+    -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT\
+    -jar $DAEMON_HOME/bootstrapper.jar \
+    $${app.caps}_HOME start
+    ;;
+
+  *)
+    echo "Usage ${app} start/stop"
+    exit 1;;
+esac

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
------------------------------------------------------------------------------
    svn:executable = *

Propchange: directory/trunks/apacheds/standalone/installers/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jan 22 19:07:01 2006
@@ -0,0 +1,10 @@
+.classpath
+.project
+.wtpmodules
+.deployables
+.settings
+*.iml
+*.iws
+*.ipr
+*.log
+target

Added: directory/trunks/apacheds/standalone/installers/test/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/pom.xml?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/pom.xml (added)
+++ directory/trunks/apacheds/standalone/installers/test/pom.xml Sun Jan 22 19:07:01 2006
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory</groupId>
+    <artifactId>build</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <version>0.9.4-SNAPSHOT</version>
+  <artifactId>plugin-test</artifactId>
+  <groupId>org.apache.directory.server.standalone.installers.plugin</groupId>
+  <name>installers-plugin-test</name>
+  <packaging>jar</packaging>
+  <description>
+  </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server.standalone.simple</groupId>
+      <artifactId>org.apache.ldap.server.standalone.simple.jndi</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+    </dependency>  
+    <dependency>
+      <groupId>org.apache.directory.server.standalone.daemon</groupId>
+      <artifactId>org.apache.directory.server.standalone.daemon</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>  
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <version>1.2.19</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+  </dependencies>
+  <distributionManagement>
+    <site>
+      <id>apache.websites</id>
+      <url>scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/apacheds/projects/apacheds-standalone/</url>
+    </site>
+  </distributionManagement>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.directory.server.standalone.installers.plugin</groupId>
+        <artifactId>plugin</artifactId>
+        <configuration>
+          <applicationName>test</applicationName>
+          <applicationClass>org.apache.ldap.server.DirectoryServer</applicationClass>
+          <applicationVersion>${pom.version}</applicationVersion>
+          <targets>
+            <target>
+              <id>windows-xp-procrun-izpack</id>
+              <osName>Windows XP</osName>
+              <osFamily>windows</osFamily>
+              <osVersion>5.1</osVersion>
+              <osArch>x86</osArch>
+              <daemonFramework>procrun</daemonFramework>
+              <installer>izpack</installer>
+            </target>
+          </targets>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
+

Added: directory/trunks/apacheds/standalone/installers/test/src/main/installers/bootstrapper.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/src/main/installers/bootstrapper.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/src/main/installers/bootstrapper.properties (added)
+++ directory/trunks/apacheds/standalone/installers/test/src/main/installers/bootstrapper.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,2 @@
+bootstrap.start.class=org.apache.ldap.server.DirectoryServer
+bootstrap.stop.class=org.apache.ldap.server.DirectoryServer

Added: directory/trunks/apacheds/standalone/installers/test/src/main/installers/log4j.properties
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/src/main/installers/log4j.properties?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/src/main/installers/log4j.properties (added)
+++ directory/trunks/apacheds/standalone/installers/test/src/main/installers/log4j.properties Sun Jan 22 19:07:01 2006
@@ -0,0 +1,10 @@
+log4j.rootCategory=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+
+# with these we'll not get innundated when switching to DEBUG
+log4j.logger.org.apache.ldap.common.name=WARN
+log4j.logger.org.springframework=WARN
+log4j.logger.org.apache.ldap.common.codec=WARN

Added: directory/trunks/apacheds/standalone/installers/test/src/main/installers/server.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/src/main/installers/server.xml?rev=371447&view=auto
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/src/main/installers/server.xml (added)
+++ directory/trunks/apacheds/standalone/installers/test/src/main/installers/server.xml Sun Jan 22 19:07:01 2006
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+  "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+  <bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+    <property name="properties">
+      <props>
+        <prop key="asn.1.berlib.provider">org.apache.ldap.common.codec.TwixProvider</prop>
+        <prop key="java.naming.security.authentication">simple</prop>
+        <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
+        <prop key="java.naming.security.credentials">secret</prop>
+        <!--<prop key="kdc.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
+        <!--<prop key="kdc.java.naming.security.credentials">secret</prop>-->
+        <!--<prop key="changepw.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
+        <!--<prop key="changepw.java.naming.security.credentials">secret</prop>-->
+        <!-- Set this key to a space delimited set of attributeType descriptions
+             and their OID's if you want an attributeType to be handled as 
+             binary content.
+ 
+             The server will use the schema to derive the set of attributeTypes
+             to treat as binary.  The union if the values you provide here 
+             will be taken as the set of binaries. Note to be consistent you 
+             must add both the OID and all the names an attributeType can have.
+        -->
+        <!-- 
+        <prop key="java.naming.ldap.attributes.binary"></prop>
+        -->
+      </props>
+    </property>
+  </bean>
+  
+  <bean id="configuration" class="org.apache.ldap.server.configuration.MutableServerStartupConfiguration">
+    <property name="workingDirectory"><value>example.com</value></property>
+
+    <!-- Uncomment below to have the server load entries on startup!        -->
+    <!-- ldifDirectory property can point to a relative file, directory or  -->
+    <!-- can point to an absolute path to either using the URL path         -->
+    <!-- notation: i.e. file:///Users/jack/apacheds/ldifs                   -->
+
+    <!-- Entries will optionally be filtered using LdifLoadFilters in the   -->
+    <!-- order specified.  The included Krb5KdcEntryFilter will filter      -->
+    <!-- kerberos principals creating keys for them using their             -->
+    <!-- userPassword attribute if present.                                 -->
+
+    <!--<property name="ldifDirectory">
+      <value>example.ldif</value>
+    </property>
+    <property name="ldifFilters">
+      <list>
+        <bean class="org.apache.protocol.common.store.Krb5KdcEntryFilter"/>
+      </list>
+    </property>-->
+
+    <property name="allowAnonymousAccess"><value>false</value></property>
+    <property name="accessControlEnabled"><value>false</value></property>
+    <property name="enableNtp"><value>false</value></property>
+    <property name="enableKerberos"><value>false</value></property>
+    <property name="enableChangePassword"><value>false</value></property>
+    <property name="ldapPort"><value>10389</value></property>
+    <property name="contextPartitionConfigurations">
+      <set>
+        <ref bean="examplePartitionConfiguration"/>
+      </set>
+    </property>
+    <property name="bootstrapSchemas">
+      <set>
+        <bean class="org.apache.ldap.server.schema.bootstrap.AutofsSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.CorbaSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.CoreSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.CosineSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.ApacheSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.CollectiveSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.JavaSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.NisSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.SystemSchema"/>
+        <bean class="org.apache.ldap.server.schema.bootstrap.ApachednsSchema"/>
+      </set>
+    </property>
+    
+    <property name="interceptorConfigurations">
+      <list>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>normalizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.normalization.NormalizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>authenticationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.authn.AuthenticationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>referralService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.referral.ReferralService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>authorizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.authz.AuthorizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>oldAuthorizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.authz.OldAuthorizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>exceptionService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.exception.ExceptionService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>schemaService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.schema.SchemaService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>subentryService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.subtree.SubentryService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>operationalAttributeService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.operational.OperationalAttributeService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>collectiveAttributeService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.collective.CollectiveAttributeService" />
+          </property>
+        </bean>
+        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>eventService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.ldap.server.event.EventService" />
+          </property>
+        </bean>
+      </list>
+    </property>
+  </bean>
+  
+  <bean id="examplePartitionConfiguration" class="org.apache.ldap.server.configuration.MutableDirectoryPartitionConfiguration">
+    <property name="name"><value>example</value></property>
+    <property name="suffix"><value>dc=example,dc=com</value></property>
+    <property name="indexedAttributes">
+      <set>
+        <value>dc</value>
+        <value>ou</value>
+        <value>objectClass</value>
+        <value>krb5PrincipalName</value>
+        <value>uid</value>
+      </set>
+    </property>
+    <property name="contextEntry">
+      <value>
+        objectClass: top
+        objectClass: domain
+        objectClass: extensibleObject
+        dc: example
+      </value>
+    </property>
+  </bean>
+
+  <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+    <property name="customEditors">
+      <map>
+        <entry key="javax.naming.directory.Attributes">
+          <bean class="org.apache.ldap.server.configuration.AttributesPropertyEditor"/>
+        </entry>
+      </map>
+   </property>
+  </bean>
+</beans>



Mime
View raw message