directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1000024 [2/3] - in /directory/apacheds/branches/apacheds-apacheds-2.0: apacheds-installers/ apacheds-installers/src/main/installers/ installers-plugin/src/main/java/org/apache/directory/daemon/installers/ installers-plugin/src/main/java/or...
Date Wed, 22 Sep 2010 15:07:27 GMT
Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java Wed Sep 22 15:07:26 2010
@@ -68,152 +68,153 @@ public class DebInstallerCommand extends
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        // Verifying the target is linux
-        if ( !target.getOsFamily().equals( "linux" ) )
-        {
-            log.warn( "DEB package installer can only be targeted for Linux platforms!" );
-            log.warn( "The build will continue, but please check the the platform of this installer " );
-            log.warn( "target" );
-            return;
-        }
-
-        // Verifying the dpkg utility exists
-        if ( !target.getDpkgUtility().exists() )
-        {
-            log.warn( "Cannot find dpkg utility at this location: " + target.getDpkgUtility() );
-            log.warn( "The build will continue, but please check the location of your dpkg " );
-            log.warn( "utility." );
-            return;
-        }
-        else
-        {
-            dpkgUtility = target.getDpkgUtility();
-        }
-
-        File baseDirectory = target.getLayout().getInstallationDirectory();
-        File imagesDirectory = baseDirectory.getParentFile();
-
-        log.info( "Creating Debian DEB Package..." );
-
-        // Creating the package directory
-        File debDirectory = new File( imagesDirectory, target.getId() + "-deb" );
-        debDirectory.mkdirs();
-
-        log.info( "Copying DEB Package files" );
-
-        // Copying the apacheds files in the '/opt/apacheds-$VERSION/' directory
-        File debApacheDsHomeDirectory = new File( debDirectory, "opt/apacheds-" + mojo.getProject().getVersion() );
-        try
-        {
-            // Copying the generated layout
-            MojoHelperUtils.copyFiles( baseDirectory, debApacheDsHomeDirectory );
-
-            // Replacing the apacheds.conf file
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.conf" ),
-                new File( debApacheDsHomeDirectory, "conf/apacheds.conf" ), false );
-        }
-        catch ( IOException e )
-        {
-            log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallationDirectory()
-                + ") to the DEB directory (" + debApacheDsHomeDirectory + ")" );
-        }
-
-        // Copying the instances in the '/var/lib/apacheds-$VERSION/default' directory
-        File debDefaultInstanceDirectory = new File( debDirectory, "var/lib/apacheds-"
-            + mojo.getProject().getVersion() + "/default" );
-        debDefaultInstanceDirectory.mkdirs();
-        File debDefaultInstanceConfDirectory = new File( debDefaultInstanceDirectory, "conf" );
-        debDefaultInstanceConfDirectory.mkdirs();
-        new File( debDefaultInstanceDirectory, "ldif" ).mkdirs();
-        new File( debDefaultInstanceDirectory, "log" ).mkdirs();
-        new File( debDefaultInstanceDirectory, "partitions" ).mkdirs();
-        new File( debDefaultInstanceDirectory, "run" ).mkdirs();
-        File debEtcInitdDirectory = new File( debDirectory, "etc/init.d" );
-        debEtcInitdDirectory.mkdirs();
-        new File( debDirectory, "/var/run/apacheds-" + mojo.getProject().getVersion() ).mkdirs();
-        try
-        {
-            // Copying the apacheds.conf file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
-                "apacheds-default.conf" ), new File( debDefaultInstanceConfDirectory, "apacheds.conf" ), false );
-
-            // Copying the log4j.properties file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( debApacheDsHomeDirectory,
-                "conf/log4j.properties" ), new File( debDefaultInstanceConfDirectory, "log4j.properties" ), false );
-
-            // Copying the server.xml file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( debApacheDsHomeDirectory,
-                "conf/server.xml" ), new File( debDefaultInstanceConfDirectory, "server.xml" ), false );
-
-            // Copying the init script in /etc/init.d/
-            MojoHelperUtils
-                .copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds-init" ), new File(
-                    debEtcInitdDirectory, "apacheds-" + mojo.getProject().getVersion() + "-default" ), true );
-
-            // Removing the redundant server.xml file (see DIRSERVER-1112)
-            new File( debApacheDsHomeDirectory, "conf/server.xml" ).delete();
-        }
-        catch ( IOException e )
-        {
-            log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy resources files to the DEB directory ("
-                + debDefaultInstanceDirectory + ")" );
-        }
-
-        // Create DEBIAN directory
-        File debDebianDirectory = new File( debDirectory, "DEBIAN" );
-        debDebianDirectory.mkdirs();
-
-        // Copying the 'control' file
-        try
-        {
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "control" ),
-                new File( debDebianDirectory, "control" ), true );
-
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "postinst" ),
-                new File( debDebianDirectory, "postinst" ), true );
-
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "prerm" ),
-                new File( debDebianDirectory, "prerm" ), true );
-        }
-        catch ( IOException e )
-        {
-            log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy DEB 'control' file." );
-        }
-
-        // Setting correct permission on the postinst script
-        MojoHelperUtils.exec( new String[]
-            { "chmod", "755", new File( debDebianDirectory, "postinst" ).toString() }, debDebianDirectory, false );
-        MojoHelperUtils.exec( new String[]
-            { "chmod", "755", new File( debDebianDirectory, "prerm" ).toString() }, debDebianDirectory, false );
-
-        // Generating the DEB
-        log.info( "Generating Debian DEB Package" );
-        String finalName = target.getFinalName();
-        if ( !finalName.endsWith( ".deb" ) )
-        {
-            finalName = finalName + ".deb";
-        }
-        Execute createDebTask = new Execute();
-        String[] cmd = new String[]
-            { dpkgUtility.getAbsolutePath(), "-b", target.getId() + "-deb", finalName };
-        createDebTask.setCommandline( cmd );
-        createDebTask.setSpawn( true );
-        createDebTask.setWorkingDirectory( imagesDirectory );
-
-        try
-        {
-            createDebTask.execute();
-        }
-        catch ( IOException e )
-        {
-            log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed while trying to generate the DEB package: " + e.getMessage() );
-        }
-
-        log.info( "Debian DEB package generated at " + new File( imagesDirectory, finalName ) );
+        // TODO FIXME
+        //        // Verifying the target is linux
+        //        if ( !target.getOsFamily().equals( "linux" ) )
+        //        {
+        //            log.warn( "DEB package installer can only be targeted for Linux platforms!" );
+        //            log.warn( "The build will continue, but please check the the platform of this installer " );
+        //            log.warn( "target" );
+        //            return;
+        //        }
+        //
+        //        // Verifying the dpkg utility exists
+        //        if ( !target.getDpkgUtility().exists() )
+        //        {
+        //            log.warn( "Cannot find dpkg utility at this location: " + target.getDpkgUtility() );
+        //            log.warn( "The build will continue, but please check the location of your dpkg " );
+        //            log.warn( "utility." );
+        //            return;
+        //        }
+        //        else
+        //        {
+        //            dpkgUtility = target.getDpkgUtility();
+        //        }
+        //
+        //        File baseDirectory = target.getLayout().getInstallationDirectory();
+        //        File imagesDirectory = baseDirectory.getParentFile();
+        //
+        //        log.info( "Creating Debian DEB Package..." );
+        //
+        //        // Creating the package directory
+        //        File debDirectory = new File( imagesDirectory, target.getId() + "-deb" );
+        //        debDirectory.mkdirs();
+        //
+        //        log.info( "Copying DEB Package files" );
+        //
+        //        // Copying the apacheds files in the '/opt/apacheds-$VERSION/' directory
+        //        File debApacheDsHomeDirectory = new File( debDirectory, "opt/apacheds-" + mojo.getProject().getVersion() );
+        //        try
+        //        {
+        //            // Copying the generated layout
+        //            MojoHelperUtils.copyFiles( baseDirectory, debApacheDsHomeDirectory );
+        //
+        //            // Replacing the apacheds.conf file
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.conf" ),
+        //                new File( debApacheDsHomeDirectory, "conf/apacheds.conf" ), false );
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            log.error( e.getMessage() );
+        //            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallationDirectory()
+        //                + ") to the DEB directory (" + debApacheDsHomeDirectory + ")" );
+        //        }
+        //
+        //        // Copying the instances in the '/var/lib/apacheds-$VERSION/default' directory
+        //        File debDefaultInstanceDirectory = new File( debDirectory, "var/lib/apacheds-"
+        //            + mojo.getProject().getVersion() + "/default" );
+        //        debDefaultInstanceDirectory.mkdirs();
+        //        File debDefaultInstanceConfDirectory = new File( debDefaultInstanceDirectory, "conf" );
+        //        debDefaultInstanceConfDirectory.mkdirs();
+        //        new File( debDefaultInstanceDirectory, "ldif" ).mkdirs();
+        //        new File( debDefaultInstanceDirectory, "log" ).mkdirs();
+        //        new File( debDefaultInstanceDirectory, "partitions" ).mkdirs();
+        //        new File( debDefaultInstanceDirectory, "run" ).mkdirs();
+        //        File debEtcInitdDirectory = new File( debDirectory, "etc/init.d" );
+        //        debEtcInitdDirectory.mkdirs();
+        //        new File( debDirectory, "/var/run/apacheds-" + mojo.getProject().getVersion() ).mkdirs();
+        //        try
+        //        {
+        //            // Copying the apacheds.conf file in the default instance conf directory
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
+        //                "apacheds-default.conf" ), new File( debDefaultInstanceConfDirectory, "apacheds.conf" ), false );
+        //
+        //            // Copying the log4j.properties file in the default instance conf directory
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( debApacheDsHomeDirectory,
+        //                "conf/log4j.properties" ), new File( debDefaultInstanceConfDirectory, "log4j.properties" ), false );
+        //
+        //            // Copying the server.xml file in the default instance conf directory
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( debApacheDsHomeDirectory,
+        //                "conf/server.xml" ), new File( debDefaultInstanceConfDirectory, "server.xml" ), false );
+        //
+        //            // Copying the init script in /etc/init.d/
+        //            MojoHelperUtils
+        //                .copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds-init" ), new File(
+        //                    debEtcInitdDirectory, "apacheds-" + mojo.getProject().getVersion() + "-default" ), true );
+        //
+        //            // Removing the redundant server.xml file (see DIRSERVER-1112)
+        //            new File( debApacheDsHomeDirectory, "conf/server.xml" ).delete();
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            log.error( e.getMessage() );
+        //            throw new MojoFailureException( "Failed to copy resources files to the DEB directory ("
+        //                + debDefaultInstanceDirectory + ")" );
+        //        }
+        //
+        //        // Create DEBIAN directory
+        //        File debDebianDirectory = new File( debDirectory, "DEBIAN" );
+        //        debDebianDirectory.mkdirs();
+        //
+        //        // Copying the 'control' file
+        //        try
+        //        {
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "control" ),
+        //                new File( debDebianDirectory, "control" ), true );
+        //
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "postinst" ),
+        //                new File( debDebianDirectory, "postinst" ), true );
+        //
+        //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "prerm" ),
+        //                new File( debDebianDirectory, "prerm" ), true );
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            log.error( e.getMessage() );
+        //            throw new MojoFailureException( "Failed to copy DEB 'control' file." );
+        //        }
+        //
+        //        // Setting correct permission on the postinst script
+        //        MojoHelperUtils.exec( new String[]
+        //            { "chmod", "755", new File( debDebianDirectory, "postinst" ).toString() }, debDebianDirectory, false );
+        //        MojoHelperUtils.exec( new String[]
+        //            { "chmod", "755", new File( debDebianDirectory, "prerm" ).toString() }, debDebianDirectory, false );
+        //
+        //        // Generating the DEB
+        //        log.info( "Generating Debian DEB Package" );
+        //        String finalName = target.getFinalName();
+        //        if ( !finalName.endsWith( ".deb" ) )
+        //        {
+        //            finalName = finalName + ".deb";
+        //        }
+        //        Execute createDebTask = new Execute();
+        //        String[] cmd = new String[]
+        //            { dpkgUtility.getAbsolutePath(), "-b", target.getId() + "-deb", finalName };
+        //        createDebTask.setCommandline( cmd );
+        //        createDebTask.setSpawn( true );
+        //        createDebTask.setWorkingDirectory( imagesDirectory );
+        //
+        //        try
+        //        {
+        //            createDebTask.execute();
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            log.error( e.getMessage() );
+        //            throw new MojoFailureException( "Failed while trying to generate the DEB package: " + e.getMessage() );
+        //        }
+        //
+        //        log.info( "Debian DEB package generated at " + new File( imagesDirectory, finalName ) );
     }
 
 

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java Wed Sep 22 15:07:26 2010
@@ -27,6 +27,9 @@ import java.util.Properties;
 import org.apache.directory.daemon.installers.AbstractMojoCommand;
 import org.apache.directory.daemon.installers.GenerateMojo;
 import org.apache.directory.daemon.installers.MojoHelperUtils;
