- Fix homepage

- Update to build with new javapacakges-tools

OBS-URL: https://build.opensuse.org/package/show/Java:packages/hamcrest?expand=0&rev=22
This commit is contained in:
Tomáš Chvátal 2017-05-19 13:15:05 +00:00 committed by Git OBS Bridge
parent e5bd433100
commit 978f5b5572
2 changed files with 14 additions and 93 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
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,14 @@ 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
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 +65,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,49 +77,21 @@ 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
@ -169,11 +99,6 @@ 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 +154,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}