directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccust...@apache.org
Subject svn commit: r548504 - in /directory/sandbox/ccustine/new_installers/daemon: ./ bootstrappers/ bootstrappers/src/main/java/org/apache/directory/daemon/ plugin/ plugin/src/main/java/org/apache/directory/daemon/installers/ plugin/src/main/java/org/apache/...
Date Mon, 18 Jun 2007 21:56:02 GMT
Author: ccustine
Date: Mon Jun 18 14:56:01 2007
New Revision: 548504

URL: http://svn.apache.org/viewvc?view=rev&rev=548504
Log:
New Installers, Daemon and Data Paths
- Adding support for multiple instances/data paths.
- Updated RPM spec files for FHS paths
- Instance runs and is owned by apacheds not root
- JDK home and JVM options per instance

Modified:
    directory/sandbox/ccustine/new_installers/daemon/bootstrappers/pom.xml
    directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
    directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/pom.xml
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
    directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
    directory/sandbox/ccustine/new_installers/daemon/pom.xml

Modified: directory/sandbox/ccustine/new_installers/daemon/bootstrappers/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/bootstrappers/pom.xml?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/bootstrappers/pom.xml (original)
+++ directory/sandbox/ccustine/new_installers/daemon/bootstrappers/pom.xml Mon Jun 18 14:56:01
2007
@@ -3,7 +3,7 @@
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.directory.daemon</groupId>
-    <artifactId>build</artifactId>
+    <artifactId>daemon</artifactId>
     <version>1.1.1-SNAPSHOT</version>
   </parent>
   <artifactId>daemon-bootstrappers</artifactId>
@@ -37,6 +37,26 @@
             </manifest>
           </archive>
         </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>install-library</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>install-file</goal>
+            </goals>
+            <configuration>
+              <groupId>org.tanukisoftware</groupId>
+              <artifactId>wrapper</artifactId>
+              <version>3.2.3</version>
+              <packaging>jar</packaging>
+              <file>../plugin/src/main/resources/org/apache/directory/daemon/installers/wrapper/lib/wrapper.jar</file>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
   </build>

Modified: directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
Mon Jun 18 14:56:01 2007
@@ -110,15 +110,21 @@
         URL[] jars = layout.getAllJars();
         this.application = new URLClassLoader( jars, parentLoader );
 
+        for ( int ii = 0; ii < jars.length; ii++ )
+        {
+            log.error( "Classloader jars are: " + jars[ii].toString() );
+        }
+
         if ( log.isDebugEnabled() )
         {
             StringBuffer buf = new StringBuffer();
             buf.append( "Dependencies loaded by the application ClassLoader: \n" );
             for ( int ii = 0; ii < jars.length; ii++ )
             {
+                log.error( "Classloader jars are: " + jars[ii].toString() );
                 buf.append( "\t" ).append( jars[ii] ).append( "\n" );
             }
-            log.debug( buf.toString() );
+            log.error( "Classloader jars are: " + buf.toString() );
         }
     }
 