+import org.apache.directory.daemon.installers.Target;
+import org.apache.directory.server.InstallationLayout;
+import org.apache.directory.server.InstanceLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.tools.ant.taskdefs.Execute;
@@ -40,8 +43,7 @@ import org.apache.tools.ant.taskdefs.Exe
 public class MacOsXPkgInstallerCommand extends AbstractMojoCommand<MacOsXPkgTarget>
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    /** The PackageMaker utility executable */
-    private File packageMakerUtility;
+
     /** The hdiutil utility executable */
     private File hdiutilUtility = new File( "/usr/bin/hdiutil" );
 
@@ -71,50 +73,40 @@ public class MacOsXPkgInstallerCommand e
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        // Verifying the target is macosx
-        if ( !target.getOsFamily().equals( "macosx" ) )
+        // Verifying the target is Mac OS X
+        if ( !target.getOsName().equalsIgnoreCase( Target.OS_NAME_MAC_OS_X ) )
         {
             log.warn( "Mac OS X PKG installer can only be targeted for Mac OS X platform!" );
-            log.warn( "The build will continue, but please check the the platform of this installer " );
-            log.warn( "target" );
+            log.warn( "The build will continue, but please check the the platform of this installer target." );
             return;
         }
 
         // Verifying the PackageMaker utility exists
         if ( !target.getPackageMakerUtility().exists() )
         {
-            log.warn( "Cannot find PackageMaker utility at this location: " + target.getPackageMakerUtility() );
-            log.warn( "The build will continue, but please check the location of your Package Maker " );
-            log.warn( "utility." );
+            log.warn( "Cannot find 'PackageMaker' utility at this location: " + target.getPackageMakerUtility() );
+            log.warn( "The build will continue, but please check the location of your 'Package Maker' utility." );
             return;
         }
