Package portals-bridges: 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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
Packager: Igor Vlasenko <viy@altlinux.ru>
BuildRequires: /proc apache-commons-primitives

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.
#

# If you want only the basic modules to be built,
# give rpmbuild option '--with basiconly'
%define basic_only %{?_with_basiconly:1}%{!?_with_basiconly:%{?_without_basiconly:0}%{!?_without_basiconly:%{?_basiconly:%{_basiconly}}%{!?_basiconly:0}}}
%define php %{?_with_php:1}%{!?_with_php:%{?_without_php:0}%{!?_without_php:%{?_php:%{_php}}%{!?_php:0}}}

%define name    portals-bridges

Name:           portals-bridges
Version:        1.0.4
Release:        alt5_4jpp5
Epoch:          0
Summary:        Bridges for Portal Development
License:        Apache Software License 2.0
Url:            http://portals.apache.org/bridges/
Group:          Development/Java
Source0:        http://www.apache.org/dist/portals/bridges/portals-bridges-1.0.4-src.tar.gz

Source2:        %{name}-jpp-depmap.xml
Source3:        %{name}-settings.xml

Patch0:         portals-bridges-pom.patch
Patch1:         portals-bridges-nophp-pom.patch
Patch2:         portals-bridges-nophp-nojetspeed-pom.patch
Patch3:         portals-bridges-nojetspeed-pom.patch
Patch4:         portals-bridges-applications-pom.patch
Patch5:         portals-bridges-applications-nophp-pom.patch
Patch6:         portals-bridges-struts-pom.patch
Patch7:         portals-bridges-RenderContextAttributes.patch
Patch8:         portals-bridges-ELFormTag.patch
Patch9:         portals-bridges-FormTag.patch
Patch10:        portals-bridges-BeanActionException.patch
Patch11:        portals-bridges-BaseBean.patch


BuildRequires: jpackage-utils >= 0:1.7.5
BuildRequires: ant >= 0:1.6.5
BuildRequires: maven2 >= 0:2.0.7
BuildRequires: maven2-plugin-antrun
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-war
BuildRequires: maven-surefire-plugin

BuildRequires: excalibur-avalon-framework
BuildRequires: excalibur-avalon-logkit
BuildRequires: gnu-getopt
BuildRequires: javacc3
BuildRequires: junit
#
BuildRequires: jakarta-commons-beanutils
BuildRequires: jakarta-commons-digester
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-validator
BuildRequires: jsp_2_0_api
BuildRequires: myfaces-core11-api
BuildRequires: myfaces-core11-impl
BuildRequires: myfaces-tomahawk
BuildRequires: portlet_1_0_api
BuildRequires: servlet_2_3_api
BuildRequires: spring2-beans
BuildRequires: spring2-context
BuildRequires: spring2-context-support
BuildRequires: spring2-core
BuildRequires: spring2-web
BuildRequires: spring2-webmvc
BuildRequires: spring2-webmvc-portlet
BuildRequires: struts >= 0:1.3.8
BuildRequires: struts-el
BuildRequires: struts-tiles
BuildRequires: velocity
BuildRequires: velocity-tools
%if ! %{basic_only}
BuildRequires: portals-jetspeed2-components
BuildRequires: portals-jetspeed2-portals-gems
BuildRequires: apache-ibatis-dao
BuildRequires: apache-ibatis-sqlmap
%endif
%if %{php}
Buildrequires:  phpportlet
%endif
BuildRequires: xpp3-minimal

Requires: jakarta-commons-beanutils
Requires: jakarta-commons-digester
Requires: jakarta-commons-logging
Requires: jakarta-commons-validator
Requires: jsp_2_0_api
Requires: portals-jetspeed2-components
Requires: myfaces-core11-api
Requires: myfaces-core11-impl
Requires: portlet_1_0_api
Requires: servlet_2_3_api
Requires: spring2-beans
Requires: spring2-context
Requires: spring2-context-support
Requires: spring2-core
Requires: spring2-web
Requires: spring2-webmvc
Requires: spring2-webmvc-portlet
Requires: struts
Requires: velocity
Requires: velocity-tools

BuildArch:      noarch

Requires(post): jpackage-utils >= 0:1.7.5
Requires(postun): jpackage-utils >= 0:1.7.5