@@ -128,7 +134,7 @@
         Thread.currentThread().setContextClassLoader( application );
         try
         {
-            startClass = application.loadClass( startClassName );
+            startClass = application.loadClass( args[0] );
         }
         catch ( ClassNotFoundException e )
         {
@@ -148,7 +154,7 @@
 
         try
         {
-            start.init( this.layout, args );
+            start.init( this.layout, Bootstrapper.shift(args, 1));
         }
         catch ( Exception e )
         {

Modified: directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
Mon Jun 18 14:56:01 2007
@@ -40,6 +40,9 @@
 {
     private final static Logger log = LoggerFactory.getLogger( InstallationLayout.class );
     private final static FileFilter JAR_FILTER;
+    public static final String VAR_DIR = "apacheds.var.dir";
+    public static final String LOG_DIR = "apacheds.log.dir";
+    public static final String RUN_DIR = "apacheds.run.dir";
 
     static
     {
@@ -92,18 +95,39 @@
 
     public File getVarDirectory()
     {
+        String varDir = System.getProperty(VAR_DIR);
+
+        if ( varDir != null)
+        {
+            return new File( varDir );
+        }
+        
         return new File( baseDirectory, "var" );
     }
 
 
     public File getLogDirectory()
     {
+        String logDir = System.getProperty(LOG_DIR);
+
+        if ( logDir != null)
+        {
+            return new File( logDir );
+        }
+
         return new File( getVarDirectory(), "log" );
     }
 
 
     public File getRunDirectory()
     {
+        String runDir = System.getProperty(RUN_DIR);
+
+        if ( runDir != null)
+        {
+            return new File( runDir );
+        }
+
         return new File( getVarDirectory(), "run" );
     }
 
@@ -116,7 +140,7 @@
 
     public File getBootstrapper()
     {
-        return new File( getBinDirectory(), "bootstrapper.jar" );
+        return new File( getLibDirectory(), "bootstrapper.jar" );
     }
 
 
@@ -128,7 +152,7 @@
 
     public File getDaemon()
     {
-        return new File( getBinDirectory(), "daemon.jar" );
+        return new File( getLibDirectory(), "wrapper.jar" );
     }
 
 
@@ -224,7 +248,8 @@
 
     public File getBootstrapperConfigurationFile()
     {
-        return new File( getConfigurationDirectory(), "bootstrapper.properties" );
+//        return new File( getConfigurationDirectory(), "bootstrapper.properties" );
+        return new File( getConfigurationDirectory(), "apacheds.conf" );
     }
 
 

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/pom.xml?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/pom.xml (original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/pom.xml Mon Jun 18 14:56:01 2007
@@ -3,7 +3,7 @@
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.directory.daemon</groupId>
-    <artifactId>build</artifactId>
+    <artifactId>daemon</artifactId>
     <version>1.1.1-SNAPSHOT</version>
   </parent>
   <artifactId>daemon-plugin</artifactId>
@@ -26,7 +26,7 @@
       <groupId>${pom.groupId}</groupId>
       <artifactId>daemon-bootstrappers</artifactId>
       <version>${pom.version}</version>
-    </dependency>  
+    </dependency>
 
     <dependency>
       <groupId>org.apache.maven</groupId>

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
Mon Jun 18 14:56:01 2007
@@ -192,9 +192,9 @@
         }
 
         // copy over the optional bootstrapper configuration file
-        if ( target.getBootstrapperConfiguraitonFile() == null || !target.getBootstrapperConfiguraitonFile().exists()
)
+        if ( target.getBootstrapperConfigurationFile() == null || !target.getBootstrapperConfigurationFile().exists()
)
         {
-            File dest = target.getBootstrapperConfiguraitonFile();
+            File dest = target.getBootstrapperConfigurationFile();
             try
             {
                 PrintWriter out = new PrintWriter( new FileWriter( dest ) );
@@ -206,7 +206,7 @@
             catch ( IOException e )
             {
                 throw new MojoFailureException( "Failed to copy project bootstrapper configuration
file "
-                    + target.getBootstrapperConfiguraitonFile() + " into position "
+                    + target.getBootstrapperConfigurationFile() + " into position "
                     + layout.getBootstrapperConfigurationFile() );
             }
         }
@@ -214,13 +214,13 @@
         {
             try
             {
-                FileUtils.copyFile( target.getBootstrapperConfiguraitonFile(), layout
+                FileUtils.copyFile( target.getBootstrapperConfigurationFile(), layout
                     .getBootstrapperConfigurationFile() );
             }
             catch ( IOException e )
             {
                 throw new MojoFailureException( "Failed to copy project bootstrapper configuration
file "
-                    + target.getBootstrapperConfiguraitonFile() + " into position "
+                    + target.getBootstrapperConfigurationFile() + " into position "
                     + layout.getBootstrapperConfigurationFile() );
             }
         }
@@ -258,7 +258,7 @@
         // -------------------------------------------------------------------
 
         // now copy over the jsvc executable renaming it to the applicationName 
-        if ( target.getOsName().equals( "linux" ) && target.getOsArch().equals( "i386"
) )
+        if ( target.getOsName().equals( "linux" ) && target.getOsArch().equals( "i386"
) && target.getDaemonFramework().equals("jsvc"))
         {
             File executable = new File( layout.getBinDirectory(), target.getApplication().getName()
);
             try
@@ -271,6 +271,30 @@
                     + getClass().getResource( "jsvc_linux_i386" ) + " into position " + executable.getAbsolutePath()
);
             }
         }
+
+        if ( target.getOsName().equals( "linux" ) && target.getOsArch().equals( "i386"
) && target.getDaemonFramework().equals("tanuki"))
+        {
+            File executable = new File( layout.getBinDirectory(), target.getApplication().getName()
);
+            File sharedlib = new File( layout.getLibDirectory(), "libwrapper.so" );
+//            File wrapperconf = new File( layout.getConfigurationDirectory(), "apacheds.conf"
);
+            try
+            {
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "wrapper/bin/wrapper-linux-x86-32"
), executable );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "wrapper/lib/libwrapper-linux-x86-32.so"
), sharedlib );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "wrapper/conf/apacheds.conf"
),
+                    new File( layout.getConfigurationDirectory(), "apacheds.conf" ) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "wrapper/conf/apacheds-default.conf"
),
+                    new File( layout.getConfigurationDirectory(), "apacheds-default.conf"
) );
+                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "wrapper/lib/wrapper.jar"
),
+                    new File( layout.getLibDirectory(), "wrapper.jar" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy jsvc executable file "
+                    + getClass().getResource( "jsvc_linux_i386" ) + " into position " + executable.getAbsolutePath()
);
+            }
+        }
+
 
         // now copy over the jsvc executable renaming it to the applicationName 
         if ( target.getOsName().equals( "linux" ) && target.getOsArch().equals( "x86_64"
) )

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
Mon Jun 18 14:56:01 2007
@@ -152,10 +152,10 @@
             {
                 rejects.add( key );
             }
