mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
12.41.2015 0fbdd725579723d0b97ef55fb31ac061ff4f784d
OPENDJ-1772: Add package-svr4 profile to server pom

The package is built using antrun maven plugin and old ant files with some slighty modifications.
Note that the package still need to be fixed (see OPENDJ-1012 for more details)
4 files modified
134 ■■■■ changed files
opendj-server-legacy/build-svr4.xml 39 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/build.xml 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/pom.xml 30 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/svr4/OpenDJ/layout.xml 64 ●●●● patch | view | raw | blame | history
opendj-server-legacy/build-svr4.xml
@@ -22,7 +22,7 @@
 !
 !
 !      Copyright 2006-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2011-2013 ForgeRock AS
 !      Portions Copyright 2011-2015 ForgeRock AS
 ! -->
<project name="SVR4 Packaging" basedir="." default="package-svr4">
@@ -33,12 +33,12 @@
  <!-- By default will build OpenDJ package -->
  <property name="product"           value="${SHORT_NAME}" />
  <property name="product"           value="${shortProductName}" />
  <!-- General properties -->
  <property name="svr4.src.dir"      location="src/svr4/${product}" />
  <property name="build.dir"         location="build"                />
  <property name="build.dir"         location="target" />
  <property name="package.dir"       location="${build.dir}/package" />
  <property name="svr4.dir"          location="${build.dir}/package/svr4" />
@@ -82,8 +82,7 @@
  </target>
  <!-- Cleanup target -->
  <target name="cleansvr4" if="isSunOS"
        description="Cleanup SVR4 files.">
  <target name="cleansvr4" if="isSunOS" description="Cleanup SVR4 files.">
    <delete dir="${svr4.build.dir}" />
    <delete dir="${svr4.dir}/${svr4.name}" />
  </target>
@@ -117,34 +116,27 @@
BASEDIR=${svr4.basedir}
CLASSES=none
HOTLINE=Please contact your local service provider
EMAIL=
EMAIL=opendj@forgerock.org
        </echo>
  </target>
  <!-- Construct prototype file -->
  <target name="prototype" depends="layout" if="isSunOS"
        description="Create prototype file based on ${svr4.layout.dir}" >
  <target name="prototype" depends="layout" if="isSunOS" description="Create prototype file based on ${svr4.layout.dir}">
    <echo message="Building prototype for ${svr4.name} pkg" />
    <exec executable="pkgproto" dir="${svr4.layout.dir}" output="${svr4.meta.dir}/prototype">
        <arg value="."/>
    </exec>
    <exec executable="groups" dir="${svr4.layout.dir}" outputproperty="user.group" />
        <echo file="${svr4.meta.dir}/prototype" append="true">i pkginfo
i copyright</echo>
    <replaceregexp file="${svr4.meta.dir}/prototype"
                         match=" ${user.name} "
                         replace=" root "
                         byline="true"/>
    <replaceregexp file="${svr4.meta.dir}/prototype"
                         match=" ${user.group}"
                         replace=" sys"
                         byline="true"/>
i copyright
    </echo>
    <replaceregexp file="${svr4.meta.dir}/prototype" match=" ${user.name} " replace=" root " byline="true" />
    <replaceregexp file="${svr4.meta.dir}/prototype" match=" ${user.group}" replace=" sys" byline="true" />
  </target>
  <!-- Construct copyright file -->
  <target name="copyright"  if="isSunOS"
        description="Create copyright file based on ${svr4.src.dir}/copyright" >
  <target name="copyright" if="isSunOS" description="Create copyright file based on ${svr4.src.dir}/copyright">
    <echo message="Building copyright for ${svr4.name} pkg" />
    <copy file="${svr4.src.dir}/copyright" todir="${svr4.meta.dir}"/>
  </target>
@@ -154,15 +146,13 @@
      <available property="present" file="${svr4.src.dir}/depend"/>
  </target>
  <target name="depend" depends="depend.init" if="present"
                description="Create depend file based on ${svr4.src.dir}/depend" >
  <target name="depend" depends="depend.init" if="present" description="Create depend file based on ${svr4.src.dir}/depend">
       <echo message="Building depend for ${svr4.name} pkg" />
       <copy file="${svr4.src.dir}/depend" todir="${svr4.meta.dir}"/>
  </target>
  <!-- Make package -->
  <target name="pkgmk" if="isSunOS"
        description="Build ${svr4.name} package" >
  <target name="pkgmk" if="isSunOS" description="Build ${svr4.name} package">
    <echo message="Building ${svr4.name} pkg" />
    <echo message="Executing pkgmk -o -d ${svr4.dir} -r ${svr4.layout.dir} -f ${svr4.meta.dir}/prototype in ${svr4.layout.dir}" />
    <exec executable="pkgmk" dir="${svr4.layout.dir}">
@@ -177,8 +167,7 @@
  </target>
  <!-- ZIP package -->
  <target name="zipsvr4" if="isSunOS"
        description="ZIP ${svr4.name} package" >
  <target name="zipsvr4" if="isSunOS" description="ZIP ${svr4.name} package">
    <echo message="Zipping ${svr4.name} pkg" />
    <zip destfile="${svr4.dir}/${svr4.name}.zip">
      <zipfileset dir="${svr4.dir}" includes="${svr4.name}/**/*"/>