-        else
-        {
-            packageMakerUtility = target.getPackageMakerUtility();
-        }
 
         // Verifying the hdiutil utility exists
         if ( !hdiutilUtility.exists() )
         {
-            log.warn( "Cannot find hdiutil utility at this location: " + hdiutilUtility );
-            log.warn( "The build will continue, but please check the location of your hdiutil " );
-            log.warn( "utility." );
+            log.warn( "Cannot find 'hdiutil' utility at this location: " + hdiutilUtility );
+            log.warn( "The build will continue, but please check the location of your 'hdiutil' utility." );
             return;
         }
 
-        File baseDirectory = target.getLayout().getInstallationDirectory();
-        File imagesDirectory = baseDirectory.getParentFile();
-
         log.info( "Creating Mac OS X PKG Installer..." );
 
-        // Creating the package directory
-        File pkgDirectory = new File( imagesDirectory, target.getId() + "-pkg" );
-        pkgDirectory.mkdirs();
+        // Creating the target directory
+        File targetDirectory = getTargetDirectory();
+        targetDirectory.mkdirs();
 
         log.info( "Copying PKG installer files" );
 
         // Creating the root directories hierarchy
-        File pkgRootDirectory = new File( pkgDirectory, "root" );
+        File pkgRootDirectory = new File( targetDirectory, "root" );
         pkgRootDirectory.mkdirs();
         File pkgRootUsrBinDirectory = new File( pkgRootDirectory, "usr/bin" );
         pkgRootUsrBinDirectory.mkdirs();
@@ -127,8 +119,6 @@ public class MacOsXPkgInstallerCommand e
         pkgRootInstancesDefaultDirectory.mkdirs();
         File pkgRootInstancesDefaultConfDirectory = new File( pkgRootInstancesDefaultDirectory, "conf" );
         pkgRootInstancesDefaultConfDirectory.mkdirs();
-        File pkgRootInstancesDefaultLdifDirectory = new File( pkgRootInstancesDefaultDirectory, "ldif" );
-        pkgRootInstancesDefaultLdifDirectory.mkdirs();
         new File( pkgRootInstancesDefaultDirectory, "log" ).mkdirs();
         new File( pkgRootInstancesDefaultDirectory, "partitions" ).mkdirs();
         new File( pkgRootInstancesDefaultDirectory, "run" ).mkdirs();
@@ -138,29 +128,29 @@ public class MacOsXPkgInstallerCommand e
         // Copying the apacheds files in the root directory
         try
         {
-            // Copying the generated layout
-            MojoHelperUtils.copyFiles( baseDirectory, pkgRootUsrLocalApachedsDirectory );
+            // Creating the installation layout and copying files to it
+            copyCommonFiles( mojo );
 
-            // Copying the apacheds.init file
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.init" ),
-                new File( pkgRootUsrLocalApachedsDirectory, "bin/apacheds.init" ),
-                true );
-
-            // Replacing the apacheds.conf file
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.conf" ),
-                new File( pkgRootUsrLocalApachedsDirectory, "conf/apacheds.conf" ), true );
-
-            // Copying the apacheds.conf file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
-                "apacheds-default.conf" ), new File( pkgRootInstancesDefaultConfDirectory, "apacheds.conf" ), false );
+            //            // Copying the apacheds.init file
+            //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.init" ),
+            //                new File( pkgRootUsrLocalApachedsDirectory, "bin/apacheds.init" ),
+            //                true );
+            //
+            //            // Replacing the apacheds.conf file
+            //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "apacheds.conf" ),
+            //                new File( pkgRootUsrLocalApachedsDirectory, "conf/apacheds.conf" ), true );
+
+            //            // Copying the apacheds.conf file in the default instance conf directory
+            //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
+            //                "apacheds-default.conf" ), new File( pkgRootInstancesDefaultConfDirectory, "apacheds.conf" ), false );
 
             // Copying the log4j.properties file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( pkgRootUsrLocalApachedsDirectory,
-                "conf/log4j.properties" ), new File( pkgRootInstancesDefaultConfDirectory, "log4j.properties" ), false );
+            //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( pkgRootUsrLocalApachedsDirectory,
+            //                "conf/log4j.properties" ), new File( pkgRootInstancesDefaultConfDirectory, "log4j.properties" ), false );
 
-            // Copying the server.xml file in the default instance conf directory
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( pkgRootUsrLocalApachedsDirectory,
-                "conf/server.xml" ), new File( pkgRootInstancesDefaultConfDirectory, "server.xml" ), false );
+            //            // Copying the server.xml file in the default instance conf directory
+            //            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, new File( pkgRootUsrLocalApachedsDirectory,
+            //                "conf/server.xml" ), new File( pkgRootInstancesDefaultConfDirectory, "server.xml" ), false );
 
             // Copying the apacheds command to /usr/bin
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
@@ -171,22 +161,26 @@ public class MacOsXPkgInstallerCommand e
                 "org.apache.directory.server.plist" ), new File( pkgRootLibraryLaunchDaemons,
                 "org.apache.directory.server.plist" ), true );
 
-            // Removing the redundant server.xml file (see DIRSERVER-1112)
-            new File( pkgRootUsrLocalApachedsDirectory, "conf/server.xml" ).delete();
+            //            // Removing the redundant server.xml file (see DIRSERVER-1112)
+            //            new File( pkgRootUsrLocalApachedsDirectory, "conf/server.xml" ).delete();
         }
         catch ( IOException e )
         {
             log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallationDirectory()
-                + ") to the PKG directory (" + pkgRootDirectory + ")" );
+            throw new MojoFailureException( "Failed to copy image () to the PKG directory (" + pkgRootDirectory + ")" );
+        }
+        catch ( Exception e )
+        {
+            log.error( e.getMessage() );
+            throw new MojoFailureException( "Failed to copy image () to the PKG directory (" + pkgRootDirectory + ")" );
         }
 
         // Create Resources folder and sub-folder
         // Copying the resources files and Info.plist file needed for the 
         // generation of the PKG
-        File pkgResourcesEnglishDirectory = new File( pkgDirectory, "Resources/en.lproj" );
+        File pkgResourcesEnglishDirectory = new File( targetDirectory, "Resources/en.lproj" );
         pkgResourcesEnglishDirectory.mkdirs();