-            else if ( artifact.equals( mymojo.getLogger() ) )
-            {
-                rejects.add( key );
-            }
+//            else if ( artifact.equals( mymojo.getLogger() ) )
+//            {
+//                rejects.add( key );
+//            }
             else
             {
                 if ( mymojo.getExcludes().contains( key ) )

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
Mon Jun 18 14:56:01 2007
@@ -389,9 +389,9 @@
                 target.setLoggerConfigurationFile( new File( sourceDirectory, "log4j.properties"
) );
             }
 
-            if ( target.getBootstrapperConfiguraitonFile() == null )
+            if ( target.getBootstrapperConfigurationFile() == null )
             {
-                target.setBootstrapperConfiguraitonFile( new File( sourceDirectory, "bootstrapper.properties"
) );
+                target.setBootstrapperConfigurationFile( new File( sourceDirectory, "bootstrapper.properties"
) );
             }
 
             if ( target.getServerConfigurationFile() == null )
@@ -512,8 +512,8 @@
                 getLog().info(
                     "loggerConfigurationFile: " + ( ( Target ) allTargets.get( ii ) ).getLoggerConfigurationFile()
);
                 getLog().info(
-                    "bootstrapperConfiguraitonFiles: "
-                        + ( ( Target ) allTargets.get( ii ) ).getBootstrapperConfiguraitonFile()
);
+                    "bootstrapperConfigurationFiles: "
+                        + ( ( Target ) allTargets.get( ii ) ).getBootstrapperConfigurationFile()
);
                 getLog().info(
                     "serverConfigurationFil: " + ( ( Target ) allTargets.get( ii ) ).getServerConfigurationFile()
);
 

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
Mon Jun 18 14:56:01 2007
@@ -57,7 +57,7 @@
     public final static String[] ARCHITECTURES = new String[]
         { "intel", "sparc", "ppc" };
     public final static String[] DAEMON_FRAMEWORKS = new String[]
-        { "jsvc", "procrun" };
+        { "jsvc", "procrun", "tanuki" };
 
     // required stuff
     private String id;
@@ -71,7 +71,7 @@
     private String copyrightYear = "2006";
     private File loggerConfigurationFile;
     private File serverConfigurationFile;
-    private File bootstrapperConfiguraitonFile;
+    private File bootstrapperConfigurationFile;
     private File sourcesDirectory;
     private File docsDirectory;
     private String sourcesTargetPath;
@@ -186,15 +186,15 @@
     }
 
 
-    public void setBootstrapperConfiguraitonFile( File bootstrapperConfiguraitonFile )
+    public void setBootstrapperConfigurationFile( File bootstrapperConfigurationFile )
     {
-        this.bootstrapperConfiguraitonFile = bootstrapperConfiguraitonFile;
+        this.bootstrapperConfigurationFile = bootstrapperConfigurationFile;
     }
 
 
-    public File getBootstrapperConfiguraitonFile()
+    public File getBootstrapperConfigurationFile()
     {
-        return bootstrapperConfiguraitonFile;
+        return bootstrapperConfigurationFile;
     }
 
 

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
Mon Jun 18 14:56:01 2007
@@ -110,12 +110,10 @@
             return;
         }
 
