- Update to 1.3

bugfix and feature update, see CHANGES.txt for details
- Removed patches
  * hamcrest-1.1-build.patch
    + renamed to hamcrest-1.3-build.patch
  * hamcrest-1.1-no-jarjar.patch
    + renamed to hamcrest-1.3-no-jarjar.patch
  * hamcrest-1.1-no-integration.patch
    + renamed to hamcrest-1.3-no-integration.patch
- Added patches
  * hamcrest-1.3-javadoc.patch
- Updated poms and added OSGI manifests from Fedora

OBS-URL: https://build.opensuse.org/package/show/Java:packages/hamcrest?expand=0&rev=9
This commit is contained in:
Michal Vyskocil 2013-10-21 11:44:28 +00:00 committed by Git OBS Bridge
parent 68ad7b2eb7
commit eee6d90e82
19 changed files with 535 additions and 55 deletions

30
hamcrest-1.3-build.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/build.xml b/build.xml
index 1cfd4fb..54d43fe 100644
--- a/build.xml
+++ b/build.xml
@@ -14,13 +14,13 @@
<target name="generator" description="Build code generator tool">
<java-to-jar srcdir="hamcrest-generator/src/main/java"
modulename="hamcrest-generator-nodeps"
- classpath="lib/generator/qdox-1.12.jar"/>
+ classpath="lib/generator/qdox.jar"/>
<!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package -->
- <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/generator/jarjar-1.3.jar"/>
+ <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/generator/jarjar.jar"/>
<jarjar jarfile="build/hamcrest-generator-${version}.jar">
<zipfileset src="build/hamcrest-generator-nodeps-${version}.jar"/>
- <zipfileset src="lib/generator/qdox-1.12.jar"/>
+ <zipfileset src="lib/generator/qdox.jar"/>
<rule pattern="com.thoughtworks.qdox.**" result="org.hamcrest.generator.qdox.@1"/>
</jarjar>
<copy file="build/hamcrest-generator-nodeps-${version}-sources.jar" tofile="build/hamcrest-generator-${version}-sources.jar"/>
@@ -152,7 +152,7 @@
<javadoc packagenames="org.hamcrest.*" defaultexcludes="yes"
destdir="build/temp/hamcrest-all-${version}-javadoc.jar.contents" author="true" version="true" use="true"
- windowtitle="Hamcrest" source="1.6" failonerror="yes" overview="overview.html">
+ windowtitle="Hamcrest" source="1.6" failonerror="yes">
<classpath>
<fileset dir="lib/integration">
<include name="*.jar"/>

View File

@ -0,0 +1,20 @@
---
build.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: hamcrest-1.3/build.xml
===================================================================
--- hamcrest-1.3.orig/build.xml
+++ hamcrest-1.3/build.xml
@@ -133,10 +133,9 @@
</target>
<target name="javadoc" description="build javadoc jars">
- <java-to-javadoc-jar modulename="hamcrest-generator-nodeps"/>
+ <java-to-javadoc-jar modulename="hamcrest-generator"/>
<java-to-javadoc-jar modulename="hamcrest-core"/>
<java-to-javadoc-jar modulename="hamcrest-library"/>
- <copy file="build/hamcrest-generator-nodeps-${version}-javadoc.jar" tofile="build/hamcrest-generator-${version}-javadoc.jar"/>
<javadoc packagenames="org.hamcrest.*" defaultexcludes="yes"
destdir="build/temp/hamcrest-all-${version}-javadoc.jar.contents" author="true" version="true" use="true"

View File

