directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r374299 - in /directory/trunks: apacheds/simple/installers/ daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/ daemon/installers...
Date Thu, 02 Feb 2006 08:17:53 GMT
Author: akarasulu
Date: Thu Feb  2 00:17:44 2006
New Revision: 374299

URL: http://svn.apache.org/viewcvs?rev=374299&view=rev
Log:
added RPM installer code

Added:
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
      - copied, changed from r373974, directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/RpmTarget.java
    directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/
    directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template
  (with props)
Removed:
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/RpmTarget.java
Modified:
    directory/trunks/apacheds/simple/installers/pom.xml
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Application.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java

Modified: directory/trunks/apacheds/simple/installers/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/installers/pom.xml?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/apacheds/simple/installers/pom.xml (original)
+++ directory/trunks/apacheds/simple/installers/pom.xml Thu Feb  2 00:17:44 2006
@@ -128,6 +128,20 @@
           <applicationClass>
             org.apache.ldap.server.DirectoryServer
           </applicationClass>
+          <rpmTargets>
+            <rpmTarget>
+              <!--  doSudo>true</doSudo -->
+              <id>linux-jsvc</id>
+              <finalName>
+                apacheds-${pom.version}-linux-i386.rpm
+              </finalName>
+              <osName>Linux</osName>
+              <osFamily>unix</osFamily>
+              <osArch>i386</osArch>
+              <daemonFramework>jsvc</daemonFramework>
+            </rpmTarget>
+          </rpmTargets>
+<!-- 
           <innoTargets>
             <innoTarget>
               <id>windows-xp-procrun</id>
@@ -153,6 +167,16 @@
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
             <izPackTarget>
+              <finalName>
+                apacheds-${pom.version}-solaris-sparc-setup.jar
+              </finalName>
+              <id>solaris-jsvc-sparc</id>
+              <osName>sunos</osName>
+              <osFamily>unix</osFamily>
+              <osArch>sparc</osArch>
+              <daemonFramework>jsvc</daemonFramework>
+            </izPackTarget>
+            <izPackTarget>
               <id>solaris-jsvc-i386</id>
               <finalName>
                 apacheds-${pom.version}-solaris-i386-setup.jar
@@ -162,7 +186,6 @@
               <osArch>i386</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
-<!--
             <izPackTarget>
               <id>macosx-jsvc</id>
               <finalName>
@@ -173,18 +196,8 @@
               <osArch>ppc</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
--->
-            <izPackTarget>
-              <finalName>
-                apacheds-${pom.version}-solaris-sparc-setup.jar
-              </finalName>
-              <id>solaris-jsvc-sparc</id>
-              <osName>sunos</osName>
-              <osFamily>unix</osFamily>
-              <osArch>sparc</osArch>
-              <daemonFramework>jsvc</daemonFramework>
-            </izPackTarget>
           </izPackTargets>
+-->
         </configuration>
         <executions>
           <execution>

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Application.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Application.java?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Application.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Application.java
Thu Feb  2 00:17:44 2006
@@ -20,6 +20,7 @@
     private File icon;
     private File readme;
     private File license;
+    private String licenseType = "ASL 2.0" ;
     
 
     public Application()
@@ -171,5 +172,11 @@
     public String getName()
     {
         return name;
+    }
+
+
+    public String getLicenseType()
+    {
+        return licenseType;
     }
 }

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
Thu Feb  2 00:17:44 2006
@@ -36,6 +36,7 @@
 import org.apache.directory.daemon.InstallationLayout;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.tools.ant.taskdefs.Execute;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.InterpolationFilterReader;
@@ -168,5 +169,52 @@
         }
         
         return libArtifacts;
