File jaxen-bootstrap.spec of Package jaxen-bootstrap

# spec file for package jaxen-bootstrap
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define with_maven 0
%define real    jaxen
%define dom4jver   1.6.1
%define section free

Name:           jaxen-bootstrap
Version:        1.1
Release:        0
Summary:        A convenience package for build of dom4j
License:        Apache-2.0
Group:          Development/Libraries/Java
Source1:        pom-maven2jpp-depcat.xsl
Source2:        pom-maven2jpp-newdepmap.xsl
Source3:        pom-maven2jpp-mapdeps.xsl
Source4:        jaxen-1.1-b7-jpp-depmap.xml
# Debian sources don't need a proprietary msv for build, so that's why I used them
# svn co svn://
# rm dom4j/docs/xref/org/dom4j/tree/ConcurrentReaderHashMap.html
# rm dom4j/docs/clover/org/dom4j/tree/ConcurrentReaderHashMap.html
# #bnc501764
# rm dom4j/lib/tools/clover.license
# tar --exclude-vcs -cjf dom4j-1.6.1-debian.tar.bz2 dom4j/
Source6:        jaxen-1.1-b7-build.xml
Patch0:         jaxen-bootstrap-project_xml.patch
Requires:       xalan-j2
Requires:       xerces-j2
Requires:       xom
BuildRequires:  ant >= 1.6
BuildRequires:  javapackages-tools
BuildRequires:  junit
%if %{with_maven}
BuildRequires:  maven >= 1.1
BuildRequires:  maven-plugin-license
BuildRequires:  maven-plugin-test
BuildRequires:  maven-plugins-base
BuildRequires:  saxon
BuildRequires:  saxon-scripts
BuildRequires:  java-devel
BuildRequires:  unzip
BuildRequires:  xalan-j2
BuildRequires:  xerces-j2
BuildRequires:  xom
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Dom4j depends on a jaxen build with dom4j support. This package must
only be installed in the rare event of having to rebuild dom4j.

%setup -q -n %{real}-%{version}
tar -xf %{SOURCE5}
#/bin/gzip -dc %{SOURCE5} | tar -xf -
cp %{SOURCE6} build.xml
find . -name "*.jar" -exec rm -f {} \;
%patch0 -b .sav
%if %{with_maven}
export DEPCAT=$(pwd)/
echo '<?xml version="1.0" standalone="yes"?>' > $DEPCAT
echo '<depset>' >> $DEPCAT
for p in $(find . -name project.xml); do
    pushd $(dirname $p)
    /usr/bin/saxon project.xml %{SOURCE1} >> $DEPCAT
echo >> $DEPCAT
echo '</depset>' >> $DEPCAT
/usr/bin/saxon $DEPCAT %{SOURCE2} >
rm -rf src/java/main/org/jaxen/jdom
rm -rf src/java/test/org/jaxen/jdom
rm -f src/java/test/org/jaxen/test/
rm -f src/java/test/org/jaxen/test/
rm -f src/java/test/org/jaxen/test/
rm -f src/java/test/org/jaxen/test/
rm -f src/java/test/org/jaxen/test/

export CLASSPATH=$(build-classpath \
xom \
jdom \
xalan-j2 \
xerces-j2 \
pushd dom4j/src/java
javac -sourcepath ../../../src/java/main:. \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
        org/dom4j/ \
jar cf ../../dom4j.jar $(find . -name "*.class")
mkdir -p .maven/repository/JPP/jars
cp dom4j/dom4j.jar .maven/repository/JPP/jars/dom4j.jar
%if %{with_maven}
for p in $(find . -name project.xml); do
    pushd $(dirname $p)
    cp project.xml project.xml.orig
    /usr/bin/saxon -o project.xml project.xml.orig %{SOURCE3} map=%{SOURCE4}
maven \
        -Dmaven.test.skip=true \
        -Dmaven.repo.remote=file:/usr/share/maven/repository \
        -Dmaven.home.local=$(pwd)/.maven \
export CLASSPATH=$CLASSPATH:dom4j/dom4j.jar
ant \

# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 target/%{real}-%{version}-beta-7.jar \
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \
ln -sf ${jar} ${jar/-%{version}/}; done)



openSUSE Build Service is sponsored by