Package apache-abdera: 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
Packager: Igor Vlasenko <viy@altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
%define version 0.4.0
%define name apache-abdera
# Copyright (c) 2000-2005, 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 repolib package to be built,
# issue the following: 'rpmbuild --with repolib'
%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}

%define repodir %{_javadir}/repository.jboss.com/apache/abdera/0.4.0-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src

%define gcj_support 0


%define maven_settings_file %{_builddir}/%{name}/settings.xml

%define simple_name abdera
%define version_incubating 0.4.0-incubating
Name:           apache-abdera
Version:        0.4.0
Release:        alt1_3jpp6
Epoch:          0
Summary:        An Open Source Atom Implementation
License:        Apache Software License
Group:          Development/Java
URL:            http://abdera.apache.org/
Source0:        %{name}-%{version}-src.tar.gz
# svn export http://svn.apache.org/repos/asf/abdera/java/tags/abdera-0.4.0-incubating/ apache-abdera-0.4.0
# tar zcf apache-abdera-0.4.0-src.tar.gz apache-abdera-0.4.0/
Source1:        %{name}-settings.xml
Source2:        %{name}-jpp-depmap.xml

Patch0:        apache-abdera-pom_xml.patch
Patch1:        apache-abdera-spring-pom_xml.patch
Patch2:        apache-abdera-adapters-pom_xml.patch
# no htmlparser, no json
Patch3:        apache-abdera-extensions-pom_xml.patch
Patch4:        apache-abdera-bundle-pom_xml.patch
Patch5:        apache-abdera-examples-pom_xml.patch


%if ! %{gcj_support}
BuildArch:      noarch
%endif
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: concurrent
BuildRequires: dtdparser
BuildRequires: maven2 >= 2.0.4-10
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-release
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-remote-resources
BuildRequires: maven2-plugin-source
BuildRequires: maven-surefire-plugin
BuildRequires: maven2-plugin-surefire-report
BuildRequires: maven2-plugin-plugin
BuildRequires: maven-surefire
BuildRequires: maven-surefire-provider-junit4
BuildRequires: maven2-plugin-shade

BuildRequires: maven2-common-poms >= 1.0
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-httpclient
BuildRequires: jakarta-commons-codec
#BuildRequires:  plexus-velocity
#BuildRequires:  plexus-resources
#BuildRequires:  plexus-maven-plugin
BuildRequires: ws-commons-axiom
BuildRequires: wstx
BuildRequires: geronimo-specs
#BuildRequires:  geronimo-stax-1.0-api
BuildRequires: stax_1_0_api
BuildRequires: xml-commons-apis
BuildRequires: jaxen
BuildRequires: xml-security
BuildRequires: xerces-j2
BuildRequires: junit4
BuildRequires: log4j
BuildRequires: ws-commons-axiom >= 0:1.2.4
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
BuildRequires: jaxen
BuildRequires: jaf_1_1_api
BuildRequires: servlet_2_4_api
BuildRequires: spring2-web
BuildRequires: aopalliance
#BuildRequires:  gnu-crypto
BuildRequires: apache-ibatis-sqlmap
#BuildRequires:  htmlparser
BuildRequires: objectweb-asm

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

%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%description
The goal of the Apache Abdera project is to build a functionally-complete,
high-performance implementation of the IETF Atom Syndication Format (RFC 4287)
and Atom Publishing Protocol (RFC 5023) specifications.

Abdera is an effort undergoing incubation at the Apache Software Foundation (ASF),
sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects
until a further review indicates that the infrastructure, communications, and decision making process
have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code,
it does indicate that the project has yet to be fully endorsed by the ASF.

%if %{with_repolib}
%package	 repolib
Summary:	 Artifacts to be uploaded to a repository library
Group:	Development/Java

%description	 repolib
Artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents
can be extracted through rpm2cpio
%endif

%package poms
Summary:        Poms and depmap frags for %{name}
Group:          Development/Java

%description poms
%{summary}.

%package adapters
Summary:        Adapters module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description adapters
%{summary}.

%package bundle
Summary:        Bundle module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description bundle
%{summary}.

%package client
Summary:        Client module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description client
%{summary}.

#no pom for this module, not compiled by maven, weird 
#%package contrib
#Summary:        Contrib module from %{name}
#Group:          Development/Libraries/Java
#Requires:       %{name}-poms = %{epoch}:%{version}-%{release}

#%description contrib
#%{summary}.

%package core
Summary:        Core module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description core
%{summary}.

%package dependencies
Summary:        Dependencies module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description dependencies
%{summary}.

# doesn't contain distribution module in parent pom.xml
#%package distribution
#Summary:        Distribution module from %{name}
#Group:          Development/Libraries/Java
#Requires:       %{name}-poms = %{epoch}:%{version}-%{release}

#%description distribution
#%{summary}.

%package examples
Summary:        Examples module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description examples
%{summary}.

%package extensions
Summary:        Extensions module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description extensions
%{summary}.

%package parser
Summary:        Parser module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description parser
%{summary}.

%package security
Summary:        Security module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description security
%{summary}.

%package server
Summary:        Server module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description server
%{summary}.

%package spring
Summary:        Spring module from %{name}
Group:          Development/Java
Requires: %{name}-poms = %{epoch}:%{version}-%{release}

%description spring
%{summary}.


%prep
%setup -q
%patch0 -b .sav0
%patch1 -b .sav1
%patch2 -b .sav2
%patch3 -b .sav3
%patch4 -b .sav4
%patch5 -b .sav5

