1
0
apache-commons-jxpath/apache-commons-jxpath.spec

104 lines
3.5 KiB
RPMSpec

#
# spec file for package apache-commons-jxpath
#
# Copyright (c) 2018 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 https://bugs.opensuse.org/
#
%define base_name jxpath
%define short_name commons-%{base_name}
Name: apache-%{short_name}
Version: 1.3
Release: 0
Summary: Simple XPath interpreter
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Source1: %{short_name}.depmap
Patch0: %{short_name}-mockrunner.patch
Patch1: build.xml.patch
BuildRequires: ant
BuildRequires: apache-commons-beanutils
BuildRequires: el_api >= 3.0
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: jdom
BuildRequires: jsp
BuildRequires: junit
BuildRequires: servlet >= 3.0
Requires: apache-commons-beanutils
Requires: apache-commons-logging
Requires: java >= 1.8
Requires: jdom >= 1.0
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
BuildArch: noarch
%description
Defines a simple interpreter of an expression language called XPath.
JXPath applies XPath expressions to graphs of objects of all kinds:
JavaBeans, Maps, Servlet contexts, DOM etc, including mixtures thereof.
%prep
%setup -q -n %{short_name}-%{version}-src
%patch0 -p1
%patch1
%build
export CLASSPATH=$(build-classpath \
ant-launcher \
plexus/ \
junit \
jdom \
jsp \
apache-commons-beanutils \
target/commons-jxpath.jar \
):target/classes:target/test-classes
ant -Dmaven.mode.offline=true jar \
-Dant.build.javac.source=8 -Dant.build.javac.target=8 \
-lib %{_datadir}/java
sed -i "s/@name@/%{short_name}/g" src/conf/MANIFEST.MF
sed -i "s/@version@/%{version}/g" src/conf/MANIFEST.MF
jar ufm target/%{short_name}.jar src/conf/MANIFEST.MF
%install
install -Dpm 644 target/%{short_name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
pushd %{buildroot}%{_javadir}
for jar in *-%{version}*; do
ln -sf ${jar} `echo $jar| sed "s|apache-||g"`
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
ln -sf ${jar} `echo $jar| sed "s|apache-\(.*\)-%{version}|\1|g"`
done
popd # come back from javadir
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}/%{last_path_segment}/
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}-%{version}.pom
%add_maven_depmap %{name}-%{version}.pom %{name}-%{version}.jar
%files
%defattr(0644,root,root,0755)
%license LICENSE.txt
%{_javadir}/*.jar
%{_mavenpomdir}/*
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%changelog