Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37770136
en ru br
ALT Linux repos
5.0: 1.2-alt1_4jpp5

Group :: Development/Java
RPM: stax-ex

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Packager: Igor Vlasenko <viy at altlinux.ru>
%define _without_maven 1
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2008, 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 don't want to build with maven, and use straight ant instead,

# give rpmbuild option '--without maven'

%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}


Name:           stax-ex
Version:        1.2
Release: alt1_4jpp5
Epoch:          0
Summary:        STAX extensions
Group:          Development/Java
License:        CDDL
URL:            https://stax-ex.dev.java.net/
# cvs -d :pserver:guest at cvs.dev.java.net:/cvs login
# cvs -d :pserver:guest at cvs.dev.java.net:/cvs export -r stax-ex-1_2 -d stax-ex-1.2 stax-ex
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}-%{version}-settings.xml
Source2:        %{name}-%{version}-autogenerated-files.tar.gz
Source3:        %{name}-jpp-depmap.xml
Patch0:         stax-ex-pom.patch
BuildRequires: jpackage-utils >= 0:1.7.4
BuildRequires: ant >= 0:1.6.5
BuildRequires: ant-junit
BuildRequires: junit
BuildRequires: javatools-package-rename-task
%if %{with_maven}
BuildRequires: maven2-plugins >= 0:2.0.7
BuildRequires: maven2-plugin-ant
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-surefire
%endif
BuildRequires: jaf_1_1_api
BuildRequires: geronimo-stax-1.0-api
#BuildRequires:  stax_1_0_api
Requires(post): jpackage-utils >= 0:1.7.4
Requires(postun): jpackage-utils >= 0:1.7.4
Requires: jaf_1_1_api
Requires: stax_1_0_api
BuildArch:      noarch

%description
This project develops a few extensions to complement JSR-173
StAX API in the following area.
1. Enable parser instance reuse (which is important in the
  high-performance environment like JAXB and JAX-WS)
2. Improve the support for reading from non-text XML infoset,
  such as FastInfoset.
3. Improve the namespace support.

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

%description    javadoc
%{summary}.

%prep
%setup -q
find . -name "*.jar" | xargs -t rm
%patch0 -b .sav0
cp -p %{SOURCE1} settings.xml
sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/m2_repo/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_repo/repository</url>|g" settings.xml
%if %{without_maven}
gzip -dc %{SOURCE2} | tar xf -
%endif

%build
cd %{name}

%if %{with_maven}
export MAVEN_REPO_LOCAL=$(pwd)/m2_repo/repository
mkdir -p $MAVEN_REPO_LOCAL

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

export M2_SETTINGS=$(pwd)/settings.xml
mvn-jpp -e \
       -s $(pwd)/settings.xml \
       -Dmaven2.jpp.mode=true \
       -Dmaven2.jpp.depmap.file=%{SOURCE3} \
       -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
       ant:ant install javadoc:javadoc

%else
export OPT_JAR_LIST="ant/ant-junit junit"
export CLASSPATH=$(build-classpath \
jaf_1_1_api \
stax_1_0_api \
)
ant -Dmaven.settings.offline=true -Dbuild.sysclasspath=only jar javadoc
%endif

%install
install -dm 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 %{name}/target/%{name}-%{version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -m 644 %{name}/pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap org.jvnet.staxex %{name} %{version} JPP %{name}
#
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr %{name}/target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

%files
%doc %{name}/LICENSE.txt
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}/*

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

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin