Accepting request 499447 from Java:packages

- Apply patch from fedora:
  * hamcrest-1.3-fork-javac.patch

- Fix homepage
- Update to build with new javapacakges-tools

OBS-URL: https://build.opensuse.org/request/show/499447
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hamcrest?expand=0&rev=20
This commit is contained in:
Dominique Leuenberger 2017-05-31 11:32:41 +00:00 committed by Git OBS Bridge
commit 0c3c6338e3
3 changed files with 44 additions and 93 deletions

View File

@ -0,0 +1,22 @@
From 54b7ccdd1e16f1d6dd07359eae0fcac8f1883373 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 2 Jan 2017 10:31:56 +0100
Subject: [PATCH] Fork javac
---
build.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: hamcrest-1.3/build.xml
===================================================================
--- hamcrest-1.3.orig/build.xml
+++ hamcrest-1.3/build.xml
@@ -268,7 +268,7 @@
<attribute name="Built-Date" value="${build.timestamp}"/>
</manifest>
<mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/>
- <javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.jar.contents" debug="${debug}" target="1.5" includeantruntime="false">
+ <javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.jar.contents" debug="${debug}" target="1.5" includeantruntime="false" fork="true">
<classpath>
<fileset dir="lib/integration">
<include name="*.jar"/>

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon May 29 16:05:25 UTC 2017 - tchvatal@suse.com
- Apply patch from fedora:
* hamcrest-1.3-fork-javac.patch
-------------------------------------------------------------------
Fri May 19 13:11:37 UTC 2017 - tchvatal@suse.com
- Fix homepage
- Update to build with new javapacakges-tools
-------------------------------------------------------------------
Wed Mar 18 09:46:07 UTC 2015 - tchvatal@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package hamcrest
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@ -16,32 +16,13 @@
#
%define _without_integration 1
%define _without_tests 1
%define _withouth_jarjar 1
# This option controls integration which requires easymock2 and jmock and junit
%bcond_without integration
# This option controls jarjar on qdox
# Since bundling the qdox classes prevents upgrades, we disable it by default
%bcond_with jarjar
# This option controls tests which requires ant-junit and testng
%bcond_without tests
# If integration is disabled, then tests are disabled
%if %without integration
%bcond_with tests
%endif
Name: hamcrest
Version: 1.3
Release: 0
Summary: Library of matchers for building test expressions
License: BSD-3-Clause
Group: Development/Libraries/Java
Url: http://code.google.com/p/%{name}/
Url: https://github.com/hamcrest/JavaHamcrest
Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.tgz
Source1: http://repo1.maven.org/maven2/org/%{name}/%{name}-parent/%{version}/%{name}-parent-%{version}.pom
Source2: http://repo1.maven.org/maven2/org/%{name}/%{name}-library/%{version}/%{name}-library-%{version}.pom
@ -52,13 +33,11 @@ Source6: http://repo1.maven.org/maven2/org/%{name}/%{name}-all/%{version}
# This file was added by the maintainer for compatibility with maven dep
# solving system
Source7: %{name}-text-%{version}.pom
Source8: hamcrest-core-MANIFEST.MF
Source9: hamcrest-library-MANIFEST.MF
Source10: hamcrest-text-MANIFEST.MF
Source11: hamcrest-integration-MANIFEST.MF
Source12: hamcrest-generator-MANIFEST.MF
#PATCH-FIX-OPENSUSE: don't use versioned deps, no overview in html
Patch0: %{name}-%{version}-build.patch
#PATCH-FIX-OPENSUSE: don't bundle QDox classes into hamcrest-generator.jar
@ -69,33 +48,15 @@ Patch2: %{name}-%{version}-no-integration.patch
Patch3: %{name}-%{version}-javadoc.patch
#PATCH-FIX-UPSTREAM: random build crash fix
Patch4: hamcrest-1.3-random-build-crash.patch
Requires: java >= 1.6.0
Requires: qdox
%if %with integration
Requires: easymock2
Requires: jmock
%endif
Patch5: hamcrest-1.3-fork-javac.patch
BuildRequires: ant >= 1.6.5
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: zip
%if %with integration
BuildRequires: easymock2
%endif
%if %with jarjar
BuildRequires: jarjar
%endif
%if %with integration
BuildRequires: ant-junit
BuildRequires: jmock
BuildRequires: junit
%endif
BuildRequires: qdox
%if %with tests
BuildRequires: testng
%endif
BuildRequires: zip
Requires: java >= 1.6.0
Requires: qdox
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@ -105,8 +66,6 @@ predicates) allowing 'match' rules to be defined declaratively, to be
used in other frameworks. Typical scenarios include testing frameworks,
mocking libraries and UI validation rules.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
@ -119,61 +78,29 @@ Summary: Demo files for %{name}
Group: Development/Libraries/Java
Requires: %{name} = %{version}
Requires: junit
%if %with tests
Requires: testng
%endif
%description demo
Demo files for %{name}.
%prep
%setup -q
%setup -q
find . -type f -name "*.jar" | xargs -t rm
rm -fr hamcrest-integration/src/main/java/org/hamcrest/integration/JMock1Adapter.java
rm -fr hamcrest-integration/src/main/java/org/hamcrest/JMock1Matchers.java
rm -fr hamcrest-unit-test/src/main/java/org/hamcrest/integration/JMock1AdapterTest.java
# BUILD/%{name}-%{version}/lib/generator/jarjar-1.0rc3.jar.no
%if %with jarjar
ln -sf $(build-classpath jarjar) lib/generator/
%endif
# BUILD/%{name}-%{version}/lib/generator/qdox-1.6.1.jar.no
ln -sf $(build-classpath qdox) lib/generator/
# BUILD/%{name}-%{version}/lib/integration/easymock-2.2.jar.no
%if %with integration
ln -sf $(build-classpath easymock2) lib/integration/
%endif
# BUILD/%{name}-%{version}/lib/integration/jmock-%{version}0RC1.jar.no
%if %with integration
ln -sf $(build-classpath jmock) lib/integration/
# BUILD/%{name}-%{version}/lib/integration/junit-3.8.1.jar.no
ln -sf $(build-classpath junit) lib/integration/
# BUILD/%{name}-%{version}/lib/integration/junit-4.0.jar.no
#ln -sf $(build-classpath junit) lib/integration/
%endif
# BUILD/%{name}-%{version}/lib/integration/testng-4.6-jdk15.jar.no
%if %with tests
ln -sf $(build-classpath testng-jdk15) lib/integration/
%endif
%patch0 -p1
%if %without jarjar
%patch1 -p1
%endif
%if %without integration
%patch2 -p1
%endif
%patch3 -p1
%patch4 -p1
%patch5 -p1
perl -pi -e 's/\r$//g' LICENSE.txt
%build
export CLASSPATH=$(build-classpath qdox)
%if %with integration
export OPT_JAR_LIST="junit ant/ant-junit"
%endif
# The unit-test goal is switched off as some tests fail with JDK 7
# see https://github.com/hamcrest/JavaHamcrest/issues/30
ant -Dant.build.javac.source=1.5 -Dversion=%{version} -Dbuild.sysclasspath=last clean core generator library bigjar javadoc
# inject OSGi manifests
@ -229,23 +156,13 @@ install -m 644 build/%{name}-library-%{version}.jar %{buildroot}%{_javadir}/%{na
install -m 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP.%{name}-library.pom
%add_maven_depmap JPP.%{name}-library.pom %{name}/library.jar
%if %with integration
install -m 644 build/%{name}-integration-%{version}.jar %{buildroot}%{_javadir}/%{name}/integration.jar
install -m 644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/JPP.%{name}-integration.pom
%add_maven_depmap JPP.%{name}-integration.pom %{name}/integration.jar
%endif
install -m 644 build/%{name}-text-%{version}.jar %{buildroot}%{_javadir}/%{name}/text.jar
install -m 644 %{SOURCE7} %{buildroot}%{_mavenpomdir}/JPP.%{name}-text.pom
%add_maven_depmap JPP.%{name}-text.pom %{name}/text.jar
%if %with tests
install -m 644 build/%{name}-unit-test-%{version}.jar %{buildroot}%{_javadir}/%{name}/unit-test.jar
%endif
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/temp/hamcrest-all-1.3-javadoc.jar.contents/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/temp/hamcrest-all-1.3-javadoc.jar.contents/* %{buildroot}%{_javadocdir}/%{name}
# demo
install -d -m 755 %{buildroot}%{_datadir}/%{name}