PKGBUILD 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  2. _libname=hamcrest
  3. pkgname=java-${_libname}
  4. pkgver=1.3
  5. pkgrel=4.parabola1
  6. pkgdesc="Java matcher objects library"
  7. arch=('any')
  8. url="https://code.google.com/p/hamcrest"
  9. license=('BSD')
  10. depends=('java-runtime')
  11. makedepends=('apache-ant' 'easymock' 'java-jarjar' 'java-qdox' 'jmock' 'jh' 'junit')
  12. source=("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/${_libname}/${_libname}-${pkgver}.tgz"
  13. "hamcrest-build.patch"
  14. "hamcrest-random_compilation_failure.patch")
  15. sha256sums=('c6428e40d069fff3f99780efaae96c35ebdbf7cbfd475504254ebffcc19620c2'
  16. '7f78968554466dfd3f9f94c8bd9f9cc98e5588cdaf98497932faecd4ae3fdd9e'
  17. 'ef400e638998ea3033f935082b7a51648f41ca55ac40501aa722349425a43566')
  18. prepare() {
  19. cd "${srcdir}/${_libname}-${pkgver}"
  20. rm -v $(find . -name \*.jar)
  21. patch -Np1 -i "${srcdir}/hamcrest-build.patch"
  22. patch -Np1 -i "${srcdir}/hamcrest-random_compilation_failure.patch"
  23. }
  24. build() {
  25. cd "${srcdir}/${_libname}-${pkgver}"
  26. ant bigjar unit-test javadoc \
  27. -Dhaltonfailure=false -Dversion=${pkgver}
  28. }
  29. package() {
  30. cd "${srcdir}/${_libname}-${pkgver}"
  31. # Install license file
  32. install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
  33. # Install documentation
  34. install -d "${pkgdir}/usr/share/doc/${pkgname}"
  35. cp -r "build/temp/hamcrest-all-${pkgver}-javadoc.jar.contents" \
  36. "${pkgdir}/usr/share/doc/${pkgname}/javadoc"
  37. # Install Maven artifacts
  38. install -d "${pkgdir}/usr/share/java/${_libname}"
  39. export DESTDIR=${pkgdir}
  40. for artifact in $(printf '%s\n' *.pom|sed 's/-[0-9.]*\.pom$//'); do
  41. if [[ -f "build/${artifact}-${pkgver}.jar" ]]; then
  42. # This artifact has a jar file
  43. jh mvn-install "org.hamcrest" ${artifact} ${pkgver} \
  44. "${artifact}-${pkgver}.pom" \
  45. "build/${artifact}-${pkgver}.jar" \
  46. "${artifact}.jar"
  47. # Symlink them to /usr/share/java
  48. ln -s "/usr/share/java/${artifact}.jar" \
  49. "${pkgdir}/usr/share/java/${artifact//-/\/}-${pkgver}.jar"
  50. ln -s "/usr/share/java/${artifact}.jar" \
  51. "${pkgdir}/usr/share/java/${artifact//-/\/}.jar"
  52. else
  53. # This artifact is just a pom
  54. jh mvn-install "org.hamcrest" ${artifact} ${pkgver} \
  55. "${artifact}-${pkgver}.pom"
  56. fi
  57. done
  58. }