summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-09-17 20:19:26 -0500
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-22 16:15:06 -0300
commita5e92ccefaa028b56c26b9fcedb976fce6f9b3e2 (patch)
treee3e576c91318d4984eda00d49eedba5eca9f8b00
parentd32ad0ddf0247a8656b3251a0f3f681ca365fdf6 (diff)
downloadabslibre-a5e92ccefaa028b56c26b9fcedb976fce6f9b3e2.tar.gz
abslibre-a5e92ccefaa028b56c26b9fcedb976fce6f9b3e2.tar.bz2
abslibre-a5e92ccefaa028b56c26b9fcedb976fce6f9b3e2.zip
easymock: add new package to [pcr]
-rw-r--r--pcr/easymock/PKGBUILD54
-rw-r--r--pcr/easymock/easymock-no_android.patch15
2 files changed, 69 insertions, 0 deletions
diff --git a/pcr/easymock/PKGBUILD b/pcr/easymock/PKGBUILD
new file mode 100644
index 000000000..a71183710
--- /dev/null
+++ b/pcr/easymock/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+pkgname=easymock
+pkgver=3.4
+pkgrel=1
+pkgdesc="Java library to generate Mock Objects for given interfaces"
+arch=('any')
+url="http://easymock.org/"
+license=('APACHE')
+depends=('java-runtime')
+makedepends=('cglib' 'java-environment' 'jh' 'junit' 'objenesis')
+source=("https://github.com/${pkgname}/${pkgname}/archive/${pkgname}-${pkgver}.tar.gz"
+ "easymock-no_android.patch")
+md5sums=('2c17cff0e93bb88ddb30f09eb3b684ee'
+ '8d9cb4aabfd48b88bc8a0c932e0399df')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgname}-${pkgver}"
+ mkdir -p build/classes
+ rm -v "core/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java"
+ patch -Np1 -i "${srcdir}/easymock-no_android.patch"
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgname}-${pkgver}"
+
+ CLASSPATH="/usr/share/java/cglib.jar:/usr/share/java/objenesis.jar:/usr/share/java/junit.jar"
+ javac -classpath $CLASSPATH -d "build/classes" \
+ $(find "core/src/main/java" -name \*.java)
+ javadoc -classpath $CLASSPATH -d "build/javadoc" \
+ -sourcepath "core/src/main/java" -subpackages org
+
+ jar -cvf "${pkgname}.jar" -C "build/classes" .
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgname}-${pkgver}"
+
+ # Install license file
+ install -Dm644 "core/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+
+ # Install documentation
+ install -d "${pkgdir}/usr/share/doc/${pkgname}"
+ cp -r "build/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"
+
+ # Install Maven artifacts
+ export DESTDIR=${pkgdir}
+ jh mvn-install "org.easymock" ${pkgname} ${pkgver} \
+ "${srcdir}/${pkgname}-${pkgname}-${pkgver}/pom.xml" \
+ "${srcdir}/${pkgname}-${pkgname}-${pkgver}/${pkgname}.jar" \
+ "${pkgname}.jar"
+ ln -s "/usr/share/java/${pkgname}.jar" \
+ "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.jar"
+}
diff --git a/pcr/easymock/easymock-no_android.patch b/pcr/easymock/easymock-no_android.patch
new file mode 100644
index 000000000..caeaa4cb3
--- /dev/null
+++ b/pcr/easymock/easymock-no_android.patch
@@ -0,0 +1,15 @@
+--- easymock-easymock-3.4.orig/core/src/main/java/org/easymock/internal/MocksControl.java 2015-09-04 21:55:41.000000000 -0500
++++ easymock-easymock-3.4/core/src/main/java/org/easymock/internal/MocksControl.java 2015-09-17 20:10:41.241170584 -0500
+@@ -141,12 +141,6 @@
+ return cached;
+ }
+
+- // ///CLOVER:OFF
+- if (AndroidSupport.isAndroid()) {
+- return classProxyFactory = new AndroidClassProxyFactory();
+- }
+- // ///CLOVER:ON
+-
+ return classProxyFactory = new ClassProxyFactory();
+ }
+