-        if ( !System.getProperties().getProperty( "user.name" ).equals( "root" ) &&
!target.isDoSudo() )
+        if ( !System.getProperties().getProperty( "user.name" ).equals( "root" ) &&
!target.getRpmTopDir().exists() )
         {
-            log.warn( "RPM target " + target.getId() + " can only be built by a super user
or regular user "
-                + "with sudo capabilities that bypass the password!" );
-            log.warn( "The target will not be built." );
-            log.warn( "The rest of the build will not fail because of this acceptable situation."
);
+            log.warn( "Please set the rpmTopDir in the pom.xml to a directory where the build");
+            log.warn( "user has proper permissions to create dirs and files.");
             return;
         }
 
@@ -191,7 +189,7 @@
             {
                 MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, projectRpmFile,
rpmConfigurationFile, true );
             }
-            catch ( IOException e )
+           catch ( IOException e )
             {
                 throw new MojoFailureException( "Failed to filter and copy project provided
" + projectRpmFile + " to "
                     + rpmConfigurationFile );
@@ -216,10 +214,10 @@
 
         buildSourceTarball();
         String[] cmd = new String[]
-            { rpmBuilder.getAbsolutePath(), "-ba", rpmConfigurationFile.getAbsolutePath()
};
+            { rpmBuilder.getAbsolutePath(), "-ba", "--define", "_topdir " + target.getRpmTopDir().getAbsolutePath(),
rpmConfigurationFile.getAbsolutePath() };
         MojoHelperUtils.exec( cmd, target.getLayout().getBaseDirectory().getParentFile(),
target.isDoSudo() );
         String rpmName = target.getApplication().getName() + "-" + version + "-0.i386.rpm";
-        File srcFile = new File( "/usr/src/redhat/RPMS/i386", rpmName );
+        File srcFile = new File( System.getProperty("user.home") + "/rpmbuild/RPMS/i386",
rpmName );
         File dstFile = null;
 
         if ( target.getFinalName() == null )
@@ -240,6 +238,7 @@
         try
         {
             FileUtils.copyFile( srcFile, dstFile );
+            srcFile.delete();
         }
         catch ( IOException e )
         {
@@ -319,7 +318,7 @@
         filterProperties.put( "verify.append.libs", getVerifyLibraryJars() );
         filterProperties.put( "installer.output.directory", target.getLayout().getBaseDirectory().getParent()
);
         filterProperties.put( "server.init", target.getLayout().getInitScript().getName()
);
-        filterProperties.put( "app.install.base", "/usr/local/" + target.getApplication().getName()
+ "-" + version );
+        filterProperties.put( "app.install.base", "/opt/" + target.getApplication().getName()
+ "-" + version );
 
         if ( target.getDocsDirectory() != null )
         {
@@ -357,8 +356,8 @@
         if ( noticeFile.exists() )
         {
             filterProperties.put( "install.notice.file", "install -m 644 " + target.getLayout().getBaseDirectory()
-                + "/NOTICE.txt $RPM_BUILD_ROOT/usr/local/" + target.getApplication().getName()
+ "-%{version}" );
-            filterProperties.put( "verify.notice.file", "/usr/local/" + target.getApplication().getName()
+                + "/NOTICE.txt $RPM_BUILD_ROOT/opt/" + target.getApplication().getName()
+ "-%{version}" );
+            filterProperties.put( "verify.notice.file", "/opt/" + target.getApplication().getName()
                 + "-%{version}/NOTICE.txt" );
         }
         else
@@ -386,7 +385,7 @@
             }
 
             String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "mkdir -p $RPM_BUILD_ROOT/usr/local/" );
+            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -413,7 +412,7 @@
             }
 
             String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "mkdir -p $RPM_BUILD_ROOT/usr/local/" );