%description
Portals Bridges provides support for JSR-168 compliant 
Portlet development using common web frameworks like 
Struts, JSF, PHP, Perl and Velocity. 

%package common
Summary:        Common Utils for %{name}
Group:          Development/Java

%description common
%{summary}.

%package portletfilter
Summary:        Portletfilter for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-logging
Requires: portlet_1_0_api

%description portletfilter
%{summary}.

%package velocity
Summary:        Velocity Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: velocity
Requires: velocity-tools

%description velocity
%{summary}.

%package frameworks
Summary:        Frameworks Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-velocity = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-beanutils
Requires: jakarta-commons-validator
Requires: spring2-beans
Requires: spring2-core
Requires: velocity
Requires: velocity-tools

%description frameworks
%{summary}.

%package jsf
Summary:        JSF Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-logging
Requires: myfaces-core11-api
Requires: servlet_2_3_api

%description jsf
%{summary}.


%if %{php}
%package php
Summary:        PHP Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: phpportlet

%description php
%{summary}.
%endif

%if ! %{basic_only}
%package perl
Summary:        Perl Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-logging

%description perl
%{summary}.

%package struts
Summary:        Struts Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-beanutils
Requires: jakarta-commons-digester
Requires: jakarta-commons-logging
Requires: struts
Requires: struts-el
Requires: struts-tiles

%description struts
%{summary}.

%package groovy
Summary:        Groovy Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: groovy11
Requires: portals-jetspeed2-api

%description groovy
%{summary}.

%package demo
Summary:        Samples for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-jsf = %{epoch}:%{version}-%{release}
Requires: %{name}-perl = %{epoch}:%{version}-%{release}
Requires: %{name}-struts = %{epoch}:%{version}-%{release}
Requires: %{name}-velocity = %{epoch}:%{version}-%{release}
Requires: antlr
Requires: apache-ibatis-dao
Requires: apache-ibatis-sqlmap
Requires: castor
Requires: jakarta-commons-beanutils
Requires: jakarta-commons-codec
Requires: jakarta-commons-collections
Requires: jakarta-commons-digester
Requires: jakarta-commons-el
Requires: jakarta-commons-fileupload
Requires: jakarta-commons-lang
Requires: jakarta-commons-logging
Requires: jakarta-commons-validator
Requires: jakarta-oro
Requires: jakarta-taglibs-standard
Requires: portals-jetspeed2-components
Requires: portals-jetspeed2-portals-gems
Requires: log4j
Requires: myfaces-core11-api
Requires: myfaces-core11-impl
Requires: myfaces-tomahawk
Requires: spring2-beans
Requires: spring2-core
Requires: spring2-context
Requires: spring2-context-support
Requires: spring2-web
Requires: spring2-webmvc
Requires: spring2-webmvc-portlet
Requires: struts >= 0:1.3.8
Requires: struts-el
Requires: velocity
Requires: velocity-tools

%description demo
%{summary}.

%endif

%package mapserver
Summary:        Mapserver Bridge for %{name}
Group:          Development/Java
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: jakarta-commons-logging

%description mapserver
%{summary}.


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

%description javadoc
%{summary}.


%prep
%setup -q 
# remove all binary libs
#find . -name "*.jar" -exec rm -f {} \;
for j in $(find . -name "*.jar"); do
    mv $j $j.no
done
cp %{SOURCE3} maven2-settings.xml

sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/m2_repo/repository</url>|g" maven2-settings.xml
sed -i -e "s|<url>__JAVADIR_PLACEHOLDER__</url>|<url>file://`pwd`/external_repo</url>|g" maven2-settings.xml
sed -i -e "s|<url>__MAVENREPO_DIR_PLACEHOLDER__</url>|<url>file://`pwd`/m2_repo/repository</url>|g" maven2-settings.xml
sed -i -e "s|<url>__MAVENDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/maven2/plugins</url>|g" maven2-settings.xml
sed -i -e "s|<url>__ECLIPSEDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/eclipse/plugins</url>|g" maven2-settings.xml

%patch0 -b .sav0
%if ! %{php} && ! %{basic_only}
%patch1 -b .nophp
%endif
%if ! %{php} && %{basic_only}
%patch2 -b .nophp-nojetspeed
%endif
%if %{php} && %{basic_only}
%patch3 -b .nojetspeed
%endif
%patch4 -b .sav4
%if ! %{php}
%patch5 -b .sav5
%endif
%patch6 -b .sav6
%patch7 -b .sav7
%patch8 -b .sav8
%patch9 -b .sav9
%patch10 -b .sav10
%patch11 -b .sav11


%build
mkdir external_repo
ln -s %{_javadir} external_repo/JPP
export M2SETTINGS=$(pwd)/maven2-settings.xml
export MAVEN_REPO_LOCAL=`pwd`/m2_repo/repository

cd src

mvn-jpp -Dmaven.compile.target=1.5 -Dmaven.javadoc.source=1.5  -Dmaven.compile.target=1.5 -Dmaven.javadoc.source=1.5  -e \
        -s ${M2SETTINGS} \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        -Dmaven2.jpp.depmap.file=%{SOURCE2} \
        install javadoc:javadoc

%install
cd src
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms

install -m 644 \
         pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}.pom
%add_to_maven_depmap org.apache.portals.bridges %{name} %{version} JPP/%{name} %{name}

#BUILD/portals-bridges-1.0.4/src/portletfilter/target/portals-bridges-portletfilter-1.0.4.jar
install -m 644 \
         portletfilter/target/%{name}-portletfilter-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-portletfilter-%{version}.jar
install -m 644 \
         portletfilter/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-portletfilter.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-portletfilter %{version} JPP/%{name} %{name}-portletfilter

#BUILD/portals-bridges-1.0.4/src/common/target/portals-bridges-common-1.0.4.jar
install -m 644 \
         common/target/%{name}-common-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-common-%{version}.jar
install -m 644 \
         common/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-common.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-common %{version} JPP/%{name} %{name}-common

#BUILD/portals-bridges-1.0.4/src/velocity/target/portals-bridges-velocity-1.0.4.jar
install -m 644 \
         velocity/target/%{name}-velocity-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-velocity-%{version}.jar
install -m 644 \
         velocity/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-velocity.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-velocity %{version} JPP/%{name} %{name}-velocity

#BUILD/portals-bridges-1.0.4/src/frameworks/target/portals-bridges-frameworks-1.0.4.jar
install -m 644 \
         frameworks/target/%{name}-frameworks-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-frameworks-%{version}.jar
install -m 644 \
         frameworks/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-frameworks.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-frameworks %{version} JPP/%{name} %{name}-frameworks

#BUILD/portals-bridges-1.0.4/src/jsf/target/portals-bridges-jsf-1.0.4.jar
install -m 644 \
         jsf/target/%{name}-jsf-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jsf-%{version}.jar
install -m 644 \
         jsf/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-jsf.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-jsf %{version} JPP/%{name} %{name}-jsf


%if %{php}
#BUILD/portals-bridges-1.0.4/src/php/target/portals-bridges-php-1.0.4.jar
install -m 644 \
         php/target/%{name}-php-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-php-%{version}.jar
install -m 644 \
         php/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-php.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-php %{version} JPP/%{name} %{name}-php
%endif

%if ! %{basic_only}
#BUILD/portals-bridges-1.0.4/src/perl/target/portals-bridges-perl-1.0.4.jar
install -m 644 \
         perl/target/%{name}-perl-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-perl-%{version}.jar
install -m 644 \
         perl/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-perl.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-perl %{version} JPP/%{name} %{name}-perl

#BUILD/portals-bridges-1.0.4/src/struts/target/portals-bridges-struts-1.2.7-1.0.4.jar
install -m 644 \
         struts/target/%{name}-struts-1.2.7-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/
ln -sf %{name}-struts-1.2.7-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-struts-%{version}.jar
install -m 644 \
         struts/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-struts.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-struts %{version} JPP/%{name} %{name}-struts

#BUILD/portals-bridges-1.0.4/src/groovy/target/portals-bridges-groovy-1.0.4.jar
install -m 644 \
         groovy/target/%{name}-groovy-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-groovy-%{version}.jar
install -m 644 \
         groovy/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-groovy.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-groovy %{version} JPP/%{name} %{name}-groovy

install -m 644 \
         applications/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-applications.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-applications %{version} JPP/%{name} %{name}-applications

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}/applications

