directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r377335 [1/2] - in /directory/sandbox/akarasulu/rc1: apacheds/server-installers/ apacheds/server-installers/src/main/installers/ apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ apacheds/server-tools/src/main/resources...
Date Mon, 13 Feb 2006 10:40:35 GMT
Author: akarasulu
Date: Mon Feb 13 02:40:29 2006
New Revision: 377335

URL: http://svn.apache.org/viewcvs?rev=377335&view=rev
Log:
fixed issues with hack for apacheds-tools

Added:
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss   (with props)
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-apacheds-tools.sh
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-mac.xml
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-unix.xml
      - copied, changed from r377306, directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_unix.xml
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-windows.xml
      - copied unchanged from r377306, directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_windows.xml
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds-tools.sh
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds.spec
    directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
      - copied, changed from r377306, directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
    directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties
      - copied, changed from r377306, directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/ApachedsTools.properties
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/PackagedFile.java
Removed:
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/apacheds-tools.sh
    directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/ApachedsTools.properties
Modified:
    directory/sandbox/akarasulu/rc1/apacheds/server-installers/pom.xml
    directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/inno/install.iss
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_unix.xml
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_windows.xml
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/unix_shortcuts.xml
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/user_input.xml
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/windows_shortcuts.xml
    directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template

