diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2015-09-15 18:41:18 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2015-09-15 18:41:18 -0500 |
commit | 918470a84dcfec5e774bf7563a85f5808146e91d (patch) | |
tree | 53c2b68bc5f0f6365659ac00f8a906a0257c592c /pcr | |
parent | 17fdf8bfcfa280405c6feba71ef0ea7d1ec24efe (diff) | |
download | abslibre-918470a84dcfec5e774bf7563a85f5808146e91d.tar.gz abslibre-918470a84dcfec5e774bf7563a85f5808146e91d.tar.bz2 abslibre-918470a84dcfec5e774bf7563a85f5808146e91d.zip |
jmock: add new package to [pcr]
Diffstat (limited to 'pcr')
-rw-r--r-- | pcr/jmock/PKGBUILD | 68 | ||||
-rw-r--r-- | pcr/jmock/jmock-junit3_api.patch | 11 |
2 files changed, 79 insertions, 0 deletions
diff --git a/pcr/jmock/PKGBUILD b/pcr/jmock/PKGBUILD new file mode 100644 index 000000000..cd28ff31a --- /dev/null +++ b/pcr/jmock/PKGBUILD @@ -0,0 +1,68 @@ +# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> + +pkgname=jmock +pkgver=1.2.0 +pkgrel=1 +pkgdesc="A library that supports test-driven development of Java code with mock objects" +arch=('any') +url="http://www.jmock.org/" +license=('custom') +depends=('java-runtime') +makedepends=('java-environment' 'cglib' 'jh' 'junit') +source=("https://github.com/${pkgname}-developers/${pkgname}-library/archive/${pkgver}.tar.gz" + "https://repo1.maven.org/maven2/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.pom" + "https://repo1.maven.org/maven2/${pkgname}/${pkgname}-cglib/${pkgver}/${pkgname}-cglib-${pkgver}.pom" + "jmock-junit3_api.patch") +md5sums=('624d6a8a60ba6caa3abb2e5cdff86560' + 'd045f9fa7c37e604b2e7724f7d22c05d' + '1d4816028f07a979c31cbe984d9ff850' + 'd213e801f1b50f773e033da0dd20ecf2') + +prepare() { + cd "${srcdir}/${pkgname}-library-${pkgver}" + patch -Np1 -i "${srcdir}/jmock-junit3_api.patch" + find . -name \*.jar -delete + mkdir -p build/classes + mkdir -p build/cglib/classes +} + +build() { + cd "${srcdir}/${pkgname}-library-${pkgver}" + + CLASSPATH="build/classes:/usr/share/java/cglib-nodep.jar:/usr/share/java/junit.jar" + javac -classpath $CLASSPATH -d "build/classes" \ + $(find "src/org" -not -path "*/org/jmock/cglib*" -name \*.java) + javac -classpath $CLASSPATH -d "build/cglib/classes" \ + $(find "src/org/jmock/cglib" -name \*.java) + javadoc -classpath $CLASSPATH -d "build/javadoc" -sourcepath "src" -subpackages org + + jar -cvf "${pkgname}.jar" -C "build/classes" . + jar -cvf "${pkgname}-cglib.jar" -C "build/cglib/classes" . +} + +package() { + cd "${srcdir}/${pkgname}-library-${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/javadoc" "${pkgdir}/usr/share/doc/${pkgname}" + + # Install Maven artifacts + export DESTDIR=${pkgdir} + jh mvn-install ${pkgname} ${pkgname} ${pkgver} \ + "${srcdir}/${pkgname}-${pkgver}.pom" \ + "${srcdir}/${pkgname}-library-${pkgver}/${pkgname}.jar" \ + "${pkgname}.jar" + jh mvn-install ${pkgname} "${pkgname}-cglib" ${pkgver} \ + "${srcdir}/${pkgname}-cglib-${pkgver}.pom" \ + "${srcdir}/${pkgname}-library-${pkgver}/${pkgname}-cglib.jar" \ + "${pkgname}-cglib.jar" + + ln -s "/usr/share/java/${pkgname}.jar" \ + "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.jar" + ln -s "/usr/share/java/${pkgname}-cglib.jar" \ + "${pkgdir}/usr/share/java/${pkgname}-cglib-${pkgver}.jar" +} diff --git a/pcr/jmock/jmock-junit3_api.patch b/pcr/jmock/jmock-junit3_api.patch new file mode 100644 index 000000000..f9bf804d1 --- /dev/null +++ b/pcr/jmock/jmock-junit3_api.patch @@ -0,0 +1,11 @@ +--- jmock-library-1.2.0.orig/src/org/jmock/expectation/AssertMo.java 2007-06-02 17:23:18.000000000 -0500 ++++ jmock-library-1.2.0/src/org/jmock/expectation/AssertMo.java 2015-09-15 15:47:56.676879745 -0500 +@@ -73,7 +73,7 @@ + assertTrue("Should not have verified", threwException); + } + +- static protected void failNotEquals( String message, ++ static public void failNotEquals( String message, + Object expected, + Object actual ) { + String formatted = ""; |