Package webwork: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
Packager: Igor Vlasenko <viy@altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2009, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define gcj_support 0


Summary:        Web application framework for J2EE
Name:           webwork
Version:        2.2.7
Release:        alt2_1jpp5
Epoch:          0
License:        Apache Software License modified
URL:            http://www.opensymphony.com/webwork/
Group:          Development/Java
Source0:        webwork-2.2.7.zip
Source1:        webwork-LICENSE.txt
Patch0:         webwork-2.2.7-TilesResult.patch
Patch1:         webwork-2.2.7-PellMultiPartRequest.patch
Patch2:         webwork-2.2.7-ApplyDecoratorBean.patch
Patch3:         webwork-2.2.7-PlexusObjectFactory.patch
Patch4:         webwork-2.2.7-osbuild.patch
Patch5:         webwork-2.2.7-WebWorkMockPageContext.patch
Patch6:         webwork-2.2.7-MockFactory.patch

BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: ant >= 0:1.6.5
BuildRequires: ant-junit
BuildRequires: ant-nodeps
BuildRequires: ant-trax
BuildRequires: antlr
BuildRequires: ivy
BuildRequires: junit >= 0:3.8.1
BuildRequires: jsch
BuildRequires: mockobjects
BuildRequires: mockobjects-alt-jdk1.4
BuildRequires: mockobjects-jdk1.4
BuildRequires: mockobjects-jdk1.4-j2ee1.4
BuildRequires: xmlunit
#
BuildRequires: asm
BuildRequires: cewolf
BuildRequires: cglib
BuildRequires: classworlds
BuildRequires: dom4j
BuildRequires: dwr
BuildRequires: ecj
BuildRequires: ehcache
BuildRequires: freemarker
BuildRequires: hibernate3
BuildRequires: itext
BuildRequires: jakarta-commons-attributes
BuildRequires: jakarta-commons-beanutils
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-digester
BuildRequires: jakarta-commons-el
BuildRequires: jakarta-commons-fileupload
BuildRequires: jakarta-commons-io
BuildRequires: jakarta-commons-lang
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-poi
BuildRequires: jakarta-taglibs-standard
BuildRequires: jasperreports >= 0:1.0.0
BuildRequires: javamail_1_3_1_api
BuildRequires: javassist
BuildRequires: jcommon
BuildRequires: jetty5
BuildRequires: jfreechart >= 0:0.9.21
BuildRequires: jsp_2_0_api
BuildRequires: log4j
BuildRequires: nanocontainer
BuildRequires: nanocontainer-nanowar
BuildRequires: ognl
BuildRequires: oscore
BuildRequires: pell-multipart
BuildRequires: picocontainer
BuildRequires: plexus-container-default
BuildRequires: plexus-utils
BuildRequires: rife-continuations
BuildRequires: servlet_2_4_api
BuildRequires: sitemesh >= 0:2.4.1
BuildRequires: spring-aop
BuildRequires: spring-beans
BuildRequires: spring-context
BuildRequires: spring-core
BuildRequires: spring-mock
BuildRequires: spring-web
BuildRequires: struts-tiles
BuildRequires: tiles
BuildRequires: tomcat5-jasper
BuildRequires: velocity14
BuildRequires: velocity-tools12
BuildRequires: xdoclet
BuildRequires: xjavadoc
BuildRequires: xml-commons-jaxp-1.3-apis
BuildRequires: xstream
BuildRequires: xwork >= 0:1.2.1