@ -0,0 +1,56 @@
---
build.xml | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
Index: hamcrest-1.3/build.xml
===================================================================
--- hamcrest-1.3.orig/build.xml
+++ hamcrest-1.3/build.xml
@@ -110,7 +110,7 @@
build/hamcrest-integration-${version}.jar"/>
</target>
- <target name="bigjar" depends="core, library, integration, generator"
+ <target name="bigjar" depends="core, library, generator"
description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration.">
<mkdir dir="build/temp/hamcrest-all-${version}.jar.manifest"/>
<manifest file="build/temp/hamcrest-all-${version}.jar.manifest/MANIFEST.MF">
@@ -124,13 +124,11 @@
<zipfileset src="build/hamcrest-core-${version}.jar"/>
<zipfileset src="build/hamcrest-library-${version}.jar"/>
<zipfileset src="build/hamcrest-generator-${version}.jar"/>
- <zipfileset src="build/hamcrest-integration-${version}.jar"/>
</jar>
<jar jarfile="build/hamcrest-all-${version}-sources.jar" duplicate="preserve" manifest="build/temp/hamcrest-all-${version}.jar.manifest/MANIFEST.MF">
<zipfileset src="build/hamcrest-core-${version}-sources.jar"/>
<zipfileset src="build/hamcrest-library-${version}-sources.jar"/>
<zipfileset src="build/hamcrest-generator-${version}-sources.jar"/>
- <zipfileset src="build/hamcrest-integration-${version}-sources.jar"/>
</jar>
</target>
@@ -138,24 +136,16 @@
<java-to-javadoc-jar modulename="hamcrest-generator-nodeps"/>
<java-to-javadoc-jar modulename="hamcrest-core"/>
<java-to-javadoc-jar modulename="hamcrest-library"/>
- <java-to-javadoc-jar modulename="hamcrest-integration"/>
<copy file="build/hamcrest-generator-nodeps-${version}-javadoc.jar" tofile="build/hamcrest-generator-${version}-javadoc.jar"/>
<javadoc packagenames="org.hamcrest.*" defaultexcludes="yes"
destdir="build/temp/hamcrest-all-${version}-javadoc.jar.contents" author="true" version="true" use="true"
windowtitle="Hamcrest" source="1.6" failonerror="yes">
- <classpath>
- <fileset dir="lib/integration">
- <include name="*.jar"/>
- </fileset>
- </classpath>
<packageset dir="build/temp/hamcrest-core-${version}-sources.jar.contents"/>
<packageset dir="build/temp/hamcrest-library-${version}-sources.jar.contents" excludes="org/hamcrest/internal"/>
- <packageset dir="build/temp/hamcrest-integration-${version}-sources.jar.contents"/>
<group title="Hamcrest API and Utility Classes" packages="org.hamcrest"/>
<group title="Matcher Library" packages="org.hamcrest.*"/>
- <group title="Integration" packages="org.hamcrest.integration, org.hamcrest.integration.*"/>
<link offline="false" href="http://www.junit.org/junit/javadoc/3.8.1/"/>
<link offline="false" href="http://kentbeck.github.com/junit/javadoc/latest/"/>

View File

@ -0,0 +1,23 @@
diff --git a/build.xml b/build.xml
index 54d43fe..ed57763 100644
--- a/build.xml
+++ b/build.xml
@@ -13,17 +13,8 @@
<target name="generator" description="Build code generator tool">
<java-to-jar srcdir="hamcrest-generator/src/main/java"
- modulename="hamcrest-generator-nodeps"
+ modulename="hamcrest-generator"
classpath="lib/generator/qdox.jar"/>
-
- <!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package -->
- <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/generator/jarjar.jar"/>
- <jarjar jarfile="build/hamcrest-generator-${version}.jar">
- <zipfileset src="build/hamcrest-generator-nodeps-${version}.jar"/>
- <zipfileset src="lib/generator/qdox.jar"/>
- <rule pattern="com.thoughtworks.qdox.**" result="org.hamcrest.generator.qdox.@1"/>
- </jarjar>
- <copy file="build/hamcrest-generator-nodeps-${version}-sources.jar" tofile="build/hamcrest-generator-${version}-sources.jar"/>
</target>
<target name="core" depends="generator" description="Build core Hamcrest library">

3
hamcrest-1.3.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6428e40d069fff3f99780efaae96c35ebdbf7cbfd475504254ebffcc19620c2
size 3686096

18
hamcrest-all-1.3.pom Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
</parent>
<artifactId>hamcrest-all</artifactId>
<packaging>jar</packaging>
<name>Hamcrest All</name>
<description>
A self-contained hamcrest jar containing all of the sub-modules in a single artifact.
</description>
</project>

18
hamcrest-core-1.3.pom Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
</parent>
<artifactId>hamcrest-core</artifactId>
<packaging>jar</packaging>
<name>Hamcrest Core</name>
<description>
This is the core API of hamcrest matcher framework to be used by third-party framework providers. This includes the a foundation set of matcher implementations for common operations.
</description>
</project>

14
hamcrest-core-MANIFEST.MF Normal file
View File

@ -0,0 +1,14 @@
Manifest-Version: 1.0
Bundle-Vendor: Fedoraproject.org
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: Hamcrest Core
Bundle-SymbolicName: org.hamcrest.core
Eclipse-SourceReferences: scm:cvs:pserver:dev.eclipse.org:/cvsroot/too
ls:org.eclipse.orbit/org.hamcrest.core;tag=v201303031735
Export-Package: org.hamcrest;version="1.3.0";core=split;mandatory:=cor
e,org.hamcrest.core;version="1.3.0",org.hamcrest.internal;version="1.
3.0";x-internal:=true
Bundle-Version: 1.3.0.v201303031735
Bundle-ManifestVersion: 2

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
</parent>
<artifactId>hamcrest-generator</artifactId>
<name>Hamcrest generator</name>
<description>
A tool to allow many Matcher implementations to be combined into a single class so users don't have to remember many classes/packages to import. Generates code.
</description>
</project>

View File

@ -0,0 +1,18 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %pluginName
Bundle-SymbolicName: org.hamcrest.generator
Bundle-Version: 1.3.0.v20090501071000
Export-Package: org.hamcrest.generator;version="1.3.0",org.hamcrest.ge
nerator.config;version="1.3.0"
Bundle-ManifestVersion: 2
Import-Package: com.thoughtworks.qdox;version="1.6.3",com.thoughtworks
.qdox.ant;version="1.6.3",com.thoughtworks.qdox.directorywalker;versi
on="1.6.3",com.thoughtworks.qdox.junit;version="1.6.3",com.thoughtwor
ks.qdox.model;version="1.6.3",com.thoughtworks.qdox.model.util;versio
n="1.6.3",com.thoughtworks.qdox.parser;version="1.6.3",com.thoughtwor
ks.qdox.parser.impl;version="1.6.3",com.thoughtworks.qdox.parser.stru
cts;version="1.6.3",com.thoughtworks.qdox.tools;version="1.6.3"

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
</parent>
<artifactId>hamcrest-integration</artifactId>
<packaging>jar</packaging>
<name>Hamcrest Integration</name>
<description>
Provides integration between Hamcrest and other testing tools, including JUnit (3 and 4), TestNG, jMock and EasyMock.
</description>
<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.2</version>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,14 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %pluginName
Bundle-SymbolicName: org.hamcrest.integration
Require-Bundle: org.hamcrest.core;bundle-version="1.3.0"
Bundle-Version: 1.3.0.v20090501071000
Export-Package: org.hamcrest;integration=split;mandatory:=integration;
version="1.3.0",org.hamcrest.integration;version="1.3.0"
Bundle-ManifestVersion: 2
Import-Package: org.easymock;version="2.4.0";resolution:=optional,org.
jmock.core;version="1.10";resolution:=optional

26
hamcrest-library-1.3.pom Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
</parent>
<artifactId>hamcrest-library</artifactId>
<packaging>jar</packaging>
<name>Hamcrest library</name>
<description>
Hamcrest library of matcher implementations.
</description>
<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,15 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %pluginName
Bundle-SymbolicName: org.hamcrest.library
Require-Bundle: org.hamcrest.core;bundle-version="1.3.0"
Bundle-Version: 1.3.0.v20090501071000
Export-Package: org.hamcrest;version="1.3.0";library=split;mandatory:=
library,org.hamcrest.beans;version="1.3.0",org.hamcrest.collection;ve
rsion="1.3.0",org.hamcrest.number;version="1.3.0",org.hamcrest.object
;version="1.3.0",org.hamcrest.text;version="1.3.0",org.hamcrest.xml;v
ersion="1.3.0"
Bundle-ManifestVersion: 2

72
hamcrest-parent-1.3.pom Normal file
View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.3</version>
<packaging>pom</packaging>
<name>Hamcrest Maven Parent</name>
<url>https://github.com/hamcrest/JavaHamcrest</url>
<description>General parent POM for all hamcrest libraries.</description>
<licenses>
<license>
<name>New BSD License</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/hamcrest/JavaHamcrest</url>
<connection>scm:git:git@github.com:hamcrest/JavaHamcrest.git</connection>
</scm>
<developers>
<developer>
<id>joe.walnes</id>
<name>Joe Walnes</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>nat.pryce</id>
<name>Nat Pryce</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>smgfreeman</id>
<name>Steve Freeman</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>neildunn</id>
<name>Neil Dunn</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>scarytom</id>
<name>Tom Denley</name>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>
<modules>
<module>hamcrest-core</module>
<module>hamcrest-generator</module>
<module>hamcrest-library</module>
<module>hamcrest-integration</module>
</modules>
</project>

20
hamcrest-text-1.3.pom Normal file
View File