-        File pkgScriptsDirectory = new File( pkgDirectory, "scripts" );
+        File pkgScriptsDirectory = new File( targetDirectory, "scripts" );
         pkgScriptsDirectory.mkdirs();
 
         try
@@ -197,7 +191,7 @@ public class MacOsXPkgInstallerCommand e
             MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "License.rtf" ), new File(
                 pkgResourcesEnglishDirectory, "License.rtf" ) );
 
-            MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "Info.plist" ), new File( pkgDirectory,
+            MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "Info.plist" ), new File( targetDirectory,
                 "Info.plist" ) );
 
             MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "postflight" ), new File(
@@ -213,13 +207,25 @@ public class MacOsXPkgInstallerCommand e
         log.info( "Generating Mac OS X PKG Installer" );
         Execute createPkgTask = new Execute();
         String[] cmd = new String[]
-            { packageMakerUtility.getAbsolutePath(), "--root", "root/", "--resources", "Resources/", "--info",
-                "Info.plist", "--title", "Apache Directory Server " + mojo.getProject().getVersion(),
-                "--version", mojo.getProject().getVersion(), "--scripts", "scripts", "--out",
+            {
+                target.getPackageMakerUtility().getAbsolutePath(),
+                "--root",
+                "root/",
+                "--resources",
+                "Resources/",
+                "--info",
+                "Info.plist",
+                "--title",
+                "Apache Directory Server " + mojo.getProject().getVersion(),
+                "--version",
+                mojo.getProject().getVersion(),
+                "--scripts",
+                "scripts",
+                "--out",
                 "Apache Directory Server Installer.pkg" };
         createPkgTask.setCommandline( cmd );
         createPkgTask.setSpawn( true ); // TODO should we remove this?
-        createPkgTask.setWorkingDirectory( pkgDirectory );
+        createPkgTask.setWorkingDirectory( targetDirectory );
         try
         {
             createPkgTask.execute();
@@ -231,12 +237,12 @@ public class MacOsXPkgInstallerCommand e
         }
 
         log.info( "Mac OS X PKG Installer generated at "
-            + new File( pkgDirectory, "Apache Directory Server Installer.pkg" ) );
+            + new File( targetDirectory, "Apache Directory Server Installer.pkg" ) );
 
         log.info( "Creating Mac OS X DMG..." );
 
         // Creating the disc image directory
-        File dmgDirectory = new File( imagesDirectory, target.getId() + "-dmg" );
+        File dmgDirectory = new File( mojo.getOutputDirectory(), target.getId() + "-dmg" );
         dmgDirectory.mkdirs();
 
         log.info( "Copying DMG files" );
@@ -254,7 +260,7 @@ public class MacOsXPkgInstallerCommand e
             MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "DS_Store" ), new File( dmgDirectory,
                 "dmg/.DS_Store" ) );
 
-            MojoHelperUtils.copyFiles( new File( pkgDirectory, "Apache Directory Server Installer.pkg" ), new File(
+            MojoHelperUtils.copyFiles( new File( targetDirectory, "Apache Directory Server Installer.pkg" ), new File(
                 dmgDirectory, "dmg/Apache Directory Server Installer.pkg" ) );
 
         }
@@ -285,14 +291,22 @@ public class MacOsXPkgInstallerCommand e
         {
             Execute createDmgTask = new Execute();
             createDmgTask.setCommandline( new String[]
-                { hdiutilUtility.getAbsolutePath(), "makehybrid", "-hfs", "-hfs-volume-name",
+                { hdiutilUtility.getAbsolutePath(), "makehybrid", "-quiet", "-hfs", "-hfs-volume-name",
                     "Apache Directory Server Installer", "-hfs-openfolder", "dmg/", "dmg/", "-o", "TMP.dmg" } );
             createDmgTask.setSpawn( true );
             createDmgTask.setWorkingDirectory( dmgDirectory );
             createDmgTask.execute();
 
             createDmgTask.setCommandline( new String[]
-                { hdiutilUtility.getAbsolutePath(), "convert", "-format", "UDZO", "TMP.dmg", "-o", "../" + finalName } );
+                {
+                    hdiutilUtility.getAbsolutePath(),
+                    "convert",
+                    "-quiet",
+                    "-format",
+                    "UDZO",
+                    "TMP.dmg",
+                    "-o",
+                    "../" + finalName } );
             createDmgTask.execute();
 
         }
@@ -302,7 +316,7 @@ public class MacOsXPkgInstallerCommand e
             throw new MojoFailureException( "Failed while trying to generate the DMG: " + e.getMessage() );
         }
 
-        log.info( "Mac OS X DMG generated at " + new File( imagesDirectory, finalName ) );
+        log.info( "Mac OS X DMG generated at " + new File( mojo.getOutputDirectory(), finalName ) );
     }
 
 
@@ -317,6 +331,12 @@ public class MacOsXPkgInstallerCommand e
         {
             filterProperties.put( "app.version", "1.0" );
         }
+
+        filterProperties.put( "installation.directory", "/usr/local/apacheds-"
+            + mojo.getProject().getVersion() );
+        filterProperties.put( "instances.directory", "/usr/local/apacheds-"
+            + mojo.getProject().getVersion() + "/instances" );
+        filterProperties.put( "user", "root" );
     }
 
 
@@ -327,4 +347,202 @@ public class MacOsXPkgInstallerCommand e
     {
         return filterProperties;
     }
