summaryrefslogtreecommitdiff
path: root/libre/java-hamcrest
diff options
context:
space:
mode:
Diffstat (limited to 'libre/java-hamcrest')
-rw-r--r--libre/java-hamcrest/PKGBUILD66
-rw-r--r--libre/java-hamcrest/hamcrest-build.patch73
-rw-r--r--libre/java-hamcrest/hamcrest-random_compilation_failure.patch11
3 files changed, 150 insertions, 0 deletions
diff --git a/libre/java-hamcrest/PKGBUILD b/libre/java-hamcrest/PKGBUILD
new file mode 100644
index 000000000..0ae7f0c95
--- /dev/null
+++ b/libre/java-hamcrest/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_libname=hamcrest
+pkgname=java-${_libname}
+pkgver=1.3
+pkgrel=3.parabola1
+pkgdesc="Java matcher objects library"
+arch=('any')
+url="https://code.google.com/p/hamcrest"
+license=('BSD')
+depends=('java-runtime')
+makedepends=('apache-ant' 'easymock' 'java-jarjar' 'java-qdox' 'jmock' 'jh' 'junit')
+source=("https://${_libname}.googlecode.com/files/${_libname}-${pkgver}.tgz"
+ "hamcrest-build.patch"
+ "hamcrest-random_compilation_failure.patch")
+md5sums=('92e91c2754d44e49b72d70c10a04cb08'
+ '37e8a9c44743d52054d690e98bee013a'
+ 'b0009aa6a6a6ea97987016d9d323c949')
+
+prepare() {
+ cd "${srcdir}/${_libname}-${pkgver}"
+ rm -v $(find . -name \*.jar)
+ patch -Np1 -i "${srcdir}/hamcrest-build.patch"
+ patch -Np1 -i "${srcdir}/hamcrest-random_compilation_failure.patch"
+}
+
+build() {
+ cd "${srcdir}/${_libname}-${pkgver}"
+ ant bigjar unit-test javadoc \
+ -Dhaltonfailure=false -Dversion=${pkgver}
+}
+
+package() {
+ cd "${srcdir}/${_libname}-${pkgver}"
+
+ # Install license file
+ install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+
+ # Install documentation
+ install -d "${pkgdir}/usr/share/doc/${pkgname}"
+ cp -r "build/temp/hamcrest-all-${pkgver}-javadoc.jar.contents" \
+ "${pkgdir}/usr/share/doc/${pkgname}/javadoc"
+
+ # Install Maven artifacts
+ install -d "${pkgdir}/usr/share/java/${_libname}"
+ export DESTDIR=${pkgdir}
+ for artifact in $(printf '%s\n' *.pom|sed 's/-[0-9.]*\.pom$//'); do
+ if [[ -f "build/${artifact}-${pkgver}.jar" ]]; then
+ # This artifact has a jar file
+ jh mvn-install "org.hamcrest" ${artifact} ${pkgver} \
+ "${artifact}-${pkgver}.pom" \
+ "build/${artifact}-${pkgver}.jar" \
+ "${artifact}.jar"
+
+ # Symlink them to /usr/share/java
+ ln -s "/usr/share/java/${artifact}.jar" \
+ "${pkgdir}/usr/share/java/${artifact//-/\/}-${pkgver}.jar"
+ ln -s "/usr/share/java/${artifact}.jar" \
+ "${pkgdir}/usr/share/java/${artifact//-/\/}.jar"
+ else
+ # This artifact is just a pom
+ jh mvn-install "org.hamcrest" ${artifact} ${pkgver} \
+ "${artifact}-${pkgver}.pom"
+ fi
+ done
+}
diff --git a/libre/java-hamcrest/hamcrest-build.patch b/libre/java-hamcrest/hamcrest-build.patch
new file mode 100644
index 000000000..922113f12
--- /dev/null
+++ b/libre/java-hamcrest/hamcrest-build.patch
@@ -0,0 +1,73 @@
+--- hamcrest-1.3.orig/build.xml 2012-07-02 14:14:09.000000000 -0500
++++ hamcrest-1.3/build.xml 2015-09-18 11:51:57.312426136 -0500
+@@ -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="/usr/share/java/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="/usr/share/java/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="/usr/share/java/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"/>
+@@ -93,14 +93,16 @@
+ <junit printsummary="no" fork="no" haltonfailure="${haltonfailure}">
+ <formatter type="brief" usefile="no"/>
+ <classpath>
+- <fileset dir="lib/integration">
+- <include name="*.jar"/>
+- </fileset>
+ <pathelement path="build/hamcrest-core-${version}.jar"/>
+ <pathelement path="build/hamcrest-library-${version}.jar"/>
+ <pathelement path="build/hamcrest-integration-${version}.jar"/>
+ <pathelement path="build/hamcrest-generator-${version}.jar"/>
+ <pathelement path="build/hamcrest-unit-test-${version}.jar"/>
++ <fileset dir="/usr/share/java">
++ <include name="junit.jar"/>
++ <include name="easymock.jar"/>
++ <include name="jmock.jar"/>
++ </fileset>
+ </classpath>
+ <batchtest>
+ <fileset dir="hamcrest-unit-test/src/main/java">
+@@ -152,7 +154,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="no" overview="overview.html">
+ <classpath>
+ <fileset dir="lib/integration">
+ <include name="*.jar"/>
+@@ -286,10 +288,12 @@
+ <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">
+ <classpath>
+- <fileset dir="lib/integration">
+- <include name="*.jar"/>
+- </fileset>
+ <pathelement path="@{classpath}"/>
++ <fileset dir="/usr/share/java">
++ <include name="junit.jar"/>
++ <include name="easymock.jar"/>
++ <include name="jmock.jar"/>
++ </fileset>
+ </classpath>
+ </javac>
+ <copy file="LICENSE.txt" todir="build/temp/@{modulename}-${version}.jar.contents"/>
+@@ -317,7 +321,7 @@
+ <fileset dir="lib/integration">
+ <include name="*.jar"/>
+ </fileset>
+- <fileset file="lib/generator/qdox-1.12.jar"/>
++ <fileset file="/usr/share/java/qdox.jar"/>
+ <fileset file="build/hamcrest-core-${version}.jar"/>
+ <fileset file="build/hamcrest-library-${version}.jar"/>
+ <fileset file="build/hamcrest-generator-${version}.jar"/>
diff --git a/libre/java-hamcrest/hamcrest-random_compilation_failure.patch b/libre/java-hamcrest/hamcrest-random_compilation_failure.patch
new file mode 100644
index 000000000..6b383be67
--- /dev/null
+++ b/libre/java-hamcrest/hamcrest-random_compilation_failure.patch
@@ -0,0 +1,11 @@
+--- hamcrest-1.3.orig/build.xml 2012-07-02 14:14:09.000000000 -0500
++++ hamcrest-1.3/build.xml 2015-09-15 19:05:43.542046514 -0500
+@@ -36,7 +36,7 @@
+ fork="yes"
+ failonerror="yes"
+ classpath="
+- build/hamcrest-core-${version}.jar;
++ build/temp/hamcrest-core-${version}.jar.contents;
+ build/hamcrest-generator-${version}.jar;
+ ">
+ <arg value="core-matchers.xml"/>