| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <!-- |
|---|
| 3 | * LICENCE[[ |
|---|
| 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1/CeCILL 2.O |
|---|
| 5 | * |
|---|
| 6 | * The contents of this file are subject to the Mozilla Public License Version |
|---|
| 7 | * 1.1 (the "License"); you may not use this file except in compliance with |
|---|
| 8 | * the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ |
|---|
| 9 | * |
|---|
| 10 | * Software distributed under the License is distributed on an "AS IS" basis, |
|---|
| 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
|---|
| 12 | * for the specific language governing rights and limitations under the |
|---|
| 13 | * License. |
|---|
| 14 | * |
|---|
| 15 | * The Original Code is kelis.fr code. |
|---|
| 16 | * |
|---|
| 17 | * The Initial Developer of the Original Code is |
|---|
| 18 | * samuel.monsarrat@kelis.fr |
|---|
| 19 | * |
|---|
| 20 | * Portions created by the Initial Developer are Copyright (C) 2007 |
|---|
| 21 | * the Initial Developer. All Rights Reserved. |
|---|
| 22 | * |
|---|
| 23 | * Contributor(s): |
|---|
| 24 | * |
|---|
| 25 | * |
|---|
| 26 | * Alternatively, the contents of this file may be used under the terms of |
|---|
| 27 | * either of the GNU General Public License Version 2 or later (the "GPL"), |
|---|
| 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
|---|
| 29 | * or the CeCILL Licence Version 2.0 (http://www.cecill.info/licences.en.html), |
|---|
| 30 | * in which case the provisions of the GPL, the LGPL or the CeCILL are applicable |
|---|
| 31 | * instead of those above. If you wish to allow use of your version of this file |
|---|
| 32 | * only under the terms of either the GPL or the LGPL, and not to allow others |
|---|
| 33 | * to use your version of this file under the terms of the MPL, indicate your |
|---|
| 34 | * decision by deleting the provisions above and replace them with the notice |
|---|
| 35 | * and other provisions required by the GPL or the LGPL. If you do not delete |
|---|
| 36 | * the provisions above, a recipient may use your version of this file under |
|---|
| 37 | * the terms of any one of the MPL, the GPL, the LGPL or the CeCILL. |
|---|
| 38 | * ]]LICENCE |
|---|
| 39 | --> |
|---|
| 40 | <project name="Bui_postPackLin" default="All.distNoDefine" basedir="."> |
|---|
| 41 | <import file="${basedir}/properties.xml"/> |
|---|
| 42 | <import file="${basedir}/xBuildTools.xml"/> |
|---|
| 43 | |
|---|
| 44 | <!-- Post packaging work folder --> |
|---|
| 45 | <property name="app.work.path" value="${releasedir}/postPackLin/${distName}/${appFolder}"/> |
|---|
| 46 | |
|---|
| 47 | <!-- Post packaging source folder --> |
|---|
| 48 | <property name="app.src.path" value="${app.work.path}/src"/> |
|---|
| 49 | |
|---|
| 50 | <!-- Post packaging build folders --> |
|---|
| 51 | <property name="app.bui.path" value="${app.work.path}/bui"/> <!-- scenari application package --> |
|---|
| 52 | <property name="app.buiXul.path" value="${app.work.path}/buiXul"/> <!-- xulrunner package --> |
|---|
| 53 | <property name="app.buiSrv.path" value="${app.work.path}/buiSrv"/> <!-- scenari server package --> |
|---|
| 54 | <property name="app.buiData.path" value="${app.work.path}/buiData"/> <!-- scenari data package --> |
|---|
| 55 | |
|---|
| 56 | <!-- Run principal --> |
|---|
| 57 | <target name="All.distNoDefine"> |
|---|
| 58 | <echo message="Aucune distribution n'est spécifié." level="error"/> |
|---|
| 59 | </target> |
|---|
| 60 | |
|---|
| 61 | <target name="xInit.core"> |
|---|
| 62 | <echo message="Post-packaging Linux de ${app.name(fullName)} (${app.tgz.path})"/> |
|---|
| 63 | |
|---|
| 64 | <!-- Sanity checks --> |
|---|
| 65 | <fail message="Ce build doit être lancer sous un environnement UNIX"><condition><not><os family="unix"/></not></condition></fail> |
|---|
| 66 | <propertyregex property="app.tgz.ext" input="${app.tgz.path}" regexp="([^.]*)$" select="\1"/> |
|---|
| 67 | |
|---|
| 68 | <fail message="ATTENTION: le paramètre app.tgz.path doit pointer obligatoirement vers un fichier tgz !"> |
|---|
| 69 | <condition><or><not><equals arg1="${app.tgz.ext}" arg2="tgz" casesensitive="no"/></not><not><available file="${app.tgz.path}"/></not></or></condition> |
|---|
| 70 | </fail> |
|---|
| 71 | |
|---|
| 72 | <echo message="Init : décompression de ${app.tgz.path}"/> |
|---|
| 73 | <mkdir dir="${app.src.path}"/> |
|---|
| 74 | <antcall target="xUntar"> |
|---|
| 75 | <param name="pSourceTarPath" value="${app.tgz.path}"/> |
|---|
| 76 | <param name="pDestPath" value="${app.src.path}"/> |
|---|
| 77 | </antcall> |
|---|
| 78 | <delete> |
|---|
| 79 | <fileset dir="${app.src.path}" includes="**/*" excludes="${app.name}.tar.gz"/> |
|---|
| 80 | </delete> |
|---|
| 81 | <antcall target="xUntarDel"> |
|---|
| 82 | <param name="pSourceTarPath" value="${app.src.path}/${app.name}.tar.gz"/> |
|---|
| 83 | </antcall> |
|---|
| 84 | |
|---|
| 85 | <echo message="Init : décompression de xulrunner"/> |
|---|
| 86 | <antcall target="xUntarDel"> |
|---|
| 87 | <param name="pSourceTarPath" value="${app.src.path}/bin/xulrunner.tar.gz"/> |
|---|
| 88 | </antcall> |
|---|
| 89 | |
|---|
| 90 | <echo message="Init : configuration de xulrunner"/> |
|---|
| 91 | <move file="${app.src.path}/bin/xulrunner/xulrunner" tofile="${app.src.path}/bin/xulrunner/scenari"/> |
|---|
| 92 | <move file="${app.src.path}/bin/xulrunner/xulrunner-bin" tofile="${app.src.path}/bin/xulrunner/scenari-bin"/> |
|---|
| 93 | <delete file="${app.src.path}/bin/xulrunner/xulrunner-stub"/> |
|---|
| 94 | |
|---|
| 95 | <if><available file="${app.src.path}/bin/scServer/jre/jre.tar.gz" type="file"/> |
|---|
| 96 | <then> |
|---|
| 97 | <echo message="Init : décompression de la jre interne"/> |
|---|
| 98 | <antcall target="xUntarDel"> |
|---|
| 99 | <param name="pSourceTarPath" value="${app.src.path}/bin/scServer/jre/jre.tar.gz"/> |
|---|
| 100 | </antcall> |
|---|
| 101 | </then> |
|---|
| 102 | <else> |
|---|
| 103 | <echo message="Init : ${app.name} ne contient pas de JRE embarqué"/> |
|---|
| 104 | </else> |
|---|
| 105 | </if> |
|---|
| 106 | |
|---|
| 107 | <echo message="Init : modifications chmod (passage en 755 d'executables)..."/> |
|---|
| 108 | <if><available file="${app.src.path}/bin/scServer/nativlib" type="dir"/> |
|---|
| 109 | <then> |
|---|
| 110 | <chmod perm="755" dir="${app.src.path}/bin/scServer/nativlib" includes="*"/> |
|---|
| 111 | </then> |
|---|
| 112 | </if> |
|---|
| 113 | </target> |
|---|
| 114 | |
|---|
| 115 | <target name="xCleanup.core"> |
|---|
| 116 | <delete dir="${app.work.path}"/> |
|---|
| 117 | </target> |
|---|
| 118 | |
|---|
| 119 | <target name="xBuildExtraProps.core" description="Build extra name and version properties if needed"> |
|---|
| 120 | <!-- versions --> |
|---|
| 121 | <property name="app.version(minor).length" value="1"/> |
|---|
| 122 | <propertyregex property="app.version(major)" input="${app.version}" regexp="([0-9]+)\.[0-9]+\.[0-9]+" select="\1"/> |
|---|
| 123 | <propertyregex property="app.version(medium)" input="${app.version}" regexp="[0-9]+\.([0-9]+)\.[0-9]+" select="\1"/> |
|---|
| 124 | <propertyregex property="app.version(minor)" input="${app.version}" regexp="[0-9]+\.[0-9]+\.([0-9]+)" select="\1"/> |
|---|
| 125 | <!-- gestion des chiffres significatifs de vMineur --> |
|---|
| 126 | <propertyregex property="app.version(minor).begin" input="${app.version(minor)}" regexp="([0-9]{${app.version(minor).length}})" select="\1"/> |
|---|
| 127 | <propertyregex property="app.version(minor).end" input="${app.version(minor)}" regexp="[0-9]{${app.version(minor).length}}([0-9]*)" select="\1"/> |
|---|
| 128 | <condition property="app.version(full)" value="${app.version}" else="${app.version(major)}.${app.version(medium)}.${app.version(minor).begin}.${app.version(minor).end}"><equals arg1="${app.version(minor).length}" arg2="0"/></condition><!-- on transforme la vMineure en ww.yy --> |
|---|
| 129 | |
|---|
| 130 | <condition property="isNightly" value="true"><equals arg1="${app.version(developmentStage)}" arg2="nightly"/></condition> |
|---|
| 131 | <condition property="isNightly" value="false"><not><isset property="isNightly"/></not></condition> |
|---|
| 132 | |
|---|
| 133 | <!-- names --> |
|---|
| 134 | <property name="app.name(shortName)" value="${app.name}"/> |
|---|
| 135 | <property name="app.name(fullName)" value="${app.name} ${app.version(major)}.${app.version(medium)}"/> |
|---|
| 136 | </target> |
|---|
| 137 | |
|---|
| 138 | <target name="xDefaultLibs.core" description="Define the default names and version numbers for the libs"> |
|---|
| 139 | <property name="lib.xul.name" value="LIB${app.publisher}xul"/> |
|---|
| 140 | <property name="lib.xul.version" value="${app.version}"/> |
|---|
| 141 | <property name="lib.xul.version(major)" value="${app.version(major)}"/> |
|---|
| 142 | <property name="lib.xul.version(medium)" value="${app.version(medium)}"/> |
|---|
| 143 | |
|---|
| 144 | <property name="lib.srv.name" value="LIB${app.publisher}srv"/> |
|---|
| 145 | <property name="lib.srv.version" value="${app.version}"/> |
|---|
| 146 | <property name="lib.srv.version(major)" value="${app.version(major)}"/> |
|---|
| 147 | <property name="lib.srv.version(medium)" value="${app.version(medium)}"/> |
|---|
| 148 | |
|---|
| 149 | <property name="lib.data.name" value="LIB${app.publisher}-data"/> |
|---|
| 150 | <property name="lib.data.version" value="${app.version}"/> |
|---|
| 151 | </target> |
|---|
| 152 | |
|---|
| 153 | <target name="xBuildNames.core" description="Build upper case names, lower case names and package names"> |
|---|
| 154 | <!-- Main App package names --> |
|---|
| 155 | <exec executable="sh" outputproperty="app.name(lowerCase)" failonerror="true"> |
|---|
| 156 | <arg line="-c 'echo ${app.name} | tr "[:upper:]" "[:lower:]"'"/> |
|---|
| 157 | </exec> |
|---|
| 158 | <exec executable="sh" outputproperty="app.name(upperCase)" failonerror="true"> |
|---|
| 159 | <arg line="-c 'echo ${app.name} | tr "[:lower:]" "[:upper:]"'"/> |
|---|
| 160 | </exec> |
|---|
| 161 | <property name="app.name(dist)" value="${app.name(lowerCase)}${app.version(major)}.${app.version(medium)}"/> |
|---|
| 162 | <property name="app.version(dist)" value="${app.version}-${dist.version.suffix}"/> |
|---|
| 163 | |
|---|
| 164 | <!-- XUL lib package names --> |
|---|
| 165 | <exec executable="sh" outputproperty="lib.xul.name(lowerCase)" failonerror="true"> |
|---|
| 166 | <arg line="-c 'echo ${lib.xul.name} | tr "[:upper:]" "[:lower:]"'"/> |
|---|
| 167 | </exec> |
|---|
| 168 | <exec executable="sh" outputproperty="lib.xul.name(upperCase)" failonerror="true"> |
|---|
| 169 | <arg line="-c 'echo ${lib.xul.name} | tr "[:lower:]" "[:upper:]"'"/> |
|---|
| 170 | </exec> |
|---|
| 171 | <property name="lib.xul.name(dist)" value="${lib.xul.name(lowerCase)}${lib.xul.version(major)}.${lib.xul.version(medium)}"/> |
|---|
| 172 | <property name="lib.xul.version(dist)" value="${lib.xul.version}-${dist.version.suffix.xul}"/> |
|---|
| 173 | |
|---|
| 174 | <!-- Server lib package names --> |
|---|
| 175 | <exec executable="sh" outputproperty="lib.srv.name(lowerCase)" failonerror="true"> |
|---|
| 176 | <arg line="-c 'echo ${lib.srv.name} | tr "[:upper:]" "[:lower:]"'"/> |
|---|
| 177 | </exec> |
|---|
| 178 | <exec executable="sh" outputproperty="lib.srv.name(upperCase)" failonerror="true"> |
|---|
| 179 | <arg line="-c 'echo ${lib.srv.name} | tr "[:lower:]" "[:upper:]"'"/> |
|---|
| 180 | </exec> |
|---|
| 181 | <property name="lib.srv.name(dist)" value="${lib.srv.name(lowerCase)}${lib.srv.version(major)}.${lib.srv.version(medium)}"/> |
|---|
| 182 | |
|---|
| 183 | <!-- Data lib package names --> |
|---|
| 184 | <if><isset property="lib.data.name"/> |
|---|
| 185 | <then> |
|---|
| 186 | <exec executable="sh" outputproperty="lib.data.name(lowerCase)" failonerror="true"> |
|---|
| 187 | <arg line="-c 'echo ${lib.data.name} | tr "[:upper:]" "[:lower:]"'"/> |
|---|
| 188 | </exec> |
|---|
| 189 | <exec executable="sh" outputproperty="lib.data.name(upperCase)" failonerror="true"> |
|---|
| 190 | <arg line="-c 'echo ${lib.data.name} | tr "[:lower:]" "[:upper:]"'"/> |
|---|
| 191 | </exec> |
|---|
| 192 | <property name="lib.data.name(dist)" value="${lib.data.name(lowerCase)}"/> |
|---|
| 193 | <property name="lib.data.version(dist)" value="${lib.data.version}-${dist.version.suffix}"/> |
|---|
| 194 | </then> |
|---|
| 195 | </if> |
|---|
| 196 | </target> |
|---|
| 197 | |
|---|
| 198 | </project> |
|---|