+
+
+    public File getInstallationDirectory()
+    {
+        return new File( getTargetDirectory(), "root/usr/local/apacheds-"
+            + mojo.getProject().getVersion() );
+    }
+
+
+    public File getInstanceDirectory()
+    {
+        return new File( getInstallationDirectory(), "instances/default" );
+    }
+
+
+    /**
+     * Creates installation layout and copies files to it.
+     *
+     * @param mojo
+     *      the mojo
+     * @throws Exception
+     */
+    public void copyCommonFiles( GenerateMojo mojo ) throws Exception
+    {
+        // Creating the installation layout and directories
+        InstallationLayout installationLayout = new InstallationLayout( getInstallationDirectory() );
+        installationLayout.mkdirs();
+
+        // Creating the instance layout and directories
+        InstanceLayout instanceLayout = new InstanceLayout( getInstanceDirectory() );
+        instanceLayout.mkdirs();
+        
+        MojoHelperUtils.copyDependencies( mojo, installationLayout );
+
+        // Copying the LICENSE and NOTICE files
+        MojoHelperUtils.copyBinaryFile(
+                getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/LICENSE" ),
+                new File( installationLayout.getInstallationDirectory(), "LICENSE" ) );
+        MojoHelperUtils.copyBinaryFile(
+                getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/NOTICE" ),
+                new File( installationLayout.getInstallationDirectory(),
+                    "NOTICE" ) );
+
+        // Copying wrapper files
+        copyWrapperFiles( installationLayout, instanceLayout );
+
+        // Copying the log4j.properties file
+        MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
+            getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/log4j.properties" ),
+            new File( instanceLayout.getConfDirectory(), "log4j.properties" ), true );
+
+        // Copying the 'apacheds' script
+        MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
+            getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/apacheds.init" ),
+            new File( installationLayout.getBinDirectory(), "apacheds" ), true );
+    }
+
+
+    /**
+     * Copies wrapper files to the installation layout.
+     *
+     * @param installationLayout
+     *      the installation layout
+     * @param instanceLayout
+     * @throws MojoFailureException
+     */
+    private void copyWrapperFiles( InstallationLayout installationLayout, InstanceLayout instanceLayout )
+        throws MojoFailureException
+    {
+        // Mac OS X
+        if ( target.isOsNameMacOSX() )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-macosx-universal-32" ), new File(
+                        installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/libwrapper-macosx-universal-32.jnilib" ),
+                    new File( installationLayout.getLibDirectory(),
+                        "libwrapper.jnilib" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Linux i386 & x86
+        if ( target.isOsNameLinux() && ( target.isOsArchI386() || target.isOsArchx86() ) )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile(
+                    getClass().getResourceAsStream(
+                        "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-linux-x86-32" ),
+                    new File( installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/libwrapper-linux-x86-32.so" ),
+                    new File( installationLayout.getLibDirectory(), "libwrapper.so" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Linux x86_64 & amd64
+        if ( target.isOsNameLinux() && ( target.isOsArchX86_64() || target.isOsArchAmd64() ) )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile(
+                    getClass().getResourceAsStream(
+                        "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-linux-x86-64" ),
+                    new File( installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/libwrapper-linux-x86-64.so" ),
+                    new File( installationLayout.getLibDirectory(), "libwrapper.so" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Solaris x86
+        if ( target.isOsNameSolaris() && target.isOsArchx86() )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-solaris-x86-32" ),
+                    new File( installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/libwrapper-solaris-x86-32.so" ), new File(
+                        installationLayout.getLibDirectory(),
+                    "libwrapper.so" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Solaris Sparc
+        if ( target.isOsNameSolaris() && target.isOsArchSparc() )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-solaris-sparc-32" ),
+                    new File( installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/libwrapper-solaris-sparc-32.so" ), new File(
+                        installationLayout.getLibDirectory(),
+                    "libwrapper.so" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Windows
+        if ( target.isOsNameWindows() )
+        {
+            try
+            {
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/bin/wrapper-windows-x86-32.exe" ),
+                    new File( installationLayout.getBinDirectory(), "wrapper" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
+                    "/org/apache/directory/daemon/installers/wrapper/lib/wrapper-windows-x86-32.dll" ), new File(
+                        installationLayout.getLibDirectory(),
+                    "libwrapper.so" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+            }
+        }
+
+        // Wrapper configuration files
+        try
+        {
+            MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
+                getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/wrapper-installation.conf" ),
+                new File( installationLayout.getConfDirectory(), "wrapper.conf" ), true );
+            MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
+                getClass().getResourceAsStream( "/org/apache/directory/daemon/installers/wrapper-instance.conf" ),
+                new File( instanceLayout.getConfDirectory(), "wrapper.conf" ), true );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
+        }
+    }
 }

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgTarget.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgTarget.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgTarget.java Wed Sep 22 15:07:26 2010
@@ -47,6 +47,16 @@ public class MacOsXPkgTarget extends Tar
 
 
     /**
+     * Creates a new instance of MacOsXPkgTarget.
+     */
+    public MacOsXPkgTarget()
+    {
+        setOsName( Target.OS_NAME_MAC_OS_X );
+        setOsArch( Target.OS_ARCH_X86_64 );
+    }
+
+
+    /**
      * Gets the PackageMaker utility.
      *
      * @return

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java Wed Sep 22 15:07:26 2010
@@ -46,7 +46,7 @@ import org.codehaus.plexus.util.FileUtil
 public class NsisInstallerCommand extends AbstractMojoCommand<NsisTarget>
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final File nsisConfigurationFile;
+    private final File nsisConfigurationFile = new File( "" ); // TODO FIXME
 
     private File nsisCompiler;
 
@@ -54,8 +54,9 @@ public class NsisInstallerCommand extend
     public NsisInstallerCommand( GenerateMojo mojo, NsisTarget target )
     {
         super( mojo, target );
-        File imagesDir = target.getLayout().getInstallationDirectory().getParentFile();
-        nsisConfigurationFile = new File( imagesDir, target.getId() + ".nsi" );
+        // TODO FIXME
+        //        File imagesDir = target.getLayout().getInstallationDirectory().getParentFile();
+        //        nsisConfigurationFile = new File( imagesDir, target.getId() + ".nsi" );
         initializeFiltering();
     }
 
@@ -82,13 +83,14 @@ public class NsisInstallerCommand extend
         // Step 1 & 4: do some error checking first for compiler and OS
         // -------------------------------------------------------------------
 
-        if ( !target.getOsFamily().equals( "windows" ) )
-        {
-            log.warn( "NSIS installer can only be targeted for windows platforms!" );
-            log.warn( "The build will continue, but please check the the platform" );
-            log.warn( "of this installer target" );
-            return;
-        }
+        // TODO FIXME
+        //        if ( !target.getOsFamily().equals( "windows" ) )
+        //        {
+        //            log.warn( "NSIS installer can only be targeted for windows platforms!" );
+        //            log.warn( "The build will continue, but please check the the platform" );
+        //            log.warn( "of this installer target" );
+        //            return;
+        //        }
 
         // @todo this should really be a parameter taken from the user's settings
         // because the compiler may be installed in different places and is specific
@@ -153,72 +155,73 @@ public class NsisInstallerCommand extend
         // 3: copy native files
         // -------------------------------------------------------------------
 
-        // now copy over the Prunsrv and Prunmgr executables renaming them to the mojo.getApplicationName() + w for mgr
-        if ( target.getOsFamily().equals( "windows" ) )
-        {
-            File executableTarget = new File( target.getLayout().getBinDirectory(), "apacheds.exe" );
-            File override = new File( mojo.getSourceDirectory(), target.getWrapperExecutablePath() );
-            if ( override.exists() )
-            {
-                mojo.getLog().info( "Using native launcher supplied by project: " + override.getAbsolutePath() );
-                try
-                {
-                    FileUtils.copyFile( override, executableTarget );
-                }
-                catch ( IOException e )
-                {
-                    throw new MojoFailureException(
-                        "Failed to copy project supplied native launcher executable override "
-                            + override.getAbsolutePath() + " into position " + executableTarget.getAbsolutePath() );
-                }
-            }
-            else
-            {
-                try
-                {
-                    MojoHelperUtils
-                        .copyBinaryFile( getClass().getResourceAsStream( "../wrapper/bin/wrapper-windows-x86-32.exe" ),
-                            executableTarget );
-                    MojoHelperUtils.copyBinaryFile(
-                        getClass().getResourceAsStream( "../wrapper/lib/wrapper-windows-x86-32.dll" ),
-                            new File( target.getLayout().getLibDirectory(), "wrapper.dll" )
-                        );
-                }
-                catch ( IOException e )
-                {
-                    throw new MojoFailureException( "Failed to copy native launcher executable file "
-                        + getClass().getResource( "../wrapper/bin/wrapper-windows-x86-32.exe" ) + " into position "
-                        + executableTarget.getAbsolutePath() );
-                }
-            }
-
-        }
-
-        processPackagedFiles( target, target.getPackagedFiles() );
-
-        Execute task = new Execute();
-        System.out.println( "nsisCompiler = " + nsisCompiler );
-        System.out.println( "nsisConfigurationFile = " + nsisConfigurationFile );
-        String[] cmd = new String[]
-            { nsisCompiler.getAbsolutePath(), nsisConfigurationFile.getAbsolutePath() };
-        task.setCommandline( cmd );
-        task.setSpawn( true );
-        task.setWorkingDirectory( target.getLayout().getInstallationDirectory() );
-        try
-        {
-            task.execute();
-        }
-        catch ( IOException e )
-        {
-            throw new MojoFailureException( "Failed while trying to execute " + nsisCompiler.getAbsolutePath() + ": "
-                + e.getMessage() );
-        }
-
-        if ( task.getExitValue() != 0 )
-        {
-            throw new MojoFailureException( nsisCompiler.getAbsolutePath()
-                + " execution resulted in a non-zero exit value: " + task.getExitValue() );
-        }
+        // TODO FIXME
+        //        // now copy over the Prunsrv and Prunmgr executables renaming them to the mojo.getApplicationName() + w for mgr
+        //        if ( target.getOsFamily().equals( "windows" ) )
+        //        {
+        //            File executableTarget = new File( target.getLayout().getBinDirectory(), "apacheds.exe" );
+        //            File override = new File( mojo.getSourceDirectory(), target.getWrapperExecutablePath() );
+        //            if ( override.exists() )
+        //            {
+        //                mojo.getLog().info( "Using native launcher supplied by project: " + override.getAbsolutePath() );
+        //                try
+        //                {
+        //                    FileUtils.copyFile( override, executableTarget );
+        //                }
+        //                catch ( IOException e )
+        //                {
+        //                    throw new MojoFailureException(
+        //                        "Failed to copy project supplied native launcher executable override "
+        //                            + override.getAbsolutePath() + " into position " + executableTarget.getAbsolutePath() );
+        //                }
+        //            }
+        //            else
+        //            {
+        //                try
+        //                {
+        //                    MojoHelperUtils
+        //                        .copyBinaryFile( getClass().getResourceAsStream( "../wrapper/bin/wrapper-windows-x86-32.exe" ),
+        //                            executableTarget );
+        //                    MojoHelperUtils.copyBinaryFile(
+        //                        getClass().getResourceAsStream( "../wrapper/lib/wrapper-windows-x86-32.dll" ),
+        //                            new File( target.getLayout().getLibDirectory(), "wrapper.dll" )
+        //                        );
+        //                }
+        //                catch ( IOException e )
+        //                {
+        //                    throw new MojoFailureException( "Failed to copy native launcher executable file "
+        //                        + getClass().getResource( "../wrapper/bin/wrapper-windows-x86-32.exe" ) + " into position "
+        //                        + executableTarget.getAbsolutePath() );
+        //                }
+        //            }
+        //
+        //        }
+        //
+        //        processPackagedFiles( target, target.getPackagedFiles() );
+        //
+        //        Execute task = new Execute();
+        //        System.out.println( "nsisCompiler = " + nsisCompiler );
+        //        System.out.println( "nsisConfigurationFile = " + nsisConfigurationFile );
+        //        String[] cmd = new String[]
+        //            { nsisCompiler.getAbsolutePath(), nsisConfigurationFile.getAbsolutePath() };
+        //        task.setCommandline( cmd );
+        //        task.setSpawn( true );
+        //        task.setWorkingDirectory( target.getLayout().getInstallationDirectory() );
+        //        try
+        //        {
+        //            task.execute();
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            throw new MojoFailureException( "Failed while trying to execute " + nsisCompiler.getAbsolutePath() + ": "
+        //                + e.getMessage() );
+        //        }
+        //
+        //        if ( task.getExitValue() != 0 )
+        //        {
+        //            throw new MojoFailureException( nsisCompiler.getAbsolutePath()
+        //                + " execution resulted in a non-zero exit value: " + task.getExitValue() );
+        //        }
     }
 
 
@@ -253,14 +256,15 @@ public class NsisInstallerCommand extend
             filterProperties.put( "app.final.name", finalName );
         }
 
+        // TODO FIXME
         //        filterProperties.put( "app.email", target.getApplication().getEmail() );
         //        filterProperties.put( "app.url", target.getApplication().getUrl() );
-        filterProperties.put( "app.java.version", "1.5" );
-        filterProperties.put( "app.license", target.getLayout().getLicenseFile().getPath() );
-        filterProperties.put( "app.license.name", target.getLayout().getLicenseFile().getName() );
-        filterProperties.put( "app.company.name", target.getCompanyName() );
+//        filterProperties.put( "app.java.version", "1.5" );
+//        filterProperties.put( "app.license", target.getLayout().getLicenseFile().getPath() );
+//        filterProperties.put( "app.license.name", target.getLayout().getLicenseFile().getName() );
+//        filterProperties.put( "app.company.name", target.getCompanyName() );
         //        filterProperties.put( "app.description", target.getApplication().getDescription() );
-        filterProperties.put( "app.copyright.year", target.getCopyrightYear() );
+//        filterProperties.put( "app.copyright.year", target.getCopyrightYear() );
 
         // TODO FIXME
         //        if ( !target.getLayout().getReadmeFile().exists() )
@@ -275,16 +279,17 @@ public class NsisInstallerCommand extend
         //        filterProperties.put( "app.lib.jars", getApplicationLibraryJars() );
         //        filterProperties.put( "installer.output.directory", target.getLayout().getBaseDirectory().getParent() );
 
-        File noticeFile = new File( target.getLayout().getInstallationDirectory(), "NOTICE.txt" );
-        if ( noticeFile.exists() )
-        {
-            filterProperties.put( "notice.file", "Source: {#SourceBase}\\NOTICE.txt; DestDir: "
-                + "{app}\\; Flags: ignoreversion recursesubdirs createallsubdirs" );
-        }
-        else
-        {
-            filterProperties.put( "notice.file", "" );
-        }
+        // TODO FIXME
+        //        File noticeFile = new File( target.getLayout().getInstallationDirectory(), "NOTICE.txt" );
+        //        if ( noticeFile.exists() )
+        //        {
+        //            filterProperties.put( "notice.file", "Source: {#SourceBase}\\NOTICE.txt; DestDir: "
+        //                + "{app}\\; Flags: ignoreversion recursesubdirs createallsubdirs" );
+        //        }
+        //        else
+        //        {
+        //            filterProperties.put( "notice.file", "" );
+        //        }
     }
 
 

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisTarget.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisTarget.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisTarget.java Wed Sep 22 15:07:26 2010
@@ -19,11 +19,13 @@
  */
 package org.apache.directory.daemon.installers.nsis;
 
+
 import org.apache.directory.daemon.installers.Target;
 
 import java.io.File;
 import java.util.Calendar;
 
+
 /**
  * A Nullsoft Installer System (NSIS) installer for the Windows platform
  *
@@ -40,11 +42,10 @@ public class NsisTarget extends Target
     {
         Calendar cal = Calendar.getInstance();
         cal.setTimeInMillis( System.currentTimeMillis() );
-        setCopyrightYear( String.valueOf( cal.get( Calendar.YEAR ) ) );
     }
 
 
-    public void setNsisCompiler( File nsisCompiler)
+    public void setNsisCompiler( File nsisCompiler )
     {
         this.nsisCompiler = nsisCompiler;
     }
@@ -68,7 +69,7 @@ public class NsisTarget extends Target
     }
 
 
-    public void setWrapperExecutablePath( String wrapperExecutablePath)
+    public void setWrapperExecutablePath( String wrapperExecutablePath )
     {
         this.wrapperExecutablePath = wrapperExecutablePath;
     }
@@ -79,5 +80,4 @@ public class NsisTarget extends Target
         return wrapperExecutablePath;
     }
 
-
 }

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java?rev=1000024&r1=1000023&r2=1000024&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java (original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java Wed Sep 22 15:07:26 2010
@@ -48,15 +48,16 @@ import org.codehaus.plexus.util.Os;
 public class RpmInstallerCommand extends AbstractMojoCommand<RpmTarget>
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
-    private final File rpmConfigurationFile;
+    private final File rpmConfigurationFile = new File( "" ); // TODO FIXME
     private File rpmBuilder;
 
 
     public RpmInstallerCommand( GenerateMojo mojo, RpmTarget target )
     {
         super( mojo, target );
-        File imagesDir = target.getLayout().getInstallationDirectory().getParentFile();
-        rpmConfigurationFile = new File( imagesDir, target.getId() + ".spec" );
+        // TODO FIXME
+        //        File imagesDir = target.getLayout().getInstallationDirectory().getParentFile();
+        //        rpmConfigurationFile = new File( imagesDir, target.getId() + ".spec" );
         initializeFiltering();
     }
 
@@ -83,13 +84,14 @@ public class RpmInstallerCommand extends
         // Step 1 & 4: do some error checking first for builder and OS
         // -------------------------------------------------------------------
 
-        if ( !target.getOsFamily().equals( "unix" ) || !target.getOsName().equalsIgnoreCase( "Linux" ) )
-        {
-            log.warn( "RPM target " + target.getId() + " cannot be built for an non-linux based machine!" );
-            log.warn( "The target will not be built." );
-            log.warn( "The rest of the build will not fail because of this acceptable situation." );
-            return;
-        }
+        // TODO FIXME
+        //        if ( !target.getOsFamily().equals( "unix" ) || !target.getOsName().equalsIgnoreCase( "Linux" ) )
+        //        {
+        //            log.warn( "RPM target " + target.getId() + " cannot be built for an non-linux based machine!" );
+        //            log.warn( "The target will not be built." );
+        //            log.warn( "The rest of the build will not fail because of this acceptable situation." );
+        //            return;
+        //        }
 
         if ( !Os.isName( "linux" ) )
         {
@@ -222,46 +224,47 @@ public class RpmInstallerCommand extends
             }
         }
 
-        processPackagedFiles( target, target.getPackagedFiles() );
-
-        buildSourceTarball();
-        String[] cmd = new String[]
-            {
-                rpmBuilder.getAbsolutePath(),
-                "-ba",
-                "--define",
-                "_topdir " + target.getRpmTopDir().getAbsolutePath(),
-                rpmConfigurationFile.getAbsolutePath() };
-        MojoHelperUtils.exec( cmd, target.getLayout().getInstallationDirectory().getParentFile(), target.isDoSudo() );
-        String rpmName = "apacheds-" + version + "-0." + target.getOsArch() + ".rpm";
-        File srcFile = new File( target.getRpmTopDir(), "RPMS/" + target.getOsArch() + "/" + rpmName );
-        File dstFile = null;
-
-        if ( target.getFinalName() == null )
-        {
-            dstFile = new File( mojo.getOutputDirectory(), rpmName );
-        }
-        else
-        {
-            String finalName = target.getFinalName();
-            if ( !finalName.endsWith( ".rpm" ) )
-            {
-                finalName = finalName + ".rpm";
-            }
-
-            dstFile = new File( mojo.getOutputDirectory(), finalName );
-        }
-
-        try
-        {
-            FileUtils.copyFile( srcFile, dstFile );
-            srcFile.delete();
-        }
-        catch ( IOException e )
-        {
-            // if this happens we don't stop since RPM could be somewhere else
-            e.printStackTrace();
-        }
+        // TODO FIXME
+        //        processPackagedFiles( target, target.getPackagedFiles() );
+        //
+        //        buildSourceTarball();
+        //        String[] cmd = new String[]
+        //            {
+        //                rpmBuilder.getAbsolutePath(),
+        //                "-ba",
+        //                "--define",
+        //                "_topdir " + target.getRpmTopDir().getAbsolutePath(),
+        //                rpmConfigurationFile.getAbsolutePath() };
+        //        MojoHelperUtils.exec( cmd, target.getLayout().getInstallationDirectory().getParentFile(), target.isDoSudo() );
+        //        String rpmName = "apacheds-" + version + "-0." + target.getOsArch() + ".rpm";
+        //        File srcFile = new File( target.getRpmTopDir(), "RPMS/" + target.getOsArch() + "/" + rpmName );
+        //        File dstFile = null;
+        //
+        //        if ( target.getFinalName() == null )
+        //        {
+        //            dstFile = new File( mojo.getOutputDirectory(), rpmName );
+        //        }
+        //        else
+        //        {
+        //            String finalName = target.getFinalName();
+        //            if ( !finalName.endsWith( ".rpm" ) )
+        //            {
+        //                finalName = finalName + ".rpm";
+        //            }
+        //
+        //            dstFile = new File( mojo.getOutputDirectory(), finalName );
+        //        }
+        //
+        //        try
+        //        {
+        //            FileUtils.copyFile( srcFile, dstFile );
+        //            srcFile.delete();
+        //        }
+        //        catch ( IOException e )
+        //        {
+        //            // if this happens we don't stop since RPM could be somewhere else
+        //            e.printStackTrace();
+        //        }
     }
 
 
@@ -359,23 +362,24 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < srcList.size(); ii++ )
-        {
-            File file = ( File ) srcList.get( ii );
-            if ( file.isFile() )
-            {
-                continue;
-            }
-
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < srcList.size(); ii++ )
+        //        {
+        //            File file = ( File ) srcList.get( ii );
+        //            if ( file.isFile() )
+        //            {
+        //                continue;
+        //            }
+        //
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
@@ -384,23 +388,24 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < docList.size(); ii++ )
-        {
-            File file = ( File ) docList.get( ii );
-            if ( file.isFile() )
-            {
-                continue;
-            }
-
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < docList.size(); ii++ )
+        //        {
+        //            File file = ( File ) docList.get( ii );
+        //            if ( file.isFile() )
+        //            {
+        //                continue;
+        //            }
+        //
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
@@ -431,26 +436,27 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < docList.size(); ii++ )
-        {
-            File file = ( File ) docList.get( ii );
-            if ( file.isDirectory() )
-            {
-                continue;
-            }
-
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "install -m 644 " );
-            buf.append( target.getLayout().getInstallationDirectory() ).append( "/" );
-            buf.append( path );
-            buf.append( " $RPM_BUILD_ROOT/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < docList.size(); ii++ )
+        //        {
+        //            File file = ( File ) docList.get( ii );
+        //            if ( file.isDirectory() )
+        //            {
+        //                continue;
+        //            }
+        //
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( "install -m 644 " );
+        //            buf.append( target.getLayout().getInstallationDirectory() ).append( "/" );
+        //            buf.append( path );
+        //            buf.append( " $RPM_BUILD_ROOT/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
@@ -459,18 +465,19 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < docList.size(); ii++ )
-        {
-            File file = ( File ) docList.get( ii );
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( target.getLayout().getInstallationDirectory() );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < docList.size(); ii++ )
+        //        {
+        //            File file = ( File ) docList.get( ii );
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( target.getLayout().getInstallationDirectory() );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
@@ -479,26 +486,27 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < sourceList.size(); ii++ )
-        {
-            File file = ( File ) sourceList.get( ii );
-            if ( file.isDirectory() )
-            {
-                continue;
-            }
-
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "install -m 644 " );
-            buf.append( target.getLayout().getInstallationDirectory() ).append( "/" );
-            buf.append( path );
-            buf.append( " $RPM_BUILD_ROOT/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < sourceList.size(); ii++ )
+        //        {
+        //            File file = ( File ) sourceList.get( ii );
+        //            if ( file.isDirectory() )
+        //            {
+        //                continue;
+        //            }
+        //
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( "install -m 644 " );
+        //            buf.append( target.getLayout().getInstallationDirectory() ).append( "/" );
+        //            buf.append( path );
+        //            buf.append( " $RPM_BUILD_ROOT/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
@@ -507,35 +515,37 @@ public class RpmInstallerCommand extends
     {
         StringBuffer buf = new StringBuffer();
         // +1 for '/' char 
-        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
-
-        for ( int ii = 0; ii < sourceList.size(); ii++ )
-        {
-            File file = ( File ) sourceList.get( ii );
-            String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/" );
-            buf.append( path );
-            buf.append( "\n" );
-        }
+        //        // TODO FIXME
+        //        int basePathSize = target.getLayout().getInstallationDirectory().getAbsolutePath().length() + 1;
+        //
+        //        for ( int ii = 0; ii < sourceList.size(); ii++ )
+        //        {
+        //            File file = ( File ) sourceList.get( ii );
+        //            String path = file.getAbsolutePath().substring( basePathSize );
+        //            buf.append( "/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/" );
+        //            buf.append( path );
+        //            buf.append( "\n" );
+        //        }
         return buf.toString();
     }
 
 
     private Object getVerifyLibraryJars()
     {
+        // TODO FIXME
         StringBuffer buf = new StringBuffer();
-        List artifacts = target.getLibArtifacts();
-        for ( int ii = 0; ii < artifacts.size(); ii++ )
-        {
-            File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
-            buf.append( "/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/lib/" );
-            buf.append( artifact.getName() );
-            buf.append( "\n" );
-        }
+        //        List artifacts = target.getLibArtifacts();
+        //        for ( int ii = 0; ii < artifacts.size(); ii++ )
+        //        {
+        //            File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
+        //            buf.append( "/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/lib/" );
+        //            buf.append( artifact.getName() );
+        //            buf.append( "\n" );
+        //        }
 
         return buf.toString();
     }
@@ -543,19 +553,20 @@ public class RpmInstallerCommand extends
 
     private String getInstallLibraryJars()
     {
+        // TODO FIXME
         StringBuffer buf = new StringBuffer();
-        List artifacts = target.getLibArtifacts();
-        for ( int ii = 0; ii < artifacts.size(); ii++ )
-        {
-            buf.append( "install -m 644 " );
-            File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
-            buf.append( artifact.getAbsoluteFile() );
-            buf.append( " $RPM_BUILD_ROOT/opt/" );
-            buf.append( "apacheds" );
-            buf.append( "-%{version}/lib/" );
-            buf.append( artifact.getName() );
-            buf.append( "\n" );
-        }
+        //        List artifacts = target.getLibArtifacts();
+        //        for ( int ii = 0; ii < artifacts.size(); ii++ )
+        //        {
+        //            buf.append( "install -m 644 " );
+        //            File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
+        //            buf.append( artifact.getAbsoluteFile() );
+        //            buf.append( " $RPM_BUILD_ROOT/opt/" );
+        //            buf.append( "apacheds" );
+        //            buf.append( "-%{version}/lib/" );
+        //            buf.append( artifact.getName() );
+        //            buf.append( "\n" );
+        //        }
 
         return buf.toString();
     }
@@ -572,26 +583,27 @@ public class RpmInstallerCommand extends
 
     private void buildSourceTarball() throws MojoFailureException
     {
-        String version = mojo.getProject().getVersion().replace( '-', '_' );
-        String dirname = "apacheds-" + version;
-        File sourcesDir = new File( target.getLayout().getInstallationDirectory().getParentFile(), dirname );
-        try
-        {
-            FileUtils.copyDirectoryStructure( target.getLayout().getInstallationDirectory(), sourcesDir );
-        }
-        catch ( IOException e1 )
-        {
-            throw new MojoFailureException( "failed to copy directory structure at " + target.getLayout() + " to "
-                + sourcesDir );
-        }
-
-        String[] cmd = new String[]
-            {
-                "tar",
-                "-zcvf",
-                target.getRpmTopDir().getAbsolutePath() + "/SOURCES/apacheds-" + version + ".tar.gz",
-                sourcesDir.getAbsolutePath() };
-
-        MojoHelperUtils.exec( cmd, target.getLayout().getInstallationDirectory().getParentFile(), target.isDoSudo() );
+        // TODO FIXME
+        //        String version = mojo.getProject().getVersion().replace( '-', '_' );
+        //        String dirname = "apacheds-" + version;
+        //        File sourcesDir = new File( target.getLayout().getInstallationDirectory().getParentFile(), dirname );
+        //        try
+        //        {
+        //            FileUtils.copyDirectoryStructure( target.getLayout().getInstallationDirectory(), sourcesDir );
+        //        }
+        //        catch ( IOException e1 )
+        //        {
+        //            throw new MojoFailureException( "failed to copy directory structure at " + target.getLayout() + " to "
+        //                + sourcesDir );
+        //        }
+        //
+        //        String[] cmd = new String[]
+        //            {
+        //                "tar",
+        //                "-zcvf",
+        //                target.getRpmTopDir().getAbsolutePath() + "/SOURCES/apacheds-" + version + ".tar.gz",
+        //                sourcesDir.getAbsolutePath() };
+        //
+        //        MojoHelperUtils.exec( cmd, target.getLayout().getInstallationDirectory().getParentFile(), target.isDoSudo() );
     }
 }



Mime
View raw message