+            buf.append( "mkdir -p $RPM_BUILD_ROOT/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -464,7 +463,7 @@
             buf.append( "install -m 644 " );
             buf.append( target.getLayout().getBaseDirectory() ).append( "/" );
             buf.append( path );
-            buf.append( " $RPM_BUILD_ROOT/usr/local/" );
+            buf.append( " $RPM_BUILD_ROOT/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -486,7 +485,7 @@
         {
             File file = ( File ) docList.get( ii );
             String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "/usr/local/" );
+            buf.append( target.getLayout().getBaseDirectory() );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -516,7 +515,7 @@
             buf.append( "install -m 644 " );
             buf.append( target.getLayout().getBaseDirectory() ).append( "/" );
             buf.append( path );
-            buf.append( " $RPM_BUILD_ROOT/usr/local/" );
+            buf.append( " $RPM_BUILD_ROOT/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -538,7 +537,7 @@
         {
             File file = ( File ) sourceList.get( ii );
             String path = file.getAbsolutePath().substring( basePathSize );
-            buf.append( "/usr/local/" );
+            buf.append( "/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/" );
             buf.append( path );
@@ -555,7 +554,7 @@
         for ( int ii = 0; ii < artifacts.size(); ii++ )
         {
             File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
-            buf.append( "/usr/local/" );
+            buf.append( "/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/lib/" );
             buf.append( artifact.getName() );
@@ -575,7 +574,7 @@
             buf.append( "install -m 644 " );
             File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
             buf.append( artifact.getAbsoluteFile() );
-            buf.append( " $RPM_BUILD_ROOT/usr/local/" );
+            buf.append( " $RPM_BUILD_ROOT/opt/" );
             buf.append( target.getApplication().getName() );
             buf.append( "-%{version}/lib/" );
             buf.append( artifact.getName() );
@@ -612,7 +611,7 @@
 
         String[] cmd = new String[]
             { "tar", "-zcvf",
-                "/usr/src/redhat/SOURCES/" + target.getApplication().getName() + "-" + version
+ ".tar.gz",
+                System.getProperty("user.home") + "/rpmbuild/SOURCES/" + target.getApplication().getName()
+ "-" + version + ".tar.gz",
                 sourcesDir.getAbsolutePath() };
 
         MojoHelperUtils.exec( cmd, target.getLayout().getBaseDirectory().getParentFile(),
target.isDoSudo() );

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
Mon Jun 18 14:56:01 2007
@@ -35,6 +35,7 @@
 {
     private File rpmBuilder = new File( "/usr/bin/rpmbuild" );
     private File rpmSpecificationFile;
+    private File rpmTopDir;
     private boolean doSudo = false;
 
 
@@ -71,5 +72,15 @@
     public boolean isDoSudo()
     {
         return doSudo;
+    }
+
+    public File getRpmTopDir()
+    {
+        return rpmTopDir;
+    }
+
+    public void setRpmTopDir(File rpmTopDir)
+    {
+        this.rpmTopDir = rpmTopDir;
     }
 }

Modified: directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
(original)
+++ directory/sandbox/ccustine/new_installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
Mon Jun 18 14:56:01 2007
@@ -66,7 +66,7 @@
 
     if [ ! -d "$JAVA_HOME" ] ; then
       if [ `uname` = Linux ] ; then
-        for jdkhome in `find /usr/java/ -type d -regex '.*\/jdk1\.5\.....$' | sort`; do
+        for jdkhome in `find /usr/java/ -type d -regex '.*\/jdk1\.[56]\.....$' | sort`; do
           JAVA_HOME=$jdkhome;
         done
       fi 

Modified: directory/sandbox/ccustine/new_installers/daemon/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/ccustine/new_installers/daemon/pom.xml?view=diff&rev=548504&r1=548503&r2=548504
==============================================================================
--- directory/sandbox/ccustine/new_installers/daemon/pom.xml (original)
+++ directory/sandbox/ccustine/new_installers/daemon/pom.xml Mon Jun 18 14:56:01 2007
@@ -7,9 +7,9 @@
     <version>7</version>
   </parent>
   <groupId>org.apache.directory.daemon</groupId>
-  <artifactId>build</artifactId>
+  <artifactId>daemon</artifactId>
   <name>Apache Directory Daemon</name>
-  <packaging>pom</packaging>  
+  <packaging>pom</packaging>
   <!-- note that this skipped a RC in being bumped up -->
   <version>1.1.1-SNAPSHOT</version>
   <description>
@@ -44,6 +44,12 @@
       <version>3.8.1</version>
     </dependency>
 
+      <dependency>
+          <groupId>org.tanukisoftware</groupId>
+          <artifactId>wrapper</artifactId>
+          <version>3.2.3</version>
+      </dependency>
+
   </dependencies>
 
   <scm>
@@ -71,9 +77,16 @@
           <artifactId>maven-compiler-plugin</artifactId>
           <version>2.0.2</version>
         </plugin>
+
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+
       </plugins>
     </pluginManagement>
- 
+
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>



Mime
View raw message