# replace org.junit.internal.runners.TextListener with org.junit.internal.TextListener in all TestSuite.java
find . -name TestSuite.java -exec sed -i "s|org.junit.internal.runners.TextListener|org.junit.internal.TextListener|g" {} \;

# no jetty
rm -rf examples/src/main/java/org/apache/abdera/examples/appserver

# rm couchdb4j.jar
rm -rf adapters/couchdb/repository

cp -p %{SOURCE1} settings.xml

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

mkdir external_repo
ln -s %{_javadir} external_repo/JPP

%build

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

mkdir -p $MAVEN_REPO_LOCAL/bouncycastle/bcprov-jdk15/124/
ln -s %{_jvmdir}/java/jre/lib/rt.jar $MAVEN_REPO_LOCA$MAVEN_REPO_LOCAL/bouncycastle/bcprov-jdk15/124/bcprov-jdk15-124.jar

mvn-jpp \
        -e \
        -s $(pwd)/settings.xml \
        -Dmaven2.jpp.mode=true \
        -Dmaven.test.skip=true \
        -Dmaven2.jpp.depmap.file=%{SOURCE2} \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        install

%install

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.apache-abdera-abdera.pom
%add_to_maven_depmap org.apache.%{simple_name} %{simple_name} %{version_incubating} JPP.%{name} %{simple_name}

#                   contrib \
#                   dependencies \
for module in      adapters \
                   bundle \
                   client \
                   core \
                   distribution \
                   examples \
                   parser \
                   security \
                   server \
                   spring  ; do

#jar
  for j in $(find ./$module -name "*.jar"); do
	  install -pm 644 $j $RPM_BUILD_ROOT%{_javadir}/%{name}
  done
  %add_to_maven_depmap org.apache.%{simple_name} %{simple_name}-$module %{version_incubating} JPP.%{name} %{simple_name}-$module

#pom
  install -m 644 $module/pom.xml \
      $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-$module.pom
done

#dependencies module
pushd dependencies
%add_to_maven_depmap org.apache.%{simple_name} %{simple_name}-i18n %{version_incubating} JPP.%{name} %{simple_name}-i18n
for j in $(find . -name "*.jar"); do
  install -pm 644 $j $RPM_BUILD_ROOT%{_javadir}/%{name}
done
install -m 644 i18n/pom.xml \
      $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-i18n.pom
popd

# extensions module
pushd extensions
install -m 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.apache-abdera-extensions.pom
%add_to_maven_depmap org.apache.%{simple_name} %{simple_name}-extensions-parent %{version_incubating} JPP.%{name} %{simple_name}-extensions-parent

#       html \
#       json \
#       media \
for module in gdata \
		geo \
        main \
        oauth \
        opensearch \
        serializer \
        sharing \
        wsse ; do
#jar
  for j in $(find ./$module -name "*.jar"); do
    install -pm 644 $j $RPM_BUILD_ROOT%{_javadir}/%{name}
  done
  %add_to_maven_depmap org.apache.%{simple_name} %{simple_name}-extensions-$module %{version_incubating} JPP.%{name} %{simple_name}-extensions-$module

#pom
  install -m 644 $module/pom.xml \
      $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-extensions-$module.pom
done
popd

(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}*; do ln -sf $jar `echo $jar| sed "s|-%{version}-incubating||g"`; done)

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

%if %{with_repolib}
	install -d -m 755 $RPM_BUILD_ROOT%{repodir}
	install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
	install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{repodir}/component-info.xml
	install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
	cp -p $RPM_BUILD_ROOT%{_javadir}/%{name}/*.jar $RPM_BUILD_ROOT%{repodirlib}
%endif

%files
%doc LICENSE README
#%dir %{_datadir}/%{name}-%{version}
%dir %{_javadir}/%{name}
#%{_javadir}/%{name}.jar
#%{_javadir}/%{name}-%{version}.jar
#%if %{gcj_support}
#%attr(-,root,root) %dir %{_libdir}/gcj/%{name}
#%attr(-,root,root) %{_libdir}/gcj/%{name}/*.jar.*
#%attr(-,root,root) %{_libdir}/gcj/%{name}/*.mar.*
#%endif

%files poms
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}

%files adapters
%{_javadir}/%{name}/abdera-filesystem*.jar
%{_javadir}/%{name}/abdera-jdbc*.jar

%files bundle
%{_javadir}/%{name}/*abdera-bundle*.jar

%files client
%{_javadir}/%{name}/abdera-client*.jar

#%files contrib
#%defattr(0644,root,root,0755)
#%{_javadir}/%{name}/abdera-contrib*.jar

%files core
%{_javadir}/%{name}/abdera-core*.jar

%files dependencies
%{_javadir}/%{name}/abdera-i18n*.jar

#%files distribution
#%defattr(0644,root,root,0755)
#%{_javadir}/%{name}/abdera-distribution*.jar

%files examples
%{_javadir}/%{name}/abdera-examples*.jar

%files extensions
%{_javadir}/%{name}/abdera-extensions*.jar

%files parser
%{_javadir}/%{name}/abdera-parser*.jar

%files security
%{_javadir}/%{name}/abdera-security*.jar

%files server
%{_javadir}/%{name}/abdera-server*.jar

%files spring
%{_javadir}/%{name}/abdera-spring*.jar

%if %{with_repolib}
%files repolib
%{repodir}
%endif

%changelog
* Fri Sep 03 2010 Igor Vlasenko <viy@altlinux.ru> 0:0.4.0-alt1_3jpp6
- new version