@ -0,0 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-parent</artifactId>
<version>1.1</version>
</parent>
<artifactId>hamcrest-text</artifactId>
<packaging>jar</packaging>
<name>Hamcrest Text</name>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
</project>

14
hamcrest-text-MANIFEST.MF Normal file
View File

@ -0,0 +1,14 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %pluginName
Bundle-SymbolicName: org.hamcrest.text
Require-Bundle: org.hamcrest.core;bundle-version="1.3.0",org.hamcrest.
library;bundle-version="1.3.0"
Bundle-Version: 1.3.0.v20090501071000
Export-Package: org.hamcrest.text.pattern;version="1.3.0",org.hamcrest
.text.pattern.internal.ast;version="1.3.0";x-internal:=true,org.hamcr
est.text.pattern.internal.naming;version="1.3.0";x-internal:=true
Bundle-ManifestVersion: 2

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Mon Oct 21 11:34:31 UTC 2013 - mvyskocil@suse.com
- Update to 1.3
bugfix and feature update, see CHANGES.txt for details
- Removed patches
* hamcrest-1.1-build.patch
+ renamed to hamcrest-1.3-build.patch
* hamcrest-1.1-no-jarjar.patch
+ renamed to hamcrest-1.3-no-jarjar.patch
* hamcrest-1.1-no-integration.patch
+ renamed to hamcrest-1.3-no-integration.patch
- Added patches
* hamcrest-1.3-javadoc.patch
- Updated poms and added OSGI manifests from Fedora
-------------------------------------------------------------------
Mon Sep 9 11:05:43 UTC 2013 - tchvatal@suse.com

View File

