layout.xml revision 5307
5307N/A<!--
5307N/A ! CDDL HEADER START
5307N/A !
5307N/A ! The contents of this file are subject to the terms of the
5307N/A ! Common Development and Distribution License, Version 1.0 only
5307N/A ! (the "License"). You may not use this file except in compliance
5307N/A ! with the License.
5307N/A !
5307N/A ! You can obtain a copy of the license at
5307N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
5307N/A ! or http://forgerock.org/license/CDDLv1.0.html.
5307N/A ! See the License for the specific language governing permissions
5307N/A ! and limitations under the License.
5307N/A !
5307N/A ! When distributing Covered Code, include this CDDL HEADER in each
5307N/A ! file and include the License file at
5307N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
5307N/A ! add the following below this CDDL HEADER, with the fields enclosed
5307N/A ! by brackets "[]" replaced with your own identifying information:
5307N/A ! Portions Copyright [yyyy] [name of copyright owner]
5307N/A !
5307N/A ! CDDL HEADER END
5307N/A !
5307N/A !
5307N/A ! Copyright 2006-2009 Sun Microsystems, Inc.
5307N/A ! Portions Copyright 2010-2011 ForgeRock AS.
5307N/A ! -->
5307N/A
5307N/A<project name="OpenDJ SVR4 layout" basedir=".">
5307N/A <description>
5307N/A This is a build script that extends the OpenDJ build script by adding
5307N/A SVR4 packaging functions.
5307N/A </description>
5307N/A
5307N/A
5307N/A <target name="pkgversion"
5307N/A description="Set svr4.version property" >
5307N/A <!-- Construct the version number string -->
5307N/A <taskdef name="getversionnumber"
5307N/A classname="org.opends.build.tools.CreateVersionString">
5307N/A <classpath>
5307N/A <fileset dir="${build.dir}/build-tools">
5307N/A <include name="*.jar" />
5307N/A </fileset>
5307N/A </classpath>
5307N/A </taskdef>
5307N/A
5307N/A <getversionnumber property="svr4.fullversion" />
5307N/A <property name="svr4.version"
5307N/A value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}" />
5307N/A </target>
5307N/A
5307N/A <property name="resource.dir" location="src/resource" />
5307N/A
5307N/A <!-- Construct layout -->
5307N/A <target name="layout" if="isSunOS"
5307N/A description="Create layout based on zip layout" >
5307N/A <!-- Get the revision number of the current Subversion workspace -->
5307N/A <taskdef name="getsvnrevision"
5307N/A classname="org.opends.build.tools.GetSubversionRevision">
5307N/A <classpath>
5307N/A <fileset dir="${build.dir}/build-tools">
5307N/A <include name="*.jar" />
5307N/A </fileset>
5307N/A <fileset dir="${svnkit.dir}">
5307N/A <include name="*.jar" />
5307N/A </fileset>
5307N/A </classpath>
5307N/A </taskdef>
5307N/A
5307N/A <getsvnrevision property="REVISION_NUMBER" />
5307N/A
5307N/A <property name="zip.dir"
5307N/A location="${package.dir}/${product}-${svr4.fullversion}" />
5307N/A
5307N/A <echo
5307N/A message="Building layout for ${svr4.name} pkg based on ${zip.dir}" />
5307N/A <!-- copy ZIP layout.
5307N/A Use exec instead of copy task to preserve file permissions -->
5307N/A <mkdir dir="${svr4.layout.dir}"/>
5307N/A <exec executable="cp">
5307N/A <arg value="-R"/>
5307N/A <arg value="${zip.dir}"/>
5307N/A <arg value="${svr4.layout.pkg.dir}"/>
5307N/A </exec>
5307N/A <!-- Remove Windows specific files -->
5307N/A <delete includeemptydirs="true">
5307N/A <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.exe"/>
5307N/A <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.bat"/>
5307N/A <fileset dir="${svr4.layout.pkg.dir}" includes="**/bat/"/>
5307N/A <fileset dir="${svr4.layout.pkg.dir}"
5307N/A includes="**/README_WINDOWS.txt"/>
5307N/A </delete>
5307N/A <!-- Remove MacOS specific files -->
5307N/A <delete includeemptydirs="true">
5307N/A <fileset dir="${svr4.layout.pkg.dir}" includes="**/*.app/" />
5307N/A </delete>
5307N/A <!-- Remove instance.loc file -->
5307N/A <delete file="${svr4.layout.pkg.dir}/instance.loc" />
5307N/A <!-- Remove uninstall file -->
5307N/A <delete file="${svr4.layout.pkg.dir}/uninstall" />
5307N/A <!-- Remove ZIP README / install files -->
5307N/A <delete file="${svr4.layout.pkg.dir}/README" />
5307N/A <delete file="${svr4.layout.pkg.dir}/install.txt" />
5307N/A <delete file="${svr4.layout.pkg.dir}/install.html" />
5307N/A <!-- Add SVR4 README / install files -->
5307N/A <copy file="${svr4.src.dir}/README"
5307N/A tofile="${svr4.layout.pkg.dir}/README" />
5307N/A <copy file="${svr4.src.dir}/install.txt"
5307N/A tofile="${svr4.layout.pkg.dir}/install.txt" />
5307N/A <copy file="${svr4.src.dir}/install.html"
5307N/A tofile="${svr4.layout.pkg.dir}/install.html" />
5307N/A <!-- Add svc-opendj.sh wrapper -->
5307N/A <copy file="${svr4.src.dir}/_svc-opendj.sh"
5307N/A tofile="${svr4.layout.pkg.dir}/lib/_svc-opendj.sh" />
5307N/A <chmod file="${svr4.layout.pkg.dir}/lib/_svc-opendj.sh" perm="755" />
5307N/A <!-- Add the SMF Manifest for OpenDJ in a resources directory -->
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/resources"/>
5307N/A <copy file="${svr4.src.dir}/opendj-manifest.xml"
5307N/A tofile="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml" />
5307N/A <chmod file="${svr4.layout.pkg.dir}/resources/opendj-manifest.xml"
5307N/A perm="644" />
5307N/A <!-- Add configure script -->
5307N/A <copy file="${resource.dir}/configure"
5307N/A tofile="${svr4.layout.pkg.dir}/configure" />
5307N/A <chmod file="${svr4.layout.pkg.dir}/configure" perm="744" />
5307N/A <!-- Add unconfigure script -->
5307N/A <copy file="${resource.dir}/unconfigure"
5307N/A tofile="${svr4.layout.pkg.dir}/unconfigure" />
5307N/A <chmod file="${svr4.layout.pkg.dir}/unconfigure" perm="744" />
5307N/A <!-- Add man pages -->
5307N/A <copy todir="${svr4.layout.pkg.dir}/man">
5307N/A <fileset dir="${resource.dir}/man"/>
5307N/A </copy>
5307N/A <!-- Replace zip upgrade script by svr4 upgrade script -->
5307N/A <delete file="${svr4.layout.pkg.dir}/upgrade" />
5307N/A <copy file="${resource.dir}/upgrade_svr4"
5307N/A tofile="${svr4.layout.pkg.dir}/upgrade" />
5307N/A <chmod file="${svr4.layout.pkg.dir}/upgrade" perm="755" />
5307N/A <!-- Move instance files in ${svr4.layout.pkg.dir}/tmpl_instance -->
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/tmpl_instance"/>
5307N/A <chmod dir="${svr4.layout.pkg.dir}/tmpl_instance" perm="755"/>
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/tmpl_instance/lib"/>
5307N/A <chmod dir="${svr4.layout.pkg.dir}/tmpl_instance/lib" perm="755"/>
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/tmpl_instance/lib/extensions"/>
5307N/A <chmod dir="${svr4.layout.pkg.dir}/tmpl_instance/lib/extensions"
5307N/A perm="755"/>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/bak">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/bak"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/changelogDb">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/changelogDb"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/classes">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/classes"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/config">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/config"/>
5307N/A </move>
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/config"/>
5307N/A <chmod dir="${svr4.layout.pkg.dir}/config" perm="755"/>
5307N/A <move todir="${svr4.layout.pkg.dir}/config/schema">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/tmpl_instance/config/schema"/>
5307N/A </move>
5307N/A <mkdir dir="${svr4.layout.pkg.dir}/tmpl_instance/config/schema"/>
5307N/A <chmod dir="${svr4.layout.pkg.dir}/tmpl_instance/config/schema"
5307N/A perm="755"/>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/db">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/db"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/import-tmp">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/import-tmp"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/ldif">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/ldif"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/locks">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/locks"/>
5307N/A </move>
5307N/A <move todir="${svr4.layout.pkg.dir}/tmpl_instance/logs">
5307N/A <fileset dir="${svr4.layout.pkg.dir}/logs"/>
5307N/A </move>
5307N/A <!-- Create buildinfo file -->
5307N/A <echo message="${svr4.version}.${REVISION_NUMBER}"
5307N/A file="${svr4.layout.pkg.dir}/tmpl_instance/config/buildinfo" />
5307N/A </target>
5307N/A
5307N/A</project>