install -m 644 \
applications/jpetstore/pom.xml \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.applications-jpetstore.pom
%add_to_maven_depmap org.apache.portals.bridges jpetstore %{version} JPP/%{name}/applications jpetstore
install -m 644 \
         applications/jpetstore/target/jpetstore-%{version}.war \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/applications/

install -m 644 \
applications/jsf-demo/pom.xml \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.applications-jsf-demo.pom
%add_to_maven_depmap org.apache.portals.bridges jsf-demo %{version} JPP/%{name}/applications jsf-demo
install -m 644 \
         applications/jsf-demo/target/jsf-demo-%{version}.war \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/applications/

install -m 644 \
applications/perl/pom.xml \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.applications-perl.pom
%add_to_maven_depmap org.apache.portals.bridges perl %{version} JPP/%{name}/applications perl
install -m 644 \
         applications/perl/target/perl-%{version}.war \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/applications/

%if %{php}
install -m 644 \
applications/php/pom.xml \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.applications-php.pom
%add_to_maven_depmap org.apache.portals.bridges php %{version} JPP/%{name}/applications php
install -m 644 \
         applications/php/target/php-%{version}.war \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/applications/
%endif

install -m 644 \
applications/springmvc/pom.xml \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.applications-springmvc.pom
%add_to_maven_depmap org.apache.portals.bridges springmvc %{version} JPP/%{name}/applications springmvc
install -m 644 \
         applications/springmvc/target/springmvc-%{version}.war \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/applications/

%endif

#BUILD/portals-bridges-1.0.4/src/mapserver/target/portals-bridges-mapserver-1.0.4.jar
install -m 644 \
         mapserver/target/%{name}-mapserver-%{version}.jar \
         $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-mapserver-%{version}.jar
install -m 644 \
         mapserver/pom.xml \
         $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-%{name}-mapserver.pom
%add_to_maven_depmap org.apache.portals.bridges %{name}-mapserver %{version} JPP/%{name} %{name}-mapserver

(cd $RPM_BUILD_ROOT%{_javadir}/%{name}/applications && for war in *-%{version}*.war; do ln -sf ${war} $(echo $war | sed -e 's/-%{version}//' -e 's/\.war/.jar/'); done)

# create unversioned symlinks
(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/common
cp -pr common/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/common


install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/velocity
cp -pr velocity/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/velocity
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/frameworks
cp -pr frameworks/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/frameworks
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/jsf
cp -pr jsf/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/jsf

%if %{php}
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/php
cp -pr php/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/php
%endif

%if ! %{basic_only}
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/perl
cp -pr perl/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/perl
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/struts
cp -pr struts/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/struts
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/groovy
cp -pr groovy/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/groovy
%endif

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/mapserver
cp -pr mapserver/target/site/apidocs/* \
    $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/mapserver

ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp LICENSE.TXT $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}

%files common
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-common*.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files portletfilter
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-portletfilter*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files velocity
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-velocity*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files frameworks
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-frameworks*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files jsf
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-jsf*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%if %{php}
%files php
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-php*.jar
%endif
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%if ! %{basic_only}
%files perl
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-perl*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files struts
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-struts*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files groovy
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-groovy*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files demo
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/applications

%endif
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

%files mapserver
%doc %{_docdir}/%{name}-%{version}/LICENSE.TXT
%{_javadir}/%{name}/%{name}-mapserver*.jar
# hack; explicitly added docdir if not owned
%doc %dir %{_docdir}/%{name}-%{version}

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

%changelog
* Wed Jan 05 2011 Igor Vlasenko <viy@altlinux.ru> 0:1.0.4-alt5_4jpp5
- build with new commons primitives

* Mon Dec 06 2010 Igor Vlasenko <viy@altlinux.ru> 0:1.0.4-alt4_4jpp5
- fixed build

* Thu Oct 28 2010 Igor Vlasenko <viy@altlinux.ru> 0:1.0.4-alt3_4jpp5
- fixed build

* Thu Jun 04 2009 Igor Vlasenko <viy@altlinux.ru> 0:1.0.4-alt2_4jpp5
- full-featured build

* Thu Jun 04 2009 Igor Vlasenko <viy@altlinux.ru> 0:1.0.4-alt1_4jpp5
- new jpp release