ant-contrib/ant-contrib.spec

116 lines
3.2 KiB
RPMSpec

#
# spec file for package ant-contrib
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#
# icecream 0
%define with_junit 0
%define section free
%define ant_minimal_version 1.7.1
Summary: Collection of tasks for Ant
License: Apache-2.0
Group: Development/Libraries/Java
Name: ant-contrib
Version: 1.0b2
Release: 0
Url: http://ant-contrib.sourceforge.net/
Source0: http://prdownloads.sourceforge.net/ant-contrib/ant-contrib-1.0b2-src.tar.bz2
#Is from apache-ant-1.7.0-src.zip
Source1: BuildFileTest.java
Patch0: ant-contrib-build_xml.patch
Patch1: ant-contrib-ant-1.7.0.patch
Patch2: ant-contrib-BuildFileTest_java.patch
#PATCH-FIX-OPENSUSE: bnc#644661
Patch3: ant-contrib-1.0b2-enable-for-task.patch
BuildRequires: ant >= %{ant_minimal_version}
BuildRequires: bcel >= 5.1
BuildRequires: java-1_5_0-gcj-compat-devel
BuildRequires: javapackages-tools
%if %{with_junit}
BuildRequires: ant-junit >= %{ant_minimal_version}
Requires: junit >= 3.8.1
%endif
%requires_eq ant
Requires: bcel >= 5.1
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The Ant-Contrib project is a collection of tasks (and at one point
maybe types and other tools) for Apache Ant.
%package manual
Summary: Collection of tasks for Ant
Group: Development/Libraries/Java
%description manual
The Ant-Contrib project is a collection of tasks (and at one point
maybe types and other tools) for Apache Ant.
%prep
%setup -q -c -n %{name}-%{version}
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
mv ant-contrib/manual/LICENSE.txt .
# TODO: this test fails
#rm ant-contrib/test/src/net/sf/antcontrib/logic/TryCatchTaskTest.java
%patch0 -b .sav
%patch1 -b .sav1
%patch2 -b .sav2
%patch3 -p1 -b .sav2
%build
pushd ant-contrib/lib
ln -s $(build-classpath bcel) bcel-5.1.jar
popd
pushd ant-contrib/test/lib
ln -s $(build-classpath junit) junit-3.8.2
popd
mkdir -p ant-contrib/build/ant
cp %{SOURCE1} ant-contrib/build/ant/
cd ant-contrib
%if %defined suse_version
export CLASSPATH=$(build-classpath bcel junit)
%endif
ant \
jar \
%if %{with_junit}
test
%endif
%install
# jars
install -Dpm 644 %{name}/build/lib/%{name}.jar \
$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
# manual
install -dm 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt
%{_javadir}/*.jar
%files manual
%defattr(-,root,root,-)
%doc %{name}/manual
%changelog