Blob Blame History Raw
%{?scl:%scl_package eclipse-swtbot}
%{!?scl:%global pkg_name %{name}}
%{!?maven_scl:%global maven_scl_prefix   %{nil}}

%{?maven_scl:%global maven_scl_root /opt/rh/%{maven_scl}/root}
%{!?maven_scl:%global maven_scl_root  %{nil}}

%global install_loc   %{_datadir}/eclipse/dropins/swtbot

Name:           %{?scl_prefix}eclipse-swtbot
Version:        2.2.1
Release:        6%{?dist}
Summary:        UI and functional testing tool for SWT and Eclipse based applications

License:        EPL
URL:            http://www.eclipse.org/swtbot/
Source0:        http://git.eclipse.org/c/swtbot/org.eclipse.swtbot.git/snapshot/org.eclipse.swtbot-%{version}.tar.bz2
Patch0:         drop-source-bundles.patch
# Temporary patch required because hamcrest 1.3 is supplying hamcrest 1.1
Patch1:		eclipse-swtbot-hamcrest.patch
BuildRequires:  tycho
BuildRequires:  tycho-extras
BuildRequires:  %{?scl_prefix}eclipse-gef
BuildRequires:  %{?scl_prefix}eclipse-pde
BuildRequires:  %{?scl_prefix}junit >= 4.0.0
BuildRequires:  %{?scl_prefix}cbi-plugins
BuildRequires:  %{?scl_prefix}eclipse-license
BuildRequires:  %{?scl_prefix}feclipse-maven-plugin
BuildRequires:  %{?scl_prefix}hamcrest
BuildRequires:  %{maven_scl_prefix}log4j

Requires:  %{maven_scl_prefix}log4j
Requires:  %{?scl_prefix}eclipse-gef
Requires:  %{?scl_prefix}hamcrest

BuildArch:      noarch

%description
SWTBot is a Java based UI/functional testing tool for testing SWT and Eclipse
based applications. SWTBot provides APIs that are simple to read and write.
The APIs also hide the complexities involved with SWT and Eclipse. This makes
it suitable for UI/functional testing by everyone, not just developers.

%prep
%setup -q -n org.eclipse.swtbot-%{version}

for j in $(find -name \*.jar); do
if [ ! -L $j ] ; then
rm -fr $j
fi
done
%patch0
%patch1
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId ='target-platform-configuration']"
%pom_remove_plugin org.jacoco:jacoco-maven-plugin
%pom_remove_plugin org.eclipse.tycho:tycho-packaging-plugin


%build
scl enable %{scl} - <<"EOF"
xmvn -o clean install -Dmaven.test.skip=true -DskipTychoVersionCheck=true
EOF

%install
install -d -m 755 %{buildroot}%{install_loc}

scl enable %{scl} - <<"EOF"
xmvn -o org.fedoraproject:feclipse-maven-plugin:install -DsourceRepo=org.eclipse.swtbot.updatesite/target/repository -DtargetLocation=%{buildroot}%{install_loc}
EOF

pushd %{buildroot}%{install_loc}/plugins
    rm -fr org.apache.log4j*
    ln -s %{maven_scl_root}%{_root_datadir}/java/log4j.jar .
    rm -fr org.hamcrest*
    ln -s %{_javadir}/hamcrest/core.jar hamcrest-core.jar
    ln -s %{_javadir}/hamcrest/integration.jar hamcrest-integration.jar
    ln -s %{_javadir}/hamcrest/library.jar hamcrest-library.jar
popd

%files
%{install_loc}

%changelog
* Thu Aug 28 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-6
- Add R/BR on hamcrest.

* Fri Jul 18 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-5
- Add R on eclipse-gef

* Thu Jun 19 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-4
- Add missing requirement on maven30-log4j.

* Mon Jun 9 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-3
- Remove link to hamcrest-text.jar.

* Mon Jun 9 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-2
- Use log4j from maven30 scl.

* Wed Jun 4 2014 Sami Wagiaalla <swagiaal@redhat.com> 2.2.1-1
- Import from rawhide and build for DTS.

* Thu May 22 2014 Jeff Johnston <jjohnstn@redhat.com> 2.1.1-1
- Import from rawhide and SCL-ize