@ -19,46 +19,67 @@
%define _without_integration 1
%define _without_tests 1
%define _withouth_jarjar 1
# This option controls integration which requires easymock2 and jmock
%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.1
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/hamcrest/
Source0: http://hamcrest.googlecode.com/files/hamcrest-1.1.tar.bz2
Source1: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom
Source2: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.pom
Source3: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-integration/1.1/hamcrest-integration-1.1.pom
Source4: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-generator/1.1/hamcrest-generator-1.1.pom
Source5: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom
Source6: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1.pom
Source7: hamcrest-text-1.1.pom
Patch0: hamcrest-1.1-build.patch
Patch1: hamcrest-1.1-no-jarjar.patch
Patch2: hamcrest-1.1-no-integration.patch
Requires: java >= 1.5.0
Url: http://code.google.com/p/%{name}/
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
Source3: http://repo1.maven.org/maven2/org/%{name}/%{name}-integration/%{version}/%{name}-integration-%{version}.pom
Source4: http://repo1.maven.org/maven2/org/%{name}/%{name}-generator/%{version}/%{name}-generator-%{version}.pom
Source5: http://repo1.maven.org/maven2/org/%{name}/%{name}-core/%{version}/%{name}-core-%{version}.pom
Source6: http://repo1.maven.org/maven2/org/%{name}/%{name}-all/%{version}/%{name}-all-%{version}.pom
# 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
Patch1: %{name}-%{version}-no-jarjar.patch
#PATCH-FIX-OPENSUSE: don't build hamcrest-integration.jar
Patch2: %{name}-%{version}-no-integration.patch
#PATCH-FIX-OPENSUSE: there is no hamcrest-generator-nodeps
Patch3: %{name}-%{version}-javadoc.patch
Requires: java >= 1.6.0
Requires: qdox
%if %with integration
Requires: easymock2
Requires: jmock
%endif
Requires: qdox
BuildRequires: ant >= 1.6.5
BuildRequires: ant-junit
BuildRequires: java-devel >= 1.5.0
#BuildRequires: ant-junit
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-tools
BuildRequires: zip
%if %with integration
BuildRequires: easymock2
%endif
@ -69,14 +90,18 @@ BuildRequires: jarjar
BuildRequires: jmock
%endif
BuildRequires: junit
#FIXME: build with junit4 once we will update junit4 to 4.11
# and remove bundled hamcrest parts, prevents us to build
# hamcrest itself
#BuildRequires: junit4
#junit4 does require hamcrest, but we don't need it for building itself
#!BuildIgnore: hamcrest
BuildRequires: qdox
%if %with tests
BuildRequires: testng
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
PreReq: javapackages-tools
%description
Provides a library of matcher objects (also known as constraints or
@ -87,77 +112,100 @@ mocking libraries and UI validation rules.
%package javadoc
Summary: Library of matchers for building test expressions
Group: Development/Libraries/Java
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
Provides a library of matcher objects (also known as constraints or
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.
Javadoc for %{name}.
%package demo
Summary: Library of matchers for building test expressions
Summary: Demo files for %{name}
Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release}
Requires: junit
#Requires: junit4
Requires: %{name} = %{version}
Requires: junit4
%if %with tests
Requires: testng
%endif
%description demo
Provides a library of matcher objects (also known as constraints or
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.
Demo files for %{name}.
%prep
%setup -q
find . -type f -name "*.jar" | xargs -t rm
# BUILD/hamcrest-%{version}/lib/generator/jarjar-1.0rc3.jar.no
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/hamcrest-1.1/lib/generator/qdox-1.6.1.jar.no
# BUILD/%{name}-%{version}/lib/generator/qdox-1.6.1.jar.no
ln -sf $(build-classpath qdox) lib/generator/
# BUILD/hamcrest-1.1/lib/integration/easymock-2.2.jar.no
# BUILD/%{name}-%{version}/lib/integration/easymock-2.2.jar.no
%if %with integration
ln -sf $(build-classpath easymock2) lib/integration/
%endif
# BUILD/hamcrest-1.1/lib/integration/jmock-1.10RC1.jar.no
# BUILD/%{name}-%{version}/lib/integration/jmock-%{version}0RC1.jar.no
%if %with integration
ln -sf $(build-classpath jmock) lib/integration/
%endif
# BUILD/hamcrest-1.1/lib/integration/junit-3.8.1.jar.no
# BUILD/%{name}-%{version}/lib/integration/junit-3.8.1.jar.no
ln -sf $(build-classpath junit) lib/integration/
# BUILD/hamcrest-1.1/lib/integration/junit-4.0.jar.no
ln -sf $(build-classpath junit4) lib/integration/
# BUILD/hamcrest-1.1/lib/integration/testng-4.6-jdk15.jar.no
# BUILD/%{name}-%{version}/lib/integration/junit-4.0.jar.no
#ln -sf $(build-classpath junit4) lib/integration/
# BUILD/%{name}-%{version}/lib/integration/testng-4.6-jdk15.jar.no
%if %with tests
ln -sf $(build-classpath testng-jdk15) lib/integration/
%endif
%patch0 -p0
%patch0 -p1
%if %without jarjar
%patch1 -p1
%endif
%if %without integration
%patch2 -p1
%endif
%patch3 -p1
perl -pi -e 's/\r$//g' LICENSE.txt
%build
export CLASSPATH=$(build-classpath qdox)
export OPT_JAR_LIST="junit ant/ant-junit"
%if %with integration
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 -Dversion=%{version} -Dbuild.sysclasspath=first all javadoc
%else
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 -Dversion=%{version} -Dbuild.sysclasspath=first clean core generator library text bigjar javadoc
%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
mkdir -p META-INF
cp -p %{SOURCE8} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/%{name}-core-%{version}.jar META-INF/MANIFEST.MF
rm -fr META-INF
mkdir -p META-INF
cp -p %{SOURCE9} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/%{name}-library-%{version}.jar META-INF/MANIFEST.MF
rm -fr META-INF
mkdir -p META-INF
cp -p %{SOURCE10} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/%{name}-text-%{version}.jar META-INF/MANIFEST.MF
rm -fr META-INF
mkdir -p META-INF
cp -p %{SOURCE11} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/%{name}-integration-%{version}.jar META-INF/MANIFEST.MF
rm -fr META-INF
mkdir -p META-INF
cp -p %{SOURCE12} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/%{name}-generator-%{version}.jar META-INF/MANIFEST.MF
%install
# jars
@ -198,12 +246,10 @@ install -m 644 build/%{name}-unit-test-%{version}.jar %{buildroot}%{_javadir}/%{
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/javadoc/* %{buildroot}%{_javadocdir}/%{name}
cp -pr build/temp/hamcrest-all-1.3-javadoc.jar.contents/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# demo
install -d -m 755 %{buildroot}%{_datadir}/%{name}
%if %with integration
install -m 644 build/%{name}-examples-%{version}.jar %{buildroot}%{_datadir}/%{name}-%{version}
%endif
cp -pr %{name}-examples %{buildroot}%{_datadir}/%{name}/
%files
@ -221,7 +267,7 @@ cp -pr %{name}-examples %{buildroot}%{_datadir}/%{name}/
%if %with tests
%{_javadir}/%{name}/unit-test.jar
%endif
%{_mavenpomdir}
%{_mavenpomdir}/*
%config %{_mavendepmapfragdir}/*
%files javadoc