Requires: dwr
Requires: ecj
Requires: freemarker
Requires: jakarta-commons-collections
Requires: jakarta-commons-fileupload
Requires: jakarta-commons-io
Requires: jakarta-commons-lang
Requires: jakarta-commons-logging
Requires: jasperreports >= 0:1.0.0
Requires: jcommon
Requires: jetty5
Requires: jfreechart
Requires: jsp_2_0_api
Requires: nanocontainer-nanowar
Requires: ognl
Requires: oscore
Requires: pell-multipart
Requires: picocontainer
Requires: plexus-container-default
Requires: portlet_1_0_api
Requires: rife-continuations
Requires: servlet_2_4_api
Requires: sitemesh >= 0:2.4.1
Requires: spring-beans
Requires: spring-context
Requires: spring-core
Requires: spring-web
Requires: struts-tiles
Requires: velocity14
Requires: xml-commons-jaxp-1.3-apis
Requires: xstream
Requires: xwork >= 0:1.2.1
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%if ! %{gcj_support}
BuildArch:      noarch
%endif

%description
WebWork is a Java web-application development framework. 
It is built specifically with developer productivity and 
code simplicity in mind. WebWork is built on top of XWork, 
which provides a generic command pattern framework as well 
as an Inversion of Control container. In addition to these 
features, WebWork provides robust support for building 
reusable UI templates, such as form controls, UI themes, 
internationalization, dynamic form parameter mapping to 
JavaBeans, robust client and server side validation, 
and much more. 

%package multipart
Summary:        Multipart support for %{name}
Group:          Development/Java
Requires: pell-multipart

%description multipart
%{summary}.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation
BuildArch: noarch

%description javadoc
%{summary}.

%package manual
Summary:        Documents for %{name}
Group:          Development/Documentation
BuildArch: noarch

%description manual
%{summary}.

%prep
%setup -q 
for j in $(find . -name "*.jar"); do
  mv $j $j.no
done
mv lib/source/xwork-src.jar.no lib/source/xwork-src.jar
# Remove example with db4o, this lib is non-free, commercial only
rm -rf src/main/webwork/examples/userreg
# Remove cos-multipart implementation, pell-multipart will do it
rm src/java/com/opensymphony/webwork/dispatcher/multipart/CosMultiPartRequest.java
####cp src/example/log4j.properties src/test/log4j.properties
# this test fails
rm src/test/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptorTest.java

%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6

# old xmlunit :(
rm ./src/test/com/opensymphony/webwork/views/jsp/ui/AbstractRichtexteditorTest.java
rm ./src/test/com/opensymphony/webwork/views/jsp/ui/RichtexteditorGetFoldersResultTest.java
rm ./src/test/com/opensymphony/webwork/views/jsp/ui/RichtexteditorGetFoldersAndFilesResultTest.java
rm ./src/test/com/opensymphony/webwork/views/jsp/ui/Richtexteditor*.java

rm ./src/test/com/opensymphony/webwork/dispatcher/json/XMLTest.java