+    }
+    
+    
+    public static void exec( String[] cmd, File workDir, boolean doSudo ) throws MojoFailureException
+    {
+        Execute task = new Execute();
+        task.setCommandline( cmd );
+        task.setSpawn( true );
+        task.setWorkingDirectory( workDir );
+        
+        if ( doSudo )
+        {
+            String cmdString = " ";
+            for ( int ii = 0; ii < cmd.length; ii++ )
+            {
+                System.out.println( "cmd[" + ii + "] = " + cmd[ii] );
+                cmdString += cmd[ii] + " ";
+            }
+
+            String[] temp = new String[2];
+            temp[0] = "sudo";
+            temp[1] = cmdString;
+            cmd = temp;
+        }
+        
+        String cmdString = " ";
+        for ( int ii = 0; ii < cmd.length; ii++ )
+        {
+            System.out.println( "cmd[" + ii + "] = " + cmd[ii] );
+            cmdString += cmd[ii] + " ";
+        }
+        
+        try
+        {
+            task.execute();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Failed while trying to execute '" + cmdString

+                + "': " + e.getMessage() );
+        }
+        
+        if ( task.getExitValue() != 0 )
+        {
+            throw new MojoFailureException( "Execution of '" + cmdString 
+                + "' resulted in a non-zero exit value: " + task.getExitValue() );
+        }
     }
 }

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
Thu Feb  2 00:17:44 2006
@@ -27,6 +27,8 @@
 import org.apache.directory.daemon.installers.inno.InnoTarget;
 import org.apache.directory.daemon.installers.izpack.IzPackInstallerCommand;
 import org.apache.directory.daemon.installers.izpack.IzPackTarget;
+import org.apache.directory.daemon.installers.rpm.RpmInstallerCommand;
+import org.apache.directory.daemon.installers.rpm.RpmTarget;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Developer;
@@ -198,6 +200,13 @@
                 InnoInstallerCommand innoCmd = null;
                 innoCmd = new InnoInstallerCommand( this, ( InnoTarget ) target );
                 innoCmd.execute();
+            }
+
+            if ( target instanceof RpmTarget )
+            {
+                RpmInstallerCommand rpmCmd = null;
+                rpmCmd = new RpmInstallerCommand( this, ( RpmTarget ) target );
+                rpmCmd.execute();
             }
         }
     }

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
Thu Feb  2 00:17:44 2006
@@ -61,6 +61,8 @@
     private String osVersion;
     private String daemonFramework;
     private String finalName;
+    private String companyName = "Apache Software Foundation";
+    private String copyrightYear = "2006";
     private File loggerConfigurationFile;
     private File serverConfigurationFile;
     private File bootstrapperConfiguraitonFile;
@@ -229,5 +231,29 @@
     public String getFinalName()
     {
         return finalName;
+    }
+
+
+    public void setCompanyName(String innoCompanyName)
+    {
+        this.companyName = innoCompanyName;
+    }
+
+
+    public String getCompanyName()
+    {
+        return companyName;
+    }
+
+
+    public void setCopyrightYear(String innoCopyrightYear)
+    {
+        this.copyrightYear = innoCopyrightYear;
+    }
+
+
+    public String getCopyrightYear()
+    {
+        return copyrightYear;
     }
 }

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java?rev=374299&r1=374298&r2=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoTarget.java
Thu Feb  2 00:17:44 2006
@@ -32,8 +32,6 @@
 {
     private File innoCompiler = new File( "C:\\Program Files\\Inno Setup 5\\ISCC.exe" );
     private File innoConfigurationFile;
-    private String companyName = "Apache Software Foundation";
-    private String copyrightYear;
 
     
     public InnoTarget()
@@ -65,29 +63,5 @@
     public File getInnoConfigurationFile()
     {
         return innoConfigurationFile;
-    }
-
-
-    public void setCompanyName(String innoCompanyName)
-    {
-        this.companyName = innoCompanyName;
-    }
-
-
-    public String getCompanyName()
-    {
-        return companyName;
-    }
-
-
-    public void setCopyrightYear(String innoCopyrightYear)
-    {
-        this.copyrightYear = innoCopyrightYear;
-    }
-
-
-    public String getCopyrightYear()
-    {
-        return copyrightYear;
     }
 }