opendj-server-legacy/build.xml
@@ -2944,6 +2944,5 @@
    <ivy:cleancache/>
  </target>
  <import file="build-svr4.xml"/>
  <import file="build-pkg.xml"/>
</project>
opendj-server-legacy/pom.xml
@@ -1868,6 +1868,36 @@
        </plugins>
      </build>
    </profile>
    <!-- Build the solaris package -->
    <profile>
      <id>package-svr4</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-svr4-package</id>
                <phase>verify</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <ant antfile="${basedir}/build-svr4.xml">
                      <target name="svr4" />
                    </ant>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
opendj-server-legacy/src/svr4/OpenDJ/layout.xml
@@ -22,7 +22,7 @@
 !
 !
 !      Copyright 2006-2009 Sun Microsystems, Inc.
 !      Portions Copyright 2010-2013 ForgeRock AS.
 !      Portions Copyright 2010-2015 ForgeRock AS.
 ! -->
<project name="OpenDJ SVR4 layout" basedir=".">
@@ -32,50 +32,20 @@
  </description>
  <target name="pkgversion"
         description="Set svr4.version property" >
  <!-- Construct the version number string -->
  <taskdef name="getversionnumber"
             classname="org.opends.build.tools.CreateVersionString">
  <classpath>
    <fileset dir="${build.dir}/build-tools">
       <include name="*.jar" />
       </fileset>
    </classpath>
  </taskdef>
  <getversionnumber property="svr4.fullversion" />
  <target name="pkgversion" description="Set svr4.version property">
  <property name="svr4.version"
    value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}" />
      value="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}" />
    <property name="svr4.fullversion" value="${svr4.version}-${parsedVersion.qualifier}-${buildRevision}" />
  </target>
  <property name="resource.dir"      location="src/resource" />
  <property name="resource.dir" location="resource" />
  <!-- Construct layout -->
  <target name="layout" if="isSunOS"
        description="Create layout based on zip layout" >
    <!-- Get the revision number of the current Subversion workspace -->
    <taskdef name="getsvnrevision"
             classname="org.opends.build.tools.GetSubversionRevision">
      <classpath>
        <fileset dir="${build.dir}/build-tools">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${svnkit.dir}">
          <include name="*.jar" />
        </fileset>
      </classpath>
    </taskdef>
  <target name="layout" if="isSunOS" description="Create layout based on zip layout">
    <property name="zip.dir" location="${package.dir}/${lowerCaseProductName}" />
    <getsvnrevision property="REVISION_NUMBER" />
    <property name="zip.dir"
        location="${package.dir}/${product}-${svr4.fullversion}" />
    <echo
        message="Building layout for ${svr4.name} pkg based on ${zip.dir}" />
    <!-- copy ZIP layout.
        Use exec instead of copy task to preserve file permissions -->
    <echo message="Building layout for ${svr4.name} pkg based on ${zip.dir}" />
    <!-- copy ZIP layout. Use exec instead of copy task to preserve file permissions -->
    <mkdir dir="${svr4.layout.dir}"/>
    <exec executable="cp">
        <arg value="-R"/>
@@ -83,28 +53,28 @@
        <arg value="${svr4.layout.pkg.dir}"/>
    </exec>
        <chmod dir="${svr4.layout.pkg.dir}" perm="755"/>
    <!-- Remove Windows specific files -->
    <delete includeemptydirs="true">
       <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.exe"/>
       <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.bat"/>
       <fileset dir="${svr4.layout.pkg.dir}" includes="**/bat/"/>
    </delete>
    <!-- Remove MacOS specific files  -->
    <delete includeemptydirs="true">
      <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.app/" />
    </delete>
    <!-- Remove uninstall file -->
    <delete file="${svr4.layout.pkg.dir}/uninstall" />
    <!-- Add svc-opendj.sh wrapper -->
    <copy file="${svr4.src.dir}/_svc-opendj.sh"
        tofile="${svr4.layout.pkg.dir}/lib/_svc-opendj.sh" />
    <copy file="${svr4.src.dir}/_svc-opendj.sh" tofile="${svr4.layout.pkg.dir}/lib/_svc-opendj.sh" />
    <chmod file="${svr4.layout.pkg.dir}/lib/_svc-opendj.sh" perm="755" />
    <!-- Add the SMF Manifest for OpenDJ in a resources directory -->
    <mkdir dir="${svr4.layout.pkg.dir}/resources"/>
    <copy file="${svr4.src.dir}/opendj-manifest.xml"
        tofile="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml" />
    <chmod file="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml"
        perm="644" />
    <copy file="${svr4.src.dir}/opendj-manifest.xml" tofile="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml" />
    <chmod file="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml" perm="644" />
    <!-- Add man pages -->
    <copy todir="${svr4.layout.pkg.dir}/man">
      <fileset dir="${resource.dir}/man"/>