%build
export OPT_JAR_LIST="ant/ant-nodeps ant/ant-trax ant/ant-junit junit"
pushd lib/ajax
ln -sf $(build-classpath dwr)
popd
pushd lib/bootstrap
#lib/bootstrap/clover-license.jar.no
ln -sf $(build-classpath commons-cli)
ln -sf $(build-classpath commons-codec)
ln -sf $(build-classpath commons-httpclient)
ln -sf $(build-classpath commons-logging)
ln -sf $(build-classpath ivy)
popd
pushd lib/build
#lib/build/clover.jar.no
ln -sf $(build-classpath easymock-classextension)
ln -sf $(build-classpath easymock)
ln -sf $(build-classpath jmock-cglib)
ln -sf $(build-classpath jmock)
ln -sf $(build-classpath junit)
ln -sf $(build-classpath mockobjects-jdk1.4-j2ee1.4)
ln -sf $(build-classpath mockobjects-alt-jdk1.4)
ln -sf $(build-classpath mockobjects-jdk1.4)
ln -sf $(build-classpath mockobjects-core)
ln -sf $(build-classpath servlet_2_3_api)
ln -sf $(build-classpath xdoclet/xdoclet)
ln -sf $(build-classpath xdoclet/xdoclet-web-module)
ln -sf $(build-classpath xjavadoc)
ln -sf $(build-classpath xmlunit)
popd
pushd lib/cewolf
ln -sf $(build-classpath cewolf) 
popd
pushd lib/default
ln -sf $(build-classpath commons-logging)
ln -sf $(build-classpath freemarker)
ln -sf $(build-classpath javamail_1_3_1_api) javamail.jar
ln -sf $(build-classpath javassist)
ln -sf $(build-classpath ognl)
ln -sf $(build-classpath oscore)
ln -sf $(build-classpath rife-continuations)
ln -sf $(build-classpath xwork)
popd
pushd lib/fileupload
ln -sf $(build-classpath commons-fileupload)
popd
pushd lib/fileupload-cos
#lib/fileupload-cos/cos.jar.no
popd
pushd lib/fileupload-pell
ln -sf $(build-classpath pell-multipart) multipartrequest.jar
popd
pushd lib/hibernate
ln -sf $(build-classpath antlr)
ln -sf $(build-classpath asm/asm)
ln -sf $(build-classpath cglib)
ln -sf $(build-classpath commons-collections)
ln -sf $(build-classpath commons-logging)
ln -sf $(build-classpath dom4j)
ln -sf $(build-classpath ehcache)
ln -sf $(build-classpath hibernate3) hibernate.jar
popd
pushd lib/jasperreports
ln -sf $(build-classpath commons-beanutils)
ln -sf $(build-classpath commons-collections)
ln -sf $(build-classpath commons-digester)
ln -sf $(build-classpath itext)
ln -sf $(build-classpath jasperreports)
ln -sf $(build-classpath poi)
popd
pushd lib/jfree
ln -sf $(build-classpath jcommon)
ln -sf $(build-classpath jfreechart)
popd
pushd lib/pico
ln -sf $(build-classpath nanocontainer/container) nanocontainer.jar
ln -sf $(build-classpath nanocontainer-nanowar)
ln -sf $(build-classpath picocontainer-gems)
ln -sf $(build-classpath picocontainer)
popd
pushd lib/plexus
ln -sf $(build-classpath classworlds)
ln -sf $(build-classpath plexus/container-default)
ln -sf $(build-classpath plexus/utils)
popd
pushd lib/portlet
ln -sf $(build-classpath portlet_1_0_api) portlet-api.jar
popd
pushd lib/quickstart
ln -sf $(build-classpath ant)
ln -sf $(build-classpath commons-collections)
ln -sf $(build-classpath commons-el)
ln -sf $(build-classpath commons-io)
ln -sf $(build-classpath commons-lang)
ln -sf $(build-classpath jasper5-compiler) jasper-compiler.jar
ln -sf $(build-classpath ecj) jasper-compiler-jdt.jar
ln -sf $(build-classpath jasper5-runtime) jasper-runtime.jar
ln -sf $(build-classpath jsp_2_0_api) jsp-api.jar
ln -sf $(build-classpath log4j)
ln -sf $(build-classpath jetty5/jetty5) org.mortbay.jetty.jar
ln -sf $(build-classpath servlet_2_4_api) servlet-api.jar
ln -sf $(build-classpath xstream)
popd
pushd lib/sitemesh
ln -sf $(build-classpath sitemesh)
popd
pushd lib/source
#lib/source/xwork-src.jar.no
popd
pushd lib/spring
ln -sf $(build-classpath cglib-nodep)
ln -sf $(build-classpath commons-attributes-api)
ln -sf $(build-classpath commons-logging)
ln -sf $(build-classpath spring/aop) spring-aop.jar
ln -sf $(build-classpath spring/beans) spring-beans.jar
ln -sf $(build-classpath spring/context) spring-context.jar
ln -sf $(build-classpath spring/core) spring-core.jar
ln -sf $(build-classpath spring/mock) spring-mock.jar
ln -sf $(build-classpath spring/web) spring-web.jar
popd
pushd lib/tiger
ln -sf $(build-classpath xwork)
popd
pushd lib/tiles
ln -sf $(build-classpath commons-beanutils)
ln -sf $(build-classpath commons-digester)
ln -sf $(build-classpath struts-tiles)
ln -sf $(build-classpath tiles/api) tiles-api.jar
ln -sf $(build-classpath tiles/core) tiles-core.jar
popd
pushd lib/velocity
ln -sf $(build-classpath commons-collections)
ln -sf $(build-classpath velocity14) velocity-dep.jar
ln -sf $(build-classpath velocity-tools12-view) velocity-tools-view.jar
popd
pushd lib/xslt
ln -sf $(build-classpath xml-commons-jaxp-1.3-apis) dom.jar
ln -sf $(build-classpath jcommon)
popd

ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
	-Dant.javadoc.maxmemory=128m \
	-Dbuild.sysclasspath=first dist

