1
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2
~ Copyright (c) 2009 Eucalyptus Systems, Inc.
4
~ This program is free software: you can redistribute it and/or modify
5
~ it under the terms of the GNU General Public License as published by
6
~ the Free Software Foundation, only version 3 of the License.
9
~ This file is distributed in the hope that it will be useful, but WITHOUT
10
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
~ You should have received a copy of the GNU General Public License along
15
~ with this program. If not, see http://www.gnu.org/licenses/.
17
~ Please contact Eucalyptus Systems, Inc., 130 Castilian
18
~ Dr., Goleta, CA 93101 USA or visit http://www.eucalyptus.com/licenses/
19
~ if you need additional information or have any questions.
21
~ This file may incorporate work covered under the following copyright and
24
~ Software License Agreement (BSD License)
26
~ Copyright (c) 2008, Regents of the University of California
27
~ All rights reserved.
29
~ Redistribution and use of this software in source and binary forms, with
30
~ or without modification, are permitted provided that the following
33
~ Redistributions of source code must retain the above copyright notice,
34
~ this list of conditions and the following disclaimer.
36
~ Redistributions in binary form must reproduce the above copyright
37
~ notice, this list of conditions and the following disclaimer in the
38
~ documentation and/or other materials provided with the distribution.
40
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
41
~ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
42
~ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
43
~ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
44
~ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45
~ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
46
~ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
47
~ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
48
~ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
49
~ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. USERS OF
51
~ THIS SOFTWARE ACKNOWLEDGE THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE
52
~ LICENSED MATERIAL, COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS
53
~ SOFTWARE, AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING
54
~ IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA, SANTA
55
~ BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY, WHICH IN
56
~ THE REGENTS’ DISCRETION MAY INCLUDE, WITHOUT LIMITATION, REPLACEMENT
57
~ OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO IDENTIFIED, OR
58
~ WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT NEEDED TO COMPLY WITH
59
~ ANY SUCH LICENSES OR RIGHTS.
60
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
~ Author: chris grzegorczyk grze@eucalyptus.com
64
<project name="eucalyptus" basedir=".">
65
<property environment="localenv" />
66
<property name="euca.home.0" value="${localenv.EUCALYPTUS}" />
67
<condition property="euca.home" value="/opt/eucalyptus" else="${localenv.EUCALYPTUS}">
68
<contains string="${euca.home.0}" substring="localenv" />
70
<property name="DESTDIR.0" value="${localenv.DESTDIR}" />
71
<condition property="DESTDIR" value="/" else="${localenv.DESTDIR}">
72
<contains string="${DESTDIR.0}" substring="localenv" />
74
<property name="project.basedir" value="${user.dir}" />
75
<loadfile srcfile="${project.basedir}/../VERSION" property="euca.version">
77
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
80
<!--================================== other vars ==================================-->
81
<property name="jvm.heap" value="256m" />
82
<property name="deps.url" value="http://eucalyptussoftware.com/downloads/dependencies/${euca.version}" />
83
<property name="deps.dir" value="deps" />
84
<property name="deps.lib.dir" value="lib" />
85
<property name="tools.dir" value="tools/src" />
86
<property name="deps.lib" value="cloud-lib" />
87
<property name="bind.timestamp" value="target/.bind-timestamp" />
88
<!--================================== build targets ==================================-->
90
<ant dir="modules/msgs" inheritall="false" target="builder" />
91
<ant dir="modules/database" inheritall="false" target="builder" />
92
<ant dir="modules/hsqldb" inheritall="false" target="builder" />
93
<ant dir="modules/authentication" inheritall="false" target="builder" />
94
<ant dir="modules/cloud" inheritall="false" target="builder" />
95
<ant dir="modules/configuration" inheritall="false" target="builder" />
96
<ant dir="modules/core" inheritall="false" target="builder" />
97
<ant dir="modules/wsstack" inheritall="false" target="builder" />
98
<ant dir="modules/component" inheritall="false" target="builder" />
99
<ant dir="modules/interface" inheritall="false" target="builder" />
100
<ant dir="modules/group-manager" inheritall="false" target="builder" />
101
<ant dir="modules/cluster-manager" inheritall="false" target="builder" />
102
<ant dir="modules/image-manager" inheritall="false" target="builder" />
103
<ant dir="modules/key-manager" inheritall="false" target="builder" />
104
<ant dir="modules/storage-common" inheritall="false" target="builder" />
105
<ant dir="modules/walrus" inheritall="false" target="builder" />
106
<ant dir="modules/storage-controller" inheritall="false" target="builder" />
107
<ant dir="modules/dns" inheritall="false" target="builder" />
108
<ant dir="modules/www" inheritall="false" target="builder" />
109
<ant dir="." inheritall="false" target="jar" />
111
<target name="jar" depends="bind">
112
<ant dir="modules/msgs" inheritall="false" target="jar" />
113
<ant dir="modules/database" inheritall="false" target="jar" />
114
<ant dir="modules/hsqldb" inheritall="false" target="jar" />
115
<ant dir="modules/authentication" inheritall="false" target="jar" />
116
<ant dir="modules/cloud" inheritall="false" target="jar" />
117
<ant dir="modules/configuration" inheritall="false" target="jar" />
118
<ant dir="modules/component" inheritall="false" target="jar" />
119
<ant dir="modules/core" inheritall="false" target="jar" />
120
<ant dir="modules/wsstack" inheritall="false" target="jar" />
121
<ant dir="modules/interface" inheritall="false" target="jar" />
122
<ant dir="modules/group-manager" inheritall="false" target="jar" />
123
<ant dir="modules/cluster-manager" inheritall="false" target="jar" />
124
<ant dir="modules/image-manager" inheritall="false" target="jar" />
125
<ant dir="modules/key-manager" inheritall="false" target="jar" />
126
<ant dir="modules/storage-common" inheritall="false" target="jar" />
127
<ant dir="modules/walrus" inheritall="false" target="jar" />
128
<ant dir="modules/storage-controller" inheritall="false" target="jar" />
129
<ant dir="modules/dns" inheritall="false" target="jar" />
130
<ant dir="modules/www" inheritall="false" target="jar" />
132
<target name="shouldBind">
133
<uptodate property="bind.notRequired" targetfile="${bind.timestamp}">
134
<srcfiles dir="modules">
135
<include name="**/*.java"/>
138
<echo message="[BINDING] Up-to-date check shows bind.notRequred=${bind.notRequired}." />
140
<target name="bind" depends="shouldBind" unless="bind.notRequired">
141
<echo message="[BINDING] Running binding compiler." />
142
<path id="bindingclasspath">
143
<dirset dir="modules">
144
<include name="**/build" />
147
<include name="**/*.jar" />
151
<fileset dir="modules" includes="**/*JiBX*" />
153
<delete file="modules/msgs/src/main/resources/msgs-binding.xml" />
154
<taskdef name="bindings" classname="com.eucalyptus.binding.BuildBindings" classpathref="bindingclasspath" />
156
<classfileset dir="${project.basedir}/modules" includes="*/build/**" />
157
<bindingfileset dir="${project.basedir}/modules" includes="**/*-binding.xml" />
159
<touch file="${bind.timestamp}"/>
162
<!--================================== clean targets ==================================-->
163
<target name="clean">
164
<delete file="${bind.timestamp}"/>
165
<ant dir="modules/msgs" inheritall="false" target="clean" />
166
<ant dir="modules/database" inheritall="false" target="clean" />
167
<ant dir="modules/hsqldb" inheritall="false" target="clean" />
168
<ant dir="modules/cloud" inheritall="false" target="clean" />
169
<ant dir="modules/authentication" inheritall="false" target="clean" />
170
<ant dir="modules/configuration" inheritall="false" target="clean" />
171
<ant dir="modules/component" inheritall="false" target="clean" />
172
<ant dir="modules/core" inheritall="false" target="clean" />
173
<ant dir="modules/wsstack" inheritall="false" target="clean" />
174
<ant dir="modules/interface" inheritall="false" target="clean" />
175
<ant dir="modules/cluster-manager" inheritall="false" target="clean" />
176
<ant dir="modules/image-manager" inheritall="false" target="clean" />
177
<ant dir="modules/group-manager" inheritall="false" target="clean" />
178
<ant dir="modules/key-manager" inheritall="false" target="clean" />
179
<ant dir="modules/storage-common" inheritall="false" target="clean" />
180
<ant dir="modules/walrus" inheritall="false" target="clean" />
181
<ant dir="modules/storage-controller" inheritall="false" target="clean" />
182
<ant dir="modules/dns" inheritall="false" target="clean" />
183
<ant dir="modules/www" inheritall="false" target="clean" />
184
<delete dir="${target.dir}" />
186
<target name="distclean" depends="clean">
187
<delete dir="${deps.dir}" />
188
<delete dir="${deps.lib.dir}" />
189
<delete dir="target" />
191
<!--================================== install target ==================================-->
192
<property name="euca.conf.dir" value="${euca.home}/etc/eucalyptus/cloud.d" />
193
<property name="euca.lib.dir" value="${euca.home}/usr/share/eucalyptus" />
194
<property name="euca.var.dir" value="${euca.home}/var/lib/eucalyptus" />
195
<property name="euca.run.dir" value="${euca.home}/var/run/eucalyptus" />
196
<property name="euca.log.dir" value="${euca.home}/var/log/eucalyptus" />
197
<property name="euca.bin.dir" value="${euca.home}/usr/sbin" />
198
<target name="install">
199
<!-- copy libraries over -->
200
<mkdir dir="${DESTDIR}${euca.lib.dir}" />
201
<copy todir="${DESTDIR}${euca.lib.dir}" overwrite="true">
202
<fileset dir="${deps.lib.dir}">
203
<include name="**/*" />
204
<exclude name="**/gwt-api-checker-*.jar" />
205
<exclude name="**/gwt-dev-*.jar" />
206
<exclude name="**/gwt-soyc-vis-*.jar" />
207
<exclude name="**/gwt-user-*.jar" />
210
<!--copy admin tools -->
211
<mkdir dir="${DESTDIR}${euca.bin.dir}" />
212
<copy todir="${DESTDIR}${euca.bin.dir}" overwrite="true">
213
<fileset dir="${tools.dir}">
214
<include name="**/*" />
217
<chmod dir="${DESTDIR}${euca.bin.dir}" perm="0755">
218
<include name="**/euca-*" />
220
<mkdir dir="${DESTDIR}${euca.conf.dir}" />
221
<chmod dir="${DESTDIR}${euca.conf.dir}" perm="0755" />
222
<mkdir dir="${DESTDIR}${euca.var.dir}/" />
223
<mkdir dir="${DESTDIR}${euca.var.dir}/db" />
224
<mkdir dir="${DESTDIR}${euca.var.dir}/keys" />
225
<mkdir dir="${DESTDIR}${euca.log.dir}" />
226
<mkdir dir="${DESTDIR}${euca.var.dir}/webapps" />
227
<mkdir dir="${DESTDIR}${euca.var.dir}/modules" />
228
<mkdir dir="${DESTDIR}${euca.run.dir}" />
229
<ant dir="modules/msgs" inheritall="false" target="install" />
230
<ant dir="modules/database" inheritall="false" target="install" />
231
<ant dir="modules/hsqldb" inheritall="false" target="install" />
232
<ant dir="modules/cloud" inheritall="false" target="install" />
233
<ant dir="modules/authentication" inheritall="false" target="install" />
234
<ant dir="modules/configuration" inheritall="false" target="install" />
235
<ant dir="modules/component" inheritall="false" target="install" />
236
<ant dir="modules/core" inheritall="false" target="install" />
237
<ant dir="modules/wsstack" inheritall="false" target="install" />
238
<ant dir="modules/storage-common" inheritall="false" target="install" />
239
<ant dir="modules/interface" inheritall="false" target="install" />
240
<ant dir="modules/cluster-manager" inheritall="false" target="install" />
241
<ant dir="modules/image-manager" inheritall="false" target="install" />
242
<ant dir="modules/group-manager" inheritall="false" target="install" />
243
<ant dir="modules/key-manager" inheritall="false" target="install" />
244
<ant dir="modules/walrus" inheritall="false" target="install" />
245
<ant dir="modules/storage-controller" inheritall="false" target="install" />
246
<ant dir="modules/dns" inheritall="false" target="install" />
247
<ant dir="modules/www" inheritall="false" target="install" />
249
<!--================================== unzipping target ==================================-->
251
<condition property="needDownload">
254
<available file="${deps.lib.dir}/bcprov.jar" />
258
<available file="${deps.dir}/${deps.lib}.tar.gz" />
263
<ant target="download-deps" />
264
<condition property="needUnzipping">
267
<available file="${deps.lib.dir}/bcprov.jar" />
270
<available file="${deps.dir}/${deps.lib}.tar.gz" />
274
<ant target="untar" />
276
<target name="dist-deps" depends="deps">
277
<delete dir="${deps.dir}" />
279
<target name="untar" if="needUnzipping">
280
<untar compression="gzip" src="${deps.dir}/${deps.lib}.tar.gz" dest="${deps.lib.dir}" />
282
<target name="download-deps" if="needDownload">
283
<mkdir dir="${deps.dir}" />
284
<mkdir dir="${deps.lib.dir}" />
285
<!--=========== download the dependency libraries ===========-->
286
<get src="${deps.url}/${deps.lib}.tar.gz" dest="${deps.dir}/${deps.lib}.tar.gz" />