Copied: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
(from r373974, directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/RpmTarget.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java?p2=directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java&p1=directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/RpmTarget.java&r1=373974&r2=374299&rev=374299&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/RpmTarget.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmTarget.java
Thu Feb  2 00:17:44 2006
@@ -14,7 +14,12 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.daemon.installers;
+package org.apache.directory.daemon.installers.rpm;
+
+
+import java.io.File;
+
+import org.apache.directory.daemon.installers.Target;
 
 
 /**
@@ -25,5 +30,43 @@
  */
 public class RpmTarget extends Target
 {
+    private File rpmBuilder = new File( "/usr/bin/rpmbuild" );
+    private File rpmSpecificationFile;
+    private boolean doSudo;
+    
+    
+    public void setRpmBuilder( File rpmBuilder )
+    {
+        this.rpmBuilder = rpmBuilder;
+    }
+
+    
+    public File getRpmBuilder()
+    {
+        return rpmBuilder;
+    }
+
+
+    public void setRpmSpecificationFile( File rpmConfigurationFile )
+    {
+        this.rpmSpecificationFile = rpmConfigurationFile;
+    }
+
+
+    public File getRpmSpecificationFile()
+    {
+        return rpmSpecificationFile;
+    }
+
+
+    public void setDoSudo( boolean doSudo )
+    {
+        this.doSudo = doSudo;
+    }
+
 
+    public boolean isDoSudo()
+    {
+        return doSudo;
+    }
 }

Added: directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template?rev=374299&view=auto
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template
(added)
+++ directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template
Thu Feb  2 00:17:44 2006
@@ -0,0 +1,78 @@
+Summary: ${app.display.name} Server 
+Name: ${app}
+Version: ${app.version}
+Release: ${app.release}
+License: ${app.license.type}
+Group: System Environment/Daemons
+URL: ${app.url}
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+${app.description}
+
+%prep
+echo $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT
+cp -rf ${image.basedir} $RPM_BUILD_ROOT/%{name}-%{version}
+cd $RPM_BUILD_ROOT
+tar -zcvf /usr/src/redhat/SOURCES/%{name}-%{version}.tar.gz %{name}-%{version}
+
+%setup -q
+
+%build
+cd $RPM_BUILD_ROOT/%{name}-%{version}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/log
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/run
+mkdir -p $RPM_BUILD_ROOT/usr/local/${app}-%{version}/var/partitions
+touch $RPM_BUILD_ROOT/usr/local/${app}-%{version}/logs/${app}-stderr.log
+touch $RPM_BUILD_ROOT/usr/local/${app}-%{version}/logs/${app}-stdout.log
+mkdir -p $RPM_BUILD_ROOT/etc/init.d
+
+pwd
+install -m 755 ${image.basedir}/bin/${app} $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/${app}
+install -m 644 ${image.basedir}/bin/bootstrapper.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/bootstrapper.jar
+install -m 644 ${image.basedir}/bin/apacheds-tools.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/apacheds-tools.jar
+install -m 755 ${image.basedir}/bin/apacheds-tools.sh $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/apacheds-tools.sh
+install -m 644 ${image.basedir}/bin/logger.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/logger.jar
+install -m 644 ${image.basedir}/bin/daemon.jar $RPM_BUILD_ROOT/usr/local/${app}-%{version}/bin/daemon.jar
+install -m 600 ${image.basedir}/conf/server.xml $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/server.xml
+install -m 644 ${image.basedir}/conf/bootstrapper.properties $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/bootstrapper.properties
+install -m 644 ${image.basedir}/conf/log4j.properties $RPM_BUILD_ROOT/usr/local/${app}-%{version}/conf/log4j.properties
+install -m 744 ${image.basedir}/bin/${server.init} $RPM_BUILD_ROOT/etc/init.d/${app}
+install -m 644 ${image.basedir}/${app.license.name} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+install -m 644 ${image.basedir}/${app.readme.name} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+install -m 644 ${image.basedir}/${app.icon} $RPM_BUILD_ROOT/usr/local/${app}-%{version}
+${install.append.libs}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc ${app.license.name} ${app.readme.name}
+
+/etc/init.d/${app}
+/usr/local/${app}-%{version}/bin/${app}
+/usr/local/${app}-%{version}/bin/bootstrap.jar
+/usr/local/${app}-%{version}/bin/apacheds-tools.jar
+/usr/local/${app}-%{version}/bin/logger.jar
+/usr/local/${app}-%{version}/bin/daemon.jar
+/usr/local/${app}-%{version}/conf/log4j.properties
+/usr/local/${app}-%{version}/conf/server.xml
+/usr/local/${app}-%{version}/var/run
+/usr/local/${app}-%{version}/var/log
+/usr/local/${app}-%{version}/var/partitions
+/usr/local/${app}-%{version}/logs/${app}-stderr.log
+/usr/local/${app}-%{version}/logs/${app}-stdout.log
+/usr/local/${app}-%{version}/${app.readme.name}
+/usr/local/${app}-%{version}/${app.license.name}
+/usr/local/${app}-%{version}/${app.icon}
+${verify.append.libs}
+

Propchange: directory/trunks/daemon/installers-plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/spec.template
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message