mkdir tmp
cd tmp
jar xf ../dist/%{name}-%{version}.jar
jar cf ../dist/%{name}-multipart-%{version}.jar \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest\$1.class \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequestWrapper.class \
com/opensymphony/webwork/dispatcher/multipart/PellMultiPartRequest.class
rm \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest\$1.class \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequestWrapper.class \
com/opensymphony/webwork/dispatcher/multipart/PellMultiPartRequest.class
jar cmf META-INF/MANIFEST.MF ../dist/%{name}-%{version}.jar *
rm -rf *
#
jar xf ../dist/dist/%{name}-nostatic-%{version}.jar
rm \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest\$1.class \
com/opensymphony/webwork/dispatcher/multipart/JakartaMultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequest.class \
com/opensymphony/webwork/dispatcher/multipart/MultiPartRequestWrapper.class \
com/opensymphony/webwork/dispatcher/multipart/PellMultiPartRequest.class
jar cmf META-INF/MANIFEST.MF ../dist/dist/%{name}-nostatic-%{version}.jar *
cd ..
rm -rf tmp

# hack to help match manuals on both arches;
# seems to be a bug in manual
rm -rf dist/docs/junit

%install

# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}

install -m 644 dist/%{name}-%{version}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
install -m 644 dist/%{name}-multipart-%{version}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-multipart-%{version}.jar
install -m 644 dist/dist/%{name}-nostatic-%{version}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-nostatic-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
install -m 644 dist/dist/%{name}-static-%{version}.zip $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
cp -pr dist/webapps $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}

# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
rm -rf build/dist/docs/api

# manual
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -pr dist/docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp %{SOURCE1} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/LICENSE.txt

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

# It is the file in the package named Thumbs.db or Thumbs.db.gz, 
# which is normally a Windows image thumbnail database. 
# Such databases are generally useless in packages and were usually 
# accidentally included by copying complete directories from the source tarball.
find $RPM_BUILD_ROOT \( -name 'Thumbs.db' -o -name 'Thumbs.db.gz' \) -print -delete

%files
%doc %{_docdir}/%{name}-%{version}/LICENSE.txt
%{_datadir}/%{name}-%{version}
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-nostatic-%{version}.jar
%{_javadir}/%{name}-nostatic.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-*%{version}.jar.*
%{_libdir}/gcj/%{name}/webflow-%{version}.jar.*
%endif
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files multipart
%{_javadir}/%{name}-multipart*.jar

%files javadoc
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}

%files manual
%doc %{_docdir}/%{name}-%{version}

%changelog
* Wed Nov 03 2010 Igor Vlasenko <viy@altlinux.ru> 0:2.2.7-alt2_1jpp5
- fixed build with new xmlunit; increased javadoc maxmemory

* Thu Apr 15 2010 Igor Vlasenko <viy@altlinux.ru> 0:2.2.7-alt1_1jpp5.qa1
- NMU (by repocop): the following fixes applied:
  * windows-thumbnail-database-in-package for webwork
  * postclean-05-filetriggers for spec file

* Sun Mar 07 2010 Igor Vlasenko <viy@altlinux.ru> 0:2.2.7-alt1_1jpp5
- new version