Modified: directory/sandbox/akarasulu/rc1/apacheds/server-installers/pom.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/pom.xml?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/pom.xml (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/pom.xml Mon Feb 13 02:40:29 2006
@@ -77,6 +77,10 @@
         <artifactId>daemon-plugin</artifactId>
         <configuration>
           <excludes>
+
+            <!-- apacheds-tools.jar does not get put in lib directory -->
+            <exclude>org.apache.directory.server:apacheds-server-tools</exclude>
+
             <exclude>ant:ant</exclude>
             <exclude>aopalliance:aopalliance</exclude>
             <exclude>xerces:xerces</exclude>
@@ -115,18 +119,36 @@
               <author>szoerner@apache.org</author>
             </authors>
           </application>
+          <packagedFiles>
+            <packagedFile>
+              <source>org.apache.directory.server:apacheds-server-tools</source>
+              <destinationPath>bin/apacheds-tools.jar</destinationPath>
+              <dependency>true</dependency>
+              <installationBundleId>Binaries</installationBundleId>
+            </packagedFile>
+          </packagedFiles>
           <svnBaseUrl>
             http://svn.apache.org/repos/asf/directory/trunks/apacheds
           </svnBaseUrl>
           <packageSources>true</packageSources>
           <packageDocs>true</packageDocs>
           <applicationClass>
-            org.apache.ldap.server.DirectoryServer
+            org.apache.ldap.server.Service
           </applicationClass>
           <rpmTargets>
             <rpmTarget>
+              <packagedFiles>
+                <packagedFile>
+                  <source>rpm-apacheds-tools.sh</source>
+                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
+                  <installationBundleId>Binaries</installationBundleId>
+                  <executable>true</executable>
+                  <filtered>true</filtered>
+                </packagedFile>
+              </packagedFiles>
               <!--  doSudo>true</doSudo -->
-              <id>linux-jsvc</id>
+              <id>linux-jsvc-rpm</id>
+              <rpmSpecificationFile>rpm-apacheds.spec</rpmSpecificationFile>
               <finalName>
                 apacheds-${pom.version}-linux-i386.rpm
               </finalName>
@@ -139,6 +161,7 @@
           <innoTargets>
             <innoTarget>
               <id>windows-xp-procrun</id>
+              <innoConfigurationFile>inno-apacheds.iss</innoConfigurationFile>
               <finalName>
                 apacheds-${pom.version}-win32-setup
               </finalName>
@@ -151,7 +174,17 @@
           </innoTargets>
           <izPackTargets>
             <izPackTarget>
+              <packagedFiles>
+                <packagedFile>
+                  <source>izpack-apacheds-tools.sh</source>
+                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
+                  <installationBundleId>Binaries</installationBundleId>
+                  <executable>true</executable>
+                  <filtered>true</filtered>
+                </packagedFile>
+              </packagedFiles>
               <id>linux-jsvc</id>
+              <izPackInstallFile>izpack-unix.xml</izPackInstallFile>
               <finalName>
                 apacheds-${pom.version}-linux-i386-setup.jar
               </finalName>
@@ -161,17 +194,37 @@
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
             <izPackTarget>
+              <packagedFiles>
+                <packagedFile>
+                  <source>izpack-apacheds-tools.sh</source>
+                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
+                  <installationBundleId>Binaries</installationBundleId>
+                  <executable>true</executable>
+                  <filtered>true</filtered>
+                </packagedFile>
+              </packagedFiles>
               <finalName>
                 apacheds-${pom.version}-solaris-sparc-setup.jar
               </finalName>
               <id>solaris-jsvc-sparc</id>
+              <izPackInstallFile>izpack-unix.xml</izPackInstallFile>
               <osName>sunos</osName>
               <osFamily>unix</osFamily>
               <osArch>sparc</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
             <izPackTarget>
+              <packagedFiles>
+                <packagedFile>
+                  <source>izpack-apacheds-tools.sh</source>
+                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
+                  <installationBundleId>Binaries</installationBundleId>
+                  <executable>true</executable>
+                  <filtered>true</filtered>
+                </packagedFile>
+              </packagedFiles>
               <id>solaris-jsvc-i386</id>
+              <izPackInstallFile>izpack-unix.xml</izPackInstallFile>
               <finalName>
                 apacheds-${pom.version}-solaris-i386-setup.jar
               </finalName>
@@ -181,7 +234,17 @@
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
             <izPackTarget>
+              <packagedFiles>
+                <packagedFile>
+                  <source>izpack-apacheds-tools.sh</source>
+                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
+                  <installationBundleId>Binaries</installationBundleId>
+                  <executable>true</executable>
+                  <filtered>true</filtered>
+                </packagedFile>
+              </packagedFiles>
               <id>macosx-jsvc</id>
+              <izPackInstallFile>izpack-mac.xml</izPackInstallFile>
               <finalName>
                 apacheds-${pom.version}-macosx-ppc-setup.jar
               </finalName>

Added: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss (added)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss Mon Feb 13 02:40:29 2006
@@ -0,0 +1,82 @@
+; Script generated by the Apache Maven 2 Installers Plugin
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "${app}"
+#define MyAppVerName "${app} ${app.version}"
+#define MyAppVersion "${app.version}"
+#define MyAppPublisher "${app.author}"
+#define MyAppURL "${app.url}"
+#define MyAppExeName "${app}w.exe"
+#define MyAppCompanyName "${app.company.name}"
+#define MyAppDescription "${app.description}"
+#define MyAppCopyright "Copyright (c) ${app.copyright.year} ${app.company.name}"
+
+; Set this constant to the path where your installation image resides
+#define SourceBase "${image.basedir}"
+
+[Setup]
+AppName={#MyAppName}
+AppVerName={#MyAppVerName}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\${app}-${app.version}
+DefaultGroupName={#MyAppName}
+LicenseFile={#SourceBase}\${app.license.name}
+OutputDir="${installer.output.directory}"
+OutputBaseFilename=${app.final.name}
+SetupIconFile={#SourceBase}\${app.icon.name}
+Compression=lzma
+SolidCompression=true
+VersionInfoCompany={#MyAppCompanyName}
+VersionInfoDescription={#MyAppDescription}
+AppCopyright={#MyAppCopyright}
+ShowLanguageDialog=yes
+AppVersion={#MyAppVersion}
+
+[Languages]
+Name: eng; MessagesFile: compiler:Default.isl
+
+[Tasks]
+Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
+
+[Files]
+; bin directory targets
+Source: {#SourceBase}\bin\${app}w.exe; DestDir: {app}\bin; Tasks: ; Languages: 
+Source: {#SourceBase}\bin\${app}.exe; DestDir: {app}\bin
+Source: {#SourceBase}\bin\bootstrapper.jar; DestDir: {app}\bin; DestName: bootstrapper.jar
+Source: {#SourceBase}\bin\logger.jar; DestDir: {app}\bin; DestName: logger.jar
+Source: {#SourceBase}\bin\apacheds-tools.jar; DestDir: {app}\bin; DestName: apacheds-tools.jar
+Source: {#SourceBase}\bin\daemon.jar; DestDir: {app}\bin; DestName: daemon.jar
+; conf directory targets
+Source: {#SourceBase}\conf\log4j.properties; DestDir: {app}\conf; DestName: log4j.properties
+Source: {#SourceBase}\conf\server.xml; DestDir: {app}\conf; DestName: server.xml
+Source: {#SourceBase}\conf\bootstrapper.properties; DestDir: {app}\conf; DestName: bootstrapper.properties
+; top level directory targets 
+Source: {#SourceBase}\${app.license.name}; DestDir: {app}; DestName: ${app.license.name}
+Source: {#SourceBase}\${app.readme.name}; DestDir: {app}; DestName: ${app.readme.name}
+Source: {#SourceBase}\${app.icon.name}; DestDir: {app}; DestName: ${app.icon.name}
+; empty var & lib\ext directory structure
+Source: {#SourceBase}\var\*; DestDir: "{app}\var\"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: {#SourceBase}\lib\ext; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
+; lib directory targets
+${app.lib.jars}
+${docs.directive}
+${sources.directive}
+${notice.file}
+
+[Icons]
+Name: {group}\Service Settings; Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app}; IconIndex: 0
+Name: {userdesktop}\{#MyAppName}; Filename: {app}\bin\${app}w.exe; Tasks: desktopicon; Parameters: //ES//${app}; IconIndex: 0; Languages: 
+Name: {group}\Tray Monitor; Filename: {app}\bin\${app}w.exe; Parameters: //MS//${app}; IconIndex: 0
+Name: {group}\Test Service; Filename: {app}\bin\${app}.exe; IconIndex: 0
+
+[Run]
+Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Tasks: ; Languages: ; Parameters: "//IS//${app.displayname} --Description=""${app.description} Service ${app.version} - ${app.url}"" --DisplayName=${app.displayname} --Install=""{app}\bin\${app}.exe"" --StartMode=jvm --StopMode=jvm --StartClass=org.apache.directory.daemon.ProcrunBootstrapper --StartMethod prunsrvStart --StartParams=""{app}"" --StopClass=org.apache.directory.daemon.ProcrunBootstrapper --StopMethod prunsrvStop --StopParams=""{app}"" --Startup=manual --JvmOptions=""-D${app}.home={app}"" --Classpath=""{app}\bin\bootstrapper.jar;{app}\conf;{app}\bin\logger.jar;{app}\bin\daemon.jar"" --LogPath=""{app}\var\log"" --LogPrefix=${app}.log --LogLevel=debug --StdOutput=""{app}\var\log\${app}-stdout.log"" --StdError=""{app}\var\log\${app}-stderr.log"""; Flags: runhidden
+Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app.displayname}; WorkingDir: {app}\bin; Flags: postinstall nowait; Description: Runs the configuration manager for the ${app} windows service
+
+[Registry]
+
+[UninstallRun]
+Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Parameters: //DS//${app.displayname}

Propchange: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/inno-apacheds.iss
------------------------------------------------------------------------------
    svn:executable = *

Added: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-apacheds-tools.sh
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-apacheds-tools.sh?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-apacheds-tools.sh (added)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-apacheds-tools.sh Mon Feb 13 02:40:29 2006
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Really simple script for launching ApacheDS tools using IzPack
+
+APACHEDS_HOME=%INSTALL_PATH
+$JAVA_HOME/bin/java -jar $APACHEDS_HOME/bin/apacheds-tools.jar $@

Added: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-mac.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-mac.xml?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-mac.xml (added)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-mac.xml Mon Feb 13 02:40:29 2006
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!--
+  /*
+  *   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.
+  *
+  */
+-->
+
+<installation version="1.0">
+  <info>
+    <appname>${app}</appname>
+    <appversion>${app.version}</appversion>
+    <appsubpath>${app}-${app.version}</appsubpath>
+    <authors>
+      <author name="${app.author}" email="${app.email}" />
+    </authors>
+    <url>${app.url}</url>
+    <javaversion>${app.java.version}</javaversion>
+  </info>
+
+  <guiprefs height="480" resizable="yes" width="640">
+    <laf name="metouia">
+      <os family="unix" />
+    </laf>
+  </guiprefs>
+
+  <locale>
+    <langpack iso3="eng" />
+  </locale>
+
+  <resources>
+    <res id="installer.langsel.img" src="${app.icon}" />
+    <res id="Installer.image" src="${app.icon}" />
+    <res id="Installer.image.0" src="${app.icon}" />
+    <res id="Installer.image.1" src="${app.icon}" />
+    <res id="Installer.image.2" src="${app.icon}" />
+    <res id="Installer.image.3" src="${app.icon}" />
+    <res id="Installer.image.4" src="${app.icon}" />
+    <res id="Installer.image.5" src="${app.icon}" />
+    <res id="LicencePanel.licence" src="${app.license}" />
+    <res id="InfoPanel.info" src="${app.readme}" />
+    <res id="ImgPacksPanel.img.0" src="${app.icon}" />
+    <res id="ImgPacksPanel.img.1" src="${app.icon}" />
+    <res id="shortcutSpec.xml" src="${unix.shortcuts}" />
+    <res id="Unix_shortcutSpec.xml" src="${unix.shortcuts}" />
+    <res id="userInputSpec.xml" src="${user.input}" />
+  </resources>
+
+  <panels>
+    <panel classname="HelloPanel" />
+    <panel classname="InfoPanel" />
+    <panel classname="LicencePanel" />
+    <panel classname="TargetPanel" />
+    <panel classname="ImgPacksPanel" />
+    <panel classname="InstallPanel" />
+    <panel classname="ShortcutPanel" />
+    <panel classname="FinishPanel" />
+  </panels>
+
+  <packs>
+    <pack name="Binaries" required="yes">
+      <description>Binary Executables</description>
+      <fileset dir="${image.basedir}" targetdir="$INSTALL_PATH">
+        <include name="**/*" />
+      </fileset>
+    
+      <executable os="unix" targetfile="$INSTALL_PATH/bin/${app}" stage="never" keep="true" />
+      <singlefile os="unix" src="bin/${server.init}" target="/etc/init.d/${app}" />
+      <parsable os="unix" targetfile="$INSTALL_PATH/bin/${server.init}" type="shell" />
+      <parsable os="unix" targetfile="$INSTALL_PATH/bin/apacheds-tools.sh" type="shell" />
+      <parsable os="unix" targetfile="/etc/init.d/${app}" type="shell" />
+      <executable os="unix" targetfile="/etc/init.d/${app}" stage="never" keep="true" />
+      <executable os="unix" targetfile="$INSTALL_PATH/bin/${server.init}" stage="never" keep="true" />
+      <executable os="unix" targetfile="$INSTALL_PATH/bin/apacheds-tools.sh" stage="never" keep="true" />
+    </pack>
+  </packs>
+</installation>

Copied: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-unix.xml (from r377306, directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_unix.xml)
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-unix.xml?p2=directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-unix.xml&p1=directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_unix.xml&r1=377306&r2=377335&rev=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/install_unix.xml (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/izpack-unix.xml Mon Feb 13 02:40:29 2006
@@ -83,11 +83,6 @@
       <parsable os="unix" targetfile="/etc/init.d/${app}" type="shell" />
       <executable os="unix" targetfile="/etc/init.d/${app}" stage="never" keep="true" />
       <executable os="unix" targetfile="$INSTALL_PATH/bin/${server.init}" stage="never" keep="true" />
-      <!-- 
-      HACK BELOW!
-            todo clean me up
-            see DIREVE-333
-       -->
       <executable os="unix" targetfile="$INSTALL_PATH/bin/apacheds-tools.sh" stage="never" keep="true" />
     </pack>
   </packs>

Added: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds-tools.sh
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds-tools.sh?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds-tools.sh (added)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds-tools.sh Mon Feb 13 02:40:29 2006
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Really simple script to launch apacheds tools with RPM installer
+
+APACHEDS_HOME=/usr/local/${app}-${app.version}
+$JAVA_HOME/bin/java -jar $APACHEDS_HOME/bin/apacheds-tools.jar $@

Added: directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds.spec
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds.spec?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds.spec (added)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-installers/src/main/installers/rpm-apacheds.spec Mon Feb 13 02:40:29 2006
@@ -0,0 +1,89 @@
+Summary: ${app.display.name} Server 
+Name: ${app}
+Version: ${app.version}
+Release: ${app.release}
+License: ${app.license.type}
+Group: System Environment/Daemons
+URL: ${app.url}
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+${app.description}
+
+%prep
+echo $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT
+cp -rf ${image.basedir} $RPM_BUILD_ROOT/%{name}-%{version}
+cd $RPM_BUILD_ROOT
+tar -zcvf /usr/src/redhat/SOURCES/%{name}-%{version}.tar.gz %{name}-%{version}
+
+%setup -q
+
+%build
+cd $RPM_BUILD_ROOT/%{name}-%{version}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/lib/ext
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/log
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/run
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/partitions
+touch $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/log/${app}-stderr.log
+touch $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/log/${app}-stdout.log
+mkdir -p $RPM_BUILD_ROOT/etc/init.d
+${mk.docs.dirs}
+${mk.sources.dirs}
+
+pwd
+install -m 755 ${image.basedir}/bin/${app} $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/${app}
+install -m 644 ${image.basedir}/bin/bootstrapper.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/bootstrapper.jar
+install -m 644 ${image.basedir}/bin/apacheds-tools.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/apacheds-tools.jar
+install -m 755 ${image.basedir}/bin/apacheds-tools.sh $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/apacheds-tools.sh
+install -m 644 ${image.basedir}/bin/logger.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/logger.jar
+install -m 644 ${image.basedir}/bin/daemon.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/daemon.jar
+install -m 600 ${image.basedir}/conf/server.xml $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/server.xml
+install -m 644 ${image.basedir}/conf/bootstrapper.properties $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/bootstrapper.properties
+install -m 644 ${image.basedir}/conf/log4j.properties $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/log4j.properties
+install -m 744 ${image.basedir}/bin/${server.init} $RPM_BUILD_ROOT/etc/init.d/${app}
+install -m 644 ${image.basedir}/${app.license.name} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+install -m 644 ${image.basedir}/${app.readme.name} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+install -m 644 ${image.basedir}/${app.icon} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+${install.append.libs}
+${install.docs}
+${install.sources}
+${install.notice.file}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc ${app.license.name} ${app.readme.name}
+
+/etc/init.d/${app}
+/usr/local/${app}-%{version}/bin/${app}
+/usr/local/${app}-%{version}/bin/bootstrapper.jar
+/usr/local/${app}-%{version}/bin/apacheds-tools.jar
+/usr/local/${app}-%{version}/bin/apacheds-tools.sh
+/usr/local/${app}-%{version}/bin/logger.jar
+/usr/local/${app}-%{version}/bin/daemon.jar
+/usr/local/${app}-%{version}/conf/log4j.properties
+/usr/local/${app}-%{version}/conf/bootstrapper.properties
+/usr/local/${app}-%{version}/conf/server.xml
+/usr/local/${app}-%{version}/lib/ext
+/usr/local/${app}-%{version}/var/run
+/usr/local/${app}-%{version}/var/log
+/usr/local/${app}-%{version}/var/partitions
+/usr/local/${app}-%{version}/var/log/${app}-stderr.log
+/usr/local/${app}-%{version}/var/log/${app}-stdout.log
+/usr/local/${app}-%{version}/${app.readme.name}
+/usr/local/${app}-%{version}/${app.license.name}
+/usr/local/${app}-%{version}/${app.icon}
+${verify.append.libs}
+${verify.docs}
+${verify.sources}
+${verify.notice.file}

Modified: directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java Mon Feb 13 02:40:29 2006
@@ -16,21 +16,11 @@
  */
 package org.apache.directory.server.tools;
 
-
 import java.io.IOException;
 import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.apache.directory.server.configuration.ServerStartupConfiguration;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -44,74 +34,18 @@
  */
 public class ApachedsTools
 {
-    private final static Map commands = new HashMap();
-    private final static Options global = new Options();
-    private final static Properties props = new Properties();
-    private final static String version;
-
-    static
-    {
-        ToolCommand command;
-        command = new DumpCommand();
-        commands.put( command.getName(), command );
-        command = new GracefulShutdownCommand();
-        commands.put( command.getName(), command );
-        command = new DiagnosticCommand();
-        commands.put( command.getName(), command );
-        command = new DisconnectNotificationCommand();
-        commands.put( command.getName(), command );
-
-        Option op = new Option( "i", "install-path", true, "path to apacheds installation directory" );
-        global.addOption( op );
-        op = new Option( "b", "banner", false, "suppress banner print outs" );
-        global.addOption( op );
-        op = new Option( "d", "debug", false, "toggle debug mode" );
-        global.addOption( op );
-        op = new Option( "v", "verbose", false, "toggle verbose debugging" );
-        global.addOption( op );
-        op = new Option( "q", "quiet", false, "keep the noise down to a minimum" );
-        global.addOption( op );
-        op = new Option( "c", "configuration", false, "force loading the server.xml (requires -i)" );
-        global.addOption( op );
-        op = new Option( "version", false, "print the version information and exit" );
-        global.addOption( op );
-
-        try
-        {
-            props.load( ApachedsTools.class.getResourceAsStream( "ApachedsTools.properties" ) );
-        }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
-        }
-
-        version = props.getProperty( "apacheds.tools.version" );
-    }
-
-
-    private static boolean hasBannerOption( String[] args )
-    {
-        for ( int ii = 0; ii < args.length; ii++ )
-        {
-            if ( args[ii].equals( "-b" ) || args[ii].equals( "-banner" ) )
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
     public static void main( String[] args ) throws Exception
     {
-        if ( !hasBannerOption( args ) )
+        BaseCommand tools = getInstance();
+        
+        if ( !BaseCommand.hasBannerOption( args ) )
         {
-            printBanner();
+            tools.printBanner();
         }
 
         if ( args.length == 0 )
         {
-            System.err.println( "Type apacheds-tools help for usage." );
+            System.err.println( "Type " + tools.getProductCommand() + " help for usage." );
             System.exit( 1 );
         }
 
@@ -119,44 +53,44 @@
         String command = args[0].toLowerCase();
         if ( "help".equals( command ) )
         {
-            CommandLine cmdline = getCommandLine( command, args );
+            CommandLine cmdline = tools.getCommandLine( command, args );
             if ( cmdline.getArgs().length > 1 )
             {
-                helpOnCommand( cmdline.getArgs()[1] );
+                tools.helpOnCommand( cmdline.getArgs()[1] );
                 System.exit( 0 );
             }
             else
             {
-                printUsage();
+                tools.printUsage();
                 System.exit( 0 );
             }
         }
         else if ( command.equals( "-version" ) )
         {
-            System.out.println( "apacheds-tools version " + version );
+            System.out.println( tools.getProductCommand() + " version " + tools.getProductVersion() );
             System.exit( 0 );
         }
 
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
+        ToolCommand cmd = ( ToolCommand ) tools.getCommands().get( command );
         if ( cmd == null )
         {
             System.err.println( "Unknown command: " + args[0] );
-            System.err.println( "Type apacheds-tools help for usage." );
+            System.err.println( "Type " + tools.getProductCommand() + " help for usage." );
             System.exit( 1 );
         }
 
-        CommandLine cmdline = getCommandLine( command, args );
+        CommandLine cmdline = tools.getCommandLine( command, args );
         if ( cmdline.hasOption( 'd' ) )
         {
             cmd.setDebugEnabled( true );
-            dumpArgs( "raw command line arguments: ", args );
-            dumpArgs( "parsed arguments: ", cmdline.getArgs() );
+            BaseCommand.dumpArgs( "raw command line arguments: ", args );
+            BaseCommand.dumpArgs( "parsed arguments: ", cmdline.getArgs() );
         }
 
         cmd.setQuietEnabled( cmdline.hasOption( 'q' ) );
         cmd.setDebugEnabled( cmdline.hasOption( 'd' ) );
         cmd.setVerboseEnabled( cmdline.hasOption( 'v' ) );
-        cmd.setVersion( version );
+        cmd.setVersion( tools.getProductVersion() );
         if ( cmdline.getOptionValue( 'i' ) != null )
         {
             cmd.setLayout( cmdline.getOptionValue( 'i' ) );
@@ -179,113 +113,31 @@
     }
 
 
-    private static CommandLine getCommandLine( String command, String[] args )
+    public static BaseCommand getInstance() throws InstantiationException, IllegalAccessException, ClassNotFoundException
     {
-        Options all = allOptions( command );
-        CommandLineParser parser = new PosixParser();
-        CommandLine cmdline = null;
+        Properties props = new Properties();
         try
         {
-            cmdline = parser.parse( all, args );
-        }
-        catch ( ParseException e )
-        {
-            System.err.println( "Command line parsing failed for " + command + ".  Reason: " + e.getMessage() );
-            System.exit( 1 );
-        }
-        return cmdline;
-    }
-
-
-    private static Options allOptions( String command )
-    {
-        if ( command.equals( "help" ) )
-        {
-            return global;
+            props.load( BaseCommand.class.getResourceAsStream( "product.properties" ) );
         }
-
-        Options all = new Options();
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
-        for ( Iterator ii = global.getOptions().iterator(); ii.hasNext(); )
-        {
-            all.addOption( ( Option ) ii.next() );
-        }
-
-        for ( Iterator ii = cmd.getOptions().getOptions().iterator(); ii.hasNext(); )
-        {
-            all.addOption( ( Option ) ii.next() );
-        }
-        return all;
-    }
-
-
-    private static void dumpArgs( String msg, String[] args )
-    {
-        if ( args.length == 0 )
-        {
-            System.out.println( msg );
-            System.out.println( "\t NONE" );
-            return;
-        }
-
-        StringBuffer buf = new StringBuffer();
-        buf.append( msg ).append( "\n" );
-        for ( int ii = 0; ii < args.length; ii++ )
-        {
-            buf.append( "\targs[" + ii + "] = " ).append( args[ii] ).append( "\n" );
-        }
-        System.out.println( buf );
-    }
-
-
-    private static void helpOnCommand( String command )
-    {
-        if ( command.equals( "help" ) )
-        {
-            printUsage();
-            System.exit( 0 );
-        }
-        if ( commands.containsKey( command ) )
-        {
-            ToolCommand cmd = ( ToolCommand ) commands.get( command );
-            HelpFormatter formatter = new HelpFormatter();
-            formatter.printHelp( "apacheds-tools " + cmd + " [options]", cmd.getOptions() );
-        }
-        else
-        {
-            System.err.println( command + ": unknown command" );
-            System.exit( 1 );
-        }
-    }
-
-
-    private static void printUsage()
-    {
-        HelpFormatter formatter = new HelpFormatter();
-        formatter.printHelp( "apacheds-tools <command> [options]", "\nGlobal options:", global,
-            "\nType \"apacheds-tools help <command>\" for help on a command." );
-        System.out.println( "\nAvalable commands:" );
-        Iterator it = commands.values().iterator();
-        System.out.println( "\thelp" );
-        while ( it.hasNext() )
+        catch ( IOException e )
         {
-            System.out.println( "\t" + it.next() );
+            e.printStackTrace();
         }
 
-        System.out.println( "\nThese apacheds-tools are used to manage the Apache Directory Server." );
-        System.out.println( "For additional information, see http://directory.apache.org/" );
-    }
-
-    public static final String BANNER = "       _                     _          ____  ____    _____           _      \n"
-        + "      / \\   _ __   __ _  ___| |__   ___|  _ \\/ ___|  |_   _|__   ___ | |___  \n"
-        + "     / _ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ | | \\___ \\    | |/ _ \\ / _ \\| / __| \n"
-        + "    / ___ \\| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \\__ \\ \n"
-        + "   /_/   \\_\\ .__/ \\__,_|\\___|_| |_|\\___|____/|____/    |_|\\___/ \\___/|_|___/ \n"
-        + "           |_|                                                               \n";
-
-
-    public static void printBanner()
-    {
-        System.out.println( BANNER );
+        String productVersion = props.getProperty( "product.version", "UNKNOWN" );
+        String productUrl = props.getProperty( "product.url", "http://directory.apache.org" );
+        String productDisplayName = props.getProperty( "product.display.name", "Apache Directory Server" );
+        String productCommand = props.getProperty( "product.command", "apacheds-tools" );
+        String productBanner = props.getProperty( "product.banner", BaseCommand.BANNER );
+        String productClass = props.getProperty( "product.class", "org.apache.directory.server.tools.BaseCommand" );
+        
+        BaseCommand baseCommand = ( BaseCommand ) Class.forName( productClass ).newInstance();
+        baseCommand.setProductBanner( productBanner );
+        baseCommand.setProductDisplayName( productDisplayName );
+        baseCommand.setProductUrl( productUrl );
+        baseCommand.setProductVersion( productVersion );
+        baseCommand.setProductCommand( productCommand );
+        return baseCommand;
     }
 }

Copied: directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java (from r377306, directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java)
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java?p2=directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java&p1=directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java&r1=377306&r2=377335&rev=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java Mon Feb 13 02:40:29 2006
@@ -17,12 +17,9 @@
 package org.apache.directory.server.tools;
 
 
-import java.io.IOException;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
@@ -31,65 +28,61 @@
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
-import org.apache.directory.server.configuration.ServerStartupConfiguration;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
 
 
 /**
- * The main() application which executes command targets.
+ * The primary command base class.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ApachedsTools
+public class BaseCommand
 {
-    private final static Map commands = new HashMap();
-    private final static Options global = new Options();
-    private final static Properties props = new Properties();
-    private final static String version;
-
-    static
+    private Map commands = new HashMap();
+    private Options global = new Options();
+    private String productCommand;
+    private String productVersion;
+    private String productDisplayName;
+    private String productUrl;
+    private String productBanner;
+    
+    
+    public BaseCommand()
+    {
+        init();
+    }
+    
+    
+    protected void init()
     {
         ToolCommand command;
         command = new DumpCommand();
-        commands.put( command.getName(), command );
+        getCommands().put( command.getName(), command );
         command = new GracefulShutdownCommand();
-        commands.put( command.getName(), command );
+        getCommands().put( command.getName(), command );
         command = new DiagnosticCommand();
-        commands.put( command.getName(), command );
+        getCommands().put( command.getName(), command );
         command = new DisconnectNotificationCommand();
-        commands.put( command.getName(), command );
+        getCommands().put( command.getName(), command );
 
-        Option op = new Option( "i", "install-path", true, "path to apacheds installation directory" );
-        global.addOption( op );
+        Option op = new Option( "i", "install-path", true, "path to installation directory" );
+        getGlobal().addOption( op );
         op = new Option( "b", "banner", false, "suppress banner print outs" );
-        global.addOption( op );
+        getGlobal().addOption( op );
         op = new Option( "d", "debug", false, "toggle debug mode" );
-        global.addOption( op );
+        getGlobal().addOption( op );
         op = new Option( "v", "verbose", false, "toggle verbose debugging" );
-        global.addOption( op );
+        getGlobal().addOption( op );
         op = new Option( "q", "quiet", false, "keep the noise down to a minimum" );
-        global.addOption( op );
+        getGlobal().addOption( op );
         op = new Option( "c", "configuration", false, "force loading the server.xml (requires -i)" );
-        global.addOption( op );
+        getGlobal().addOption( op );
         op = new Option( "version", false, "print the version information and exit" );
-        global.addOption( op );
-
-        try
-        {
-            props.load( ApachedsTools.class.getResourceAsStream( "ApachedsTools.properties" ) );
-        }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
-        }
-
-        version = props.getProperty( "apacheds.tools.version" );
+        getGlobal().addOption( op );
     }
-
-
-    private static boolean hasBannerOption( String[] args )
+    
+    
+    public static boolean hasBannerOption( String[] args )
     {
         for ( int ii = 0; ii < args.length; ii++ )
         {
@@ -102,84 +95,7 @@
     }
 
 
-    public static void main( String[] args ) throws Exception
-    {
-        if ( !hasBannerOption( args ) )
-        {
-            printBanner();
-        }
-
-        if ( args.length == 0 )
-        {
-            System.err.println( "Type apacheds-tools help for usage." );
-            System.exit( 1 );
-        }
-
-        // help is a special command 
-        String command = args[0].toLowerCase();
-        if ( "help".equals( command ) )
-        {
-            CommandLine cmdline = getCommandLine( command, args );
-            if ( cmdline.getArgs().length > 1 )
-            {
-                helpOnCommand( cmdline.getArgs()[1] );
-                System.exit( 0 );
-            }
-            else
-            {
-                printUsage();
-                System.exit( 0 );
-            }
-        }
-        else if ( command.equals( "-version" ) )
-        {
-            System.out.println( "apacheds-tools version " + version );
-            System.exit( 0 );
-        }
-
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
-        if ( cmd == null )
-        {
-            System.err.println( "Unknown command: " + args[0] );
-            System.err.println( "Type apacheds-tools help for usage." );
-            System.exit( 1 );
-        }
-
-        CommandLine cmdline = getCommandLine( command, args );
-        if ( cmdline.hasOption( 'd' ) )
-        {
-            cmd.setDebugEnabled( true );
-            dumpArgs( "raw command line arguments: ", args );
-            dumpArgs( "parsed arguments: ", cmdline.getArgs() );
-        }
-
-        cmd.setQuietEnabled( cmdline.hasOption( 'q' ) );
-        cmd.setDebugEnabled( cmdline.hasOption( 'd' ) );
-        cmd.setVerboseEnabled( cmdline.hasOption( 'v' ) );
-        cmd.setVersion( version );
-        if ( cmdline.getOptionValue( 'i' ) != null )
-        {
-            cmd.setLayout( cmdline.getOptionValue( 'i' ) );
-            if ( !cmd.isQuietEnabled() )
-            {
-                System.out.println( "loading settings from: " + cmd.getLayout().getConfigurationFile() );
-            }
-            ApplicationContext factory = null;
-            URL configUrl = configUrl = cmd.getLayout().getConfigurationFile().toURL();
-            factory = new FileSystemXmlApplicationContext( configUrl.toString() );
-            cmd.setConfiguration( ( ServerStartupConfiguration ) factory.getBean( "configuration" ) );
-        }
-        else if ( cmdline.hasOption( 'c' ) )
-        {
-            System.err.println( "forced configuration load (-c) requires the -i option" );
-            System.exit( 1 );
-        }
-
-        cmd.execute( cmdline );
-    }
-
-
-    private static CommandLine getCommandLine( String command, String[] args )
+    public CommandLine getCommandLine( String command, String[] args )
     {
         Options all = allOptions( command );
         CommandLineParser parser = new PosixParser();
@@ -197,16 +113,16 @@
     }
 
 
-    private static Options allOptions( String command )
+    public Options allOptions( String command )
     {
         if ( command.equals( "help" ) )
         {
-            return global;
+            return getGlobal();
         }
 
         Options all = new Options();
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
-        for ( Iterator ii = global.getOptions().iterator(); ii.hasNext(); )
+        ToolCommand cmd = ( ToolCommand ) getCommands().get( command );
+        for ( Iterator ii = getGlobal().getOptions().iterator(); ii.hasNext(); )
         {
             all.addOption( ( Option ) ii.next() );
         }
@@ -219,7 +135,7 @@
     }
 
 
-    private static void dumpArgs( String msg, String[] args )
+    public static void dumpArgs( String msg, String[] args )
     {
         if ( args.length == 0 )
         {
@@ -238,18 +154,18 @@
     }
 
 
-    private static void helpOnCommand( String command )
+    public void helpOnCommand( String command )
     {
         if ( command.equals( "help" ) )
         {
             printUsage();
             System.exit( 0 );
         }
-        if ( commands.containsKey( command ) )
+        if ( getCommands().containsKey( command ) )
         {
-            ToolCommand cmd = ( ToolCommand ) commands.get( command );
+            ToolCommand cmd = ( ToolCommand ) getCommands().get( command );
             HelpFormatter formatter = new HelpFormatter();
-            formatter.printHelp( "apacheds-tools " + cmd + " [options]", cmd.getOptions() );
+            formatter.printHelp(  getProductCommand() + " " + cmd + " [options]", cmd.getOptions() );
         }
         else
         {
@@ -259,24 +175,24 @@
     }
 
 
-    private static void printUsage()
+    public void printUsage()
     {
         HelpFormatter formatter = new HelpFormatter();
-        formatter.printHelp( "apacheds-tools <command> [options]", "\nGlobal options:", global,
-            "\nType \"apacheds-tools help <command>\" for help on a command." );
+        formatter.printHelp( getProductCommand() + " <command> [options]", "\nGlobal options:", getGlobal(),
+            "\nType \"" + getProductCommand() + " help <command>\" for help on a command." );
         System.out.println( "\nAvalable commands:" );
-        Iterator it = commands.values().iterator();
+        Iterator it = getCommands().values().iterator();
         System.out.println( "\thelp" );
         while ( it.hasNext() )
         {
             System.out.println( "\t" + it.next() );
         }
 
-        System.out.println( "\nThese apacheds-tools are used to manage the Apache Directory Server." );
-        System.out.println( "For additional information, see http://directory.apache.org/" );
+        System.out.println( "\nThese tools are used to manage " + getProductDisplayName() + "." );
+        System.out.println( "For additional information, see " + getProductUrl() );
     }
 
-    public static final String BANNER = "       _                     _          ____  ____    _____           _      \n"
+    static final String BANNER = "       _                     _          ____  ____    _____           _      \n"
         + "      / \\   _ __   __ _  ___| |__   ___|  _ \\/ ___|  |_   _|__   ___ | |___  \n"
         + "     / _ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ | | \\___ \\    | |/ _ \\ / _ \\| / __| \n"
         + "    / ___ \\| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \\__ \\ \n"
@@ -284,8 +200,92 @@
         + "           |_|                                                               \n";
 
 
-    public static void printBanner()
+    public void printBanner()
+    {
+        System.out.println( getProductBanner() );
+    }
+
+
+    public void setProductCommand( String productCommand )
+    {
+        this.productCommand = productCommand;
+    }
+
+
+    public String getProductCommand()
+    {
+        return productCommand;
+    }
+
+
+    public void setProductVersion( String productVersion )
+    {
+        this.productVersion = productVersion;
+    }
+
+
+    public String getProductVersion()
+    {
+        return productVersion;
+    }
+
+
+    public void setProductDisplayName( String productDisplayName )
+    {
+        this.productDisplayName = productDisplayName;
+    }
+
+
+    public String getProductDisplayName()
+    {
+        return productDisplayName;
+    }
+
+
+    public void setProductUrl( String productUrl )
+    {
+        this.productUrl = productUrl;
+    }
+
+
+    public String getProductUrl()
+    {
+        return productUrl;
+    }
+
+
+    public void setProductBanner( String productBanner )
+    {
+        this.productBanner = productBanner;
+    }
+
+
+    public String getProductBanner()
+    {
+        return productBanner;
+    }
+
+
+    public void setCommands( Map commands )
+    {
+        this.commands = commands;
+    }
+
+
+    public Map getCommands()
+    {
+        return commands;
+    }
+
+
+    public void setGlobal( Options global )
+    {
+        this.global = global;
+    }
+
+
+    public Options getGlobal()
     {
-        System.out.println( BANNER );
+        return global;
     }
 }

Copied: directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties (from r377306, directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/ApachedsTools.properties)
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties?p2=directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties&p1=directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/ApachedsTools.properties&r1=377306&r2=377335&rev=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/ApachedsTools.properties (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties Mon Feb 13 02:40:29 2006
@@ -1 +1 @@
-apacheds.tools.version=${pom.version}
+product.version=${pom.version}

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java Mon Feb 13 02:40:29 2006
@@ -1,5 +1,4 @@
 /*
- *   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.
@@ -36,20 +35,25 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class CreateImageCommand implements MojoCommand
+public class CreateImageCommand extends MojoCommand
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final ServiceInstallersMojo mymojo;
     private final Target target;
     private InstallationLayout layout;
 
 
-    public CreateImageCommand(ServiceInstallersMojo mojo, Target target)
+    public CreateImageCommand( ServiceInstallersMojo mojo, Target target )
     {
-        this.mymojo = mojo;
+        super( mojo );
         this.target = target;
         initializeFiltering();
     }
+    
+    
+    public Properties getFilterProperties()
+    {
+        return filterProperties;
+    }
 
 
     private void initializeFiltering()
@@ -149,22 +153,6 @@
             }
         }
 
-        // copy over the REQUIRED apacheds-tools.jar file 
-        /** HACK!
-         * @todo clean me up
-         * @see http://issues.apache.org/jira/browse/DIREVE-333 
-         */
-        File tools = new File( layout.getBinDirectory(), "apacheds-tools.jar" );
-        try
-        {
-            FileUtils.copyFile( mymojo.getTools().getFile(), tools );
-        }
-        catch ( IOException e )
-        {
-            throw new MojoFailureException( "Failed to copy apacheds-tools.jar " + mymojo.getTools().getFile()
-                + " into position " + tools );
-        }
-
         // copy over the REQUIRED bootstrapper.jar file 
         try
         {
@@ -241,8 +229,7 @@
             }
             catch ( IOException e )
             {
-                mymojo.getLog().error(
-                    "Failed to copy logger configuration file " + target.getLoggerConfigurationFile()
+                log.error( "Failed to copy logger configuration file " + target.getLoggerConfigurationFile()
                         + " into position " + layout.getLoggerConfigurationFile(), e );
             }
         }
@@ -256,8 +243,7 @@
             }
             catch ( IOException e )
             {
-                mymojo.getLog().error(
-                    "Failed to copy server configuration file " + target.getServerConfigurationFile()
+                log.error( "Failed to copy server configuration file " + target.getServerConfigurationFile()
                         + " into position " + layout.getConfigurationFile(), e );
             }
         }
@@ -325,32 +311,6 @@
             }
         }
 
-        // now copy over the Prunsrv and Prunmgr executables renaming them to the mymojo.getApplicationName() + w for mgr
-        if ( target.getOsFamily().equals( "windows" ) && target.getOsArch().equals( "x86" ) )
-        {
-            File executable = new File( layout.getBinDirectory(), target.getApplication().getName() + ".exe" );
-            try
-            {
-                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "prunsrv.exe" ), executable );
-            }
-            catch ( IOException e )
-            {
-                throw new MojoFailureException( "Failed to copy prunsrv executable file "
-                    + getClass().getResource( "prunsrv.exe" ) + " into position " + executable.getAbsolutePath() );
-            }
-
-            executable = new File( layout.getBinDirectory(), target.getApplication().getName() + "w.exe" );
-            try
-            {
-                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "prunmgr.exe" ), executable );
-            }
-            catch ( IOException e )
-            {
-                throw new MojoFailureException( "Failed to copy prunmgr executable file "
-                    + getClass().getResource( "prunmgr.exe" ) + " into position " + executable.getAbsolutePath() );
-            }
-        }
-
         target.setLibArtifacts( MojoHelperUtils.copyDependencies( mymojo, layout ) );
 
         // -- copy sources if set --
@@ -397,10 +357,11 @@
             }
             catch ( IOException e )
             {
-                mymojo.getLog().error(
-                    "Failed to notice file " + noticeFile.getAbsolutePath() + " into position "
+                log.error( "Failed to notice file " + noticeFile.getAbsolutePath() + " into position "
                         + noticeFileTarget.getAbsolutePath(), e );
             }
         }
+        
+        processPackagedFiles( target, mymojo.getPackagedFiles() );
     }
 }

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java Mon Feb 13 02:40:29 2006
@@ -17,8 +17,19 @@
 package org.apache.directory.daemon.installers;
 
 
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.Expand;
+import org.codehaus.plexus.util.FileUtils;
 
 
 /**
@@ -27,7 +38,121 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface MojoCommand
+public abstract class MojoCommand
 {
+    protected final Map dependencyMap;
+    protected final Log log;
+    protected final ServiceInstallersMojo mymojo;
+    
     public abstract void execute() throws MojoExecutionException, MojoFailureException;
+    public abstract Properties getFilterProperties();
+    
+
+    public MojoCommand( ServiceInstallersMojo mymojo )
+    {
+        this.mymojo = mymojo;
+        this.log = mymojo.getLog();
+        this.dependencyMap = new HashMap();
+        
+        for ( Iterator ii = mymojo.getProject().getDependencyArtifacts().iterator(); ii.hasNext(); /* */ )
+        {
+            Artifact artifact = ( Artifact ) ii.next();
+            dependencyMap.put( artifact.getGroupId() + ":" + artifact.getArtifactId(), artifact );
+        }
+    }
+    
+    
+    public void processPackagedFiles( Target target, PackagedFile[] packagedFiles ) throws MojoFailureException
+    {
+        if ( packagedFiles == null )
+        {
+            return;
+        }
+        
+        for ( int ii = 0; ii < packagedFiles.length; ii++ )
+        {
+            File source = null;
+
+            if ( packagedFiles[ii].isDependency() )
+            {
+                Artifact artifact = ( Artifact ) dependencyMap.get( packagedFiles[ii].getSource() );
+                source = artifact.getFile().getAbsoluteFile();
+            }
+            else
+            {
+                source = new File( packagedFiles[ii].getSource() );
+            }
+            
+            if ( ! source.isAbsolute() )
+            {
+                File sourceDirectoryRelative = new File( mymojo.getSourceDirectory(), packagedFiles[ii].getSource() );
+                File baseRelative = new File( mymojo.getProject().getBasedir(), packagedFiles[ii].getSource() );
+                if ( sourceDirectoryRelative.exists() )
+                {
+                    source = sourceDirectoryRelative;
+                }
+                else if ( baseRelative.exists() )
+                {
+                    source = baseRelative;
+                }
+                else if ( ! source.exists() )
+                {
+                    throw new MojoFailureException( "Failed to copy packagedFile. Cannot locate source: " + source );
+                }
+                
+                source = source.getAbsoluteFile();
+            }
+            
+            if ( packagedFiles[ii].isExpandable() )
+            {
+                File dest = new File( target.getLayout().getBaseDirectory(), packagedFiles[ii].getDestinationPath() );
+                String fileExtension = source.getName().substring( source.getName().lastIndexOf( '.' ) );
+                if ( fileExtension.equalsIgnoreCase( ".jar" ) || fileExtension.equalsIgnoreCase( ".zip" ) )
+                {
+                    Expand expand = new Expand();
+                    expand.setSrc( source );
+                    expand.setOverwrite( true );
+                    expand.setDest( dest );
+                    try
+                    {
+                        expand.execute();
+                        return;
+                    }
+                    catch ( Exception e )
+                    {
+                        throw new MojoFailureException( "Failed to expaned packagedFile " + source + ": " + e.getMessage() );
+                    }
+                }
+                
+                throw new MojoFailureException( "Failed to expand packagedFile: " + source 
+                    + ". It does not have a jar or zip extension" );
+            }
+            
+            File dest = new File( target.getLayout().getBaseDirectory(), packagedFiles[ii].getDestinationPath() );
+            if ( packagedFiles[ii].isFiltered() )
+            {
+                try
+                {
+                    MojoHelperUtils.copyAsciiFile( mymojo, getFilterProperties(), source, dest, true );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoFailureException( "Failed to copy packagedFile from source " + source +
+                        " to destination " + dest );
+                }
+                
+                return;
+            }
+            
+            try
+            {
+                FileUtils.copyFile( source, dest );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy packagedFile from source " + source +
+                    " to destination " + dest );
+            }
+        }
+    }
 }

Added: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/PackagedFile.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/PackagedFile.java?rev=377335&view=auto
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/PackagedFile.java (added)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/PackagedFile.java Mon Feb 13 02:40:29 2006
@@ -0,0 +1,131 @@
+/*
+ *   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.daemon.installers;
+
+
+
+/**
+ * A file packaged within the installer.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class PackagedFile
+{
+    /** true if this file is obtained from the local maven repository as a project dependency */
+    private boolean dependency = false;
+    /** true if this file is to be filtered to substitute variables */
+    private boolean filtered = false;
+    /** true if this file is to be made executable */
+    private boolean executable = false;
+    /** true if this file is to be expanded based on its zip or jar extension to the destination */
+    private boolean expandable = false;
+    /** 
+     * the dependency descriptor (groupId:artifactId) if the file is a dependency or a 
+     * path to a file.  If the path is not absolute then it is searched for in the project
+     * first under src/main/installers, then from the ${basedir} down.
+     */
+    private String source;
+    /** the destination file or directory path relative to the installation image base */
+    private String destinationPath;
+    /** the identifier of an installation bundle if this file is part of a bundle */
+    private String installationBundleId;
+    
+    
+    public void setDependency( boolean dependency )
+    {
+        this.dependency = dependency;
+    }
+    
+    
+    public boolean isDependency()
+    {
+        return dependency;
+    }
+
+
+    public void setFiltered( boolean filtered )
+    {
+        this.filtered = filtered;
+    }
+
+
+    public boolean isFiltered()
+    {
+        return filtered;
+    }
+
+
+    public void setExecutable( boolean executable )
+    {
+        this.executable = executable;
+    }
+
+
+    public boolean isExecutable()
+    {
+        return executable;
+    }
+
+
+    public void setExpandable( boolean expand )
+    {
+        this.expandable = expand;
+    }
+
+
+    public boolean isExpandable()
+    {
+        return expandable;
+    }
+
+
+    public void setSource( String sourcePath )
+    {
+        this.source = sourcePath;
+    }
+
+
+    public String getSource()
+    {
+        return source;
+    }
+
+
+    public void setDestinationPath( String destinationPath )
+    {
+        this.destinationPath = destinationPath;
+    }
+
+
+    public String getDestinationPath()
+    {
+        return destinationPath;
+    }
+
+
+    public void setInstallationBundleId( String installationBundleId )
+    {
+        this.installationBundleId = installationBundleId;
+    }
+
+
+    public String getInstallationBundleId()
+    {
+        return installationBundleId;
+    }
+}

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java Mon Feb 13 02:40:29 2006
@@ -57,14 +57,6 @@
 {
     static final String BOOTSTRAPPER_ARTIFACT_ID = "daemon-bootstrappers";
     static final String BOOTSTRAPPER_GROUP_ID = "org.apache.directory.daemon";
-
-    /** HACK!
-     * @todo clean me up
-     * @see http://issues.apache.org/jira/browse/DIREVE-333 
-     */
-    static final String TOOLS_ARTIFACT_ID = "apacheds-server-tools";
-    static final String TOOLS_GROUP_ID = "org.apache.directory.server";
-
     static final String LOGGER_ARTIFACT_ID = "nlog4j";
     static final String LOGGER_GROUP_ID = "org.slf4j";
     static final String DAEMON_ARTIFACT_ID = "commons-daemon";
@@ -161,6 +153,11 @@
     /**
      * @parameter
      */
+    private PackagedFile[] packagedFiles;
+
+    /**
+     * @parameter
+     */
     private Set excludes;
 
     /** daemon bootstrapper */
@@ -170,11 +167,6 @@
     /** commons-daemon dependency needed by native daemon */
     private Artifact daemon;
 
-    /** HACK!
-     * @todo clean me up
-     * @see http://issues.apache.org/jira/browse/DIREVE-333 
-     */
-    private Artifact tools;
     private File exportedSources;
     private File docsBase;
     private List allTargets;
@@ -476,17 +468,6 @@
                 getLog().info( "Found daemon dependency with version: " + artifact.getVersion() );
                 daemon = artifact;
             }
-
-            /** HACK!
-             * @todo clean me up
-             * @see http://issues.apache.org/jira/browse/DIREVE-333 
-             */
-            else if ( artifact.getArtifactId().equals( TOOLS_ARTIFACT_ID )
-                && artifact.getGroupId().equals( TOOLS_GROUP_ID ) )
-            {
-                getLog().info( "Found tools dependency with version: " + artifact.getVersion() );
-                tools = artifact;
-            }
         }
 
         if ( bootstrapper == null )
@@ -603,12 +584,6 @@
     }
 
 
-    public Artifact getTools()
-    {
-        return tools;
-    }
-
-
     public String getEncoding()
     {
         return this.encoding;
@@ -636,5 +611,17 @@
     public File getSourceDirectory()
     {
         return this.sourceDirectory;
+    }
+
+
+    public void setPackagedFiles( PackagedFile[] packagedFiles )
+    {
+        this.packagedFiles = packagedFiles;
+    }
+
+
+    public PackagedFile[] getPackagedFiles()
+    {
+        return packagedFiles;
     }
 }

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java Mon Feb 13 02:40:29 2006
@@ -78,7 +78,8 @@
     private List libArtifacts;
 
     private Application application;
-
+    private PackagedFile[] packagedFiles;
+    
 
     public void setApplication( Application application )
     {
@@ -309,5 +310,17 @@
     public String getDocsTargetPath()
     {
         return docsTargetPath;
+    }
+
+
+    public void setPackagedFiles( PackagedFile[] packagedFiles )
+    {
+        this.packagedFiles = packagedFiles;
+    }
+
+
+    public PackagedFile[] getPackagedFiles()
+    {
+        return packagedFiles;
     }
 }

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java Mon Feb 13 02:40:29 2006
@@ -36,6 +36,7 @@
 import org.apache.tools.ant.taskdefs.Execute;
 import org.apache.tools.ant.taskdefs.Touch;
 
+import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.Os;
 
 
@@ -45,10 +46,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class InnoInstallerCommand implements MojoCommand
+public class InnoInstallerCommand extends MojoCommand
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final ServiceInstallersMojo mymojo;
     private final InnoTarget target;
     private final File innoConfigurationFile;
     private final Log log;
@@ -56,32 +56,35 @@
     private File innoCompiler;
 
 
-    //    private File innoOutputFile;
-
-    public InnoInstallerCommand(ServiceInstallersMojo mymojo, InnoTarget target)
+    public InnoInstallerCommand( ServiceInstallersMojo mymojo, InnoTarget target ) throws MojoFailureException
     {
-        this.mymojo = mymojo;
+        super( mymojo );
         this.target = target;
         this.log = mymojo.getLog();
         File imagesDir = target.getLayout().getBaseDirectory().getParentFile();
         innoConfigurationFile = new File( imagesDir, target.getId() + ".iss" );
+        initializeFiltering();
     }
 
 
+    public Properties getFilterProperties()
+    {
+        return filterProperties;
+    }
+    
+    
     /**
      * Performs the following:
      * <ol>
      *   <li>Bail if target is not for windows or current machine is not windows (no inno compiler)</li>
      *   <li>Filter and copy project supplied inno file into place if it has been specified and exists</li>
-     *   <li>If no inno file exists filter and deposite into place bundled inno template</li>
+     *   <li>If no inno file exists filter and deposite into place bundled inno template & copy procrun executables</li>
      *   <li>Bail if we cannot find the inno compiler executable</li>
      *   <li>Execute inno compiler it on the inno file</li>
      * </ol> 
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        initializeFiltering();
-
         // -------------------------------------------------------------------
         // Step 1 & 4: do some error checking first for compiler and OS
         // -------------------------------------------------------------------
@@ -154,6 +157,83 @@
                     + innoConfigurationFile );
             }
         }
+
+        // -------------------------------------------------------------------
+        // 3: copy procrun files 
+        // -------------------------------------------------------------------
+
+        // now copy over the Prunsrv and Prunmgr executables renaming them to the mymojo.getApplicationName() + w for mgr
+        if ( target.getOsFamily().equals( "windows" ) && target.getOsArch().equals( "x86" ) )
+        {
+            // ---------------------------------------------------------------
+            // Handle the server process: prunsrv.exe 
+            // ---------------------------------------------------------------
+
+            File executableTarget = new File( target.getLayout().getBinDirectory(), 
+                target.getApplication().getName() + ".exe" );
+            File override = new File( mymojo.getSourceDirectory(), target.getPrunsrvExecutablePath() );
+            if ( override.exists() )
+            {
+                mymojo.getLog().info( "Using procrun prunsrv.exe supplied by project: " + override.getAbsolutePath() );
+                try
+                {
+                    FileUtils.copyFile( override, executableTarget );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoFailureException( "Failed to copy project supplied prunsrv executable override "
+                        + override.getAbsolutePath() + " into position " + executableTarget.getAbsolutePath() );
+                }
+            }
+            else
+            {
+                try
+                {
+                    MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "../prunsrv.exe" ), executableTarget );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoFailureException( "Failed to copy prunsrv executable file "
+                        + getClass().getResource( "../prunsrv.exe" ) + " into position " + executableTarget.getAbsolutePath() );
+                }
+            }
+            
+
+            // ---------------------------------------------------------------
+            // Handle the manager process: prunmgr.exe 
+            // ---------------------------------------------------------------
+
+            executableTarget = new File( target.getLayout().getBinDirectory(), 
+                target.getApplication().getName() + "w.exe" );
+            override = new File( mymojo.getSourceDirectory(), target.getPrunmgrExecutablePath() );
+            if ( override.exists() )
+            {
+                mymojo.getLog().info( "Using procrun prunmgr.exe supplied by project: " + override.getAbsolutePath() );
+                try
+                {
+                    FileUtils.copyFile( override, executableTarget );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoFailureException( "Failed to copy project supplied prunmgr executable override "
+                        + override.getAbsolutePath() + " into position " + executableTarget.getAbsolutePath() );
+                }
+            }
+            else
+            {
+                try
+                {
+                    MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "../prunmgr.exe" ), executableTarget );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoFailureException( "Failed to copy prunmgr executable file "
+                        + getClass().getResource( "../prunmgr.exe" ) + " into position " + executableTarget.getAbsolutePath() );
+                }
+            }
+        }
+
+        processPackagedFiles( target, target.getPackagedFiles() );
 
         Execute task = new Execute();
         System.out.println( "innoCompiler = " + innoCompiler );

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java Mon Feb 13 02:40:29 2006
@@ -31,6 +31,8 @@
  */
 public class InnoTarget extends Target
 {
+    private String prunmgrExecutablePath = "src\\main\\installers\\prunmgr.exe";
+    private String prunsrvExecutablePath = "src\\main\\installers\\prunsrv.exe";
     private File innoCompiler = new File( "C:\\Program Files\\Inno Setup 5\\ISCC.exe" );
     private File innoConfigurationFile;
 
@@ -64,5 +66,29 @@
     public File getInnoConfigurationFile()
     {
         return innoConfigurationFile;
+    }
+
+
+    public void setPrunmgrExecutablePath( String prunmgrExecutablePath )
+    {
+        this.prunmgrExecutablePath = prunmgrExecutablePath;
+    }
+
+
+    public String getPrunmgrExecutablePath()
+    {
+        return prunmgrExecutablePath;
+    }
+
+
+    public void setPrunsrvExecutablePath( String prunsrvExecutablePath )
+    {
+        this.prunsrvExecutablePath = prunsrvExecutablePath;
+    }
+
+
+    public String getPrunsrvExecutablePath()
+    {
+        return prunsrvExecutablePath;
     }
 }

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java Mon Feb 13 02:40:29 2006
@@ -39,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class IzPackInstallerCommand implements MojoCommand
+public class IzPackInstallerCommand extends MojoCommand
 {
     private final static String UNIX_INSTALL = "install_unix.xml";
     private final static String UNIX_SHORTCUTS = "unix_shortcuts.xml";
@@ -49,7 +49,6 @@
     private final static String SHELLLINK_DLL = "ShellLink.dll";
 
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final ServiceInstallersMojo mymojo;
     private final IzPackTarget target;
     private final InstallationLayout layout;
 
@@ -62,11 +61,11 @@
     private File izPackBase;
 
 
-    public IzPackInstallerCommand(ServiceInstallersMojo mymojo, IzPackTarget target)
+    public IzPackInstallerCommand( ServiceInstallersMojo mymojo, IzPackTarget target )
     {
+        super( mymojo );
         this.target = target;
         this.layout = target.getLayout();
-        this.mymojo = mymojo;
         File imageDir = layout.getBaseDirectory().getParentFile();
         izPackBase = new File( imageDir, target.getId() );
 
@@ -87,10 +86,18 @@
         initializeFiltering();
     }
 
+    
+    public Properties getFilterProperties()
+    {
+        return filterProperties;
+    }
+    
 
     public void execute() throws MojoExecutionException, MojoFailureException
     {
         doIzPackFiles();
+        processPackagedFiles( target, target.getPackagedFiles() );
+
         Project antProject = new Project();
         IzPackTask task = new IzPackTask();
         task.setBasedir( izPackBase.getPath() );
@@ -215,22 +222,6 @@
         }
         else if ( target.getOsFamily().equals( "unix" ) || target.getOsFamily().equals( "mac" ) )
         {
-            /** HACK!
-             * @todo clean me up
-             * @see http://issues.apache.org/jira/browse/DIREVE-333 
-             */
-            File toolsSource = new File( this.mymojo.getSourceDirectory(), "apacheds-tools.sh" );
-            File toolsTarget = new File( layout.getBinDirectory(), "apacheds-tools.sh" );
-            try
-            {
-                MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, toolsSource, toolsTarget, true );
-            }
-            catch ( IOException e )
-            {
-                mymojo.getLog().error(
-                    "Failed to copy apacheds-tools.sh file " + toolsSource + " into position " + toolsTarget, e );
-            }
-
             if ( target.getIzPackInstallFile() != null && target.getIzPackInstallFile().exists() )
             {
                 try

Modified: directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java?rev=377335&r1=377334&r2=377335&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java (original)
+++ directory/sandbox/akarasulu/rc1/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java Mon Feb 13 02:40:29 2006
@@ -18,7 +18,6 @@
 
 
 import java.io.File;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -48,10 +47,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RpmInstallerCommand implements MojoCommand
+public class RpmInstallerCommand extends MojoCommand
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final ServiceInstallersMojo mymojo;
     private final RpmTarget target;
     private final File rpmConfigurationFile;
     private final Log log;
@@ -59,16 +57,23 @@
     private File rpmBuilder;
 
 
-    public RpmInstallerCommand(ServiceInstallersMojo mymojo, RpmTarget target)
+    public RpmInstallerCommand(ServiceInstallersMojo mymojo, RpmTarget target) throws MojoFailureException
     {
-        this.mymojo = mymojo;
+        super( mymojo );
         this.target = target;
         this.log = mymojo.getLog();
         File imagesDir = target.getLayout().getBaseDirectory().getParentFile();
         rpmConfigurationFile = new File( imagesDir, target.getId() + ".spec" );
+        initializeFiltering();
     }
 
 
+    public Properties getFilterProperties()
+    {
+        return filterProperties;
+    }
+    
+    
     /**
      * Performs the following:
      * <ol>
@@ -81,8 +86,6 @@
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        initializeFiltering();
-
         // -------------------------------------------------------------------
         // Step 1 & 4: do some error checking first for builder and OS
         // -------------------------------------------------------------------
@@ -128,33 +131,7 @@
         // Step 2 & 3: copy rpm spec file and filter 
         // -------------------------------------------------------------------
 
-        /** HACK!
-         * @todo clean me up
-         * @see http://issues.apache.org/jira/browse/DIREVE-333 
-         */
         String version = target.getApplication().getVersion().replace( '-', '_' );
-        File toolsTarget = new File( target.getLayout().getBinDirectory(), "apacheds-tools.sh" );
-        StringBuffer buf = new StringBuffer();
-        buf.append( "#!/bin/sh\n\n" );
-        buf.append( "$JAVA_HOME/bin/java -jar " );
-        buf.append( "/usr/local/apacheds-" );
-        buf.append( version );
-        buf.append( "/bin/apacheds-tools.jar $@\n" );
-        FileWriter writer = null;
-        try
-        {
-            writer = new FileWriter( toolsTarget );
-            writer.write( buf.toString() );
-            writer.flush();
-        }
-        catch ( IOException e1 )
-        {
-            throw new MojoFailureException( "Failed to write out apacheds-tools.sh" );
-        }
-        finally
-        {
-            try { writer.close(); } catch( Exception e ){ e.printStackTrace(); };
-        }
         
         try
         {
@@ -209,6 +186,8 @@
                     + rpmConfigurationFile );
             }
         }
+
+        processPackagedFiles( target, target.getPackagedFiles() );
 
         buildSourceTarball();
         String[] cmd = new String[]



Mime
View raw message