PKGBUILD 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  2. _pkgname=commons-logging
  3. pkgname=java-${_pkgname}
  4. pkgver=1.2
  5. pkgrel=1.parabola1
  6. pkgdesc="Wrapper interface for logging APIs in Java"
  7. arch=('any')
  8. url="https://commons.apache.org/logging/"
  9. license=('APACHE')
  10. depends=('java-runtime')
  11. makedepends=('apache-ant' 'jh' 'junit' 'tomcat8')
  12. source=("https://archive.apache.org/dist/commons/logging/source/${_pkgname}-${pkgver}-src.tar.gz"
  13. "https://repo1.maven.org/maven2/${_pkgname}/${_pkgname}-api/1.1/${_pkgname}-api-1.1.pom")
  14. md5sums=('ce977548f1cbf46918e93cd38ac35163'
  15. '48ed0c8f5fbfa18fb0ddc39830a9c0ac')
  16. prepare() {
  17. cd "${srcdir}/${_pkgname}-${pkgver}-src"
  18. mv "../${_pkgname}-api-1.1.pom" pom-api.xml
  19. sed -i 's/1\.1/1\.2/g' pom-api.xml
  20. }
  21. build() {
  22. cd "${srcdir}/${_pkgname}-${pkgver}-src"
  23. ant dist \
  24. -Dservletapi.jar=/usr/share/java/tomcat8/servlet-api.jar
  25. # Build docs
  26. javadoc -sourcepath "src/main/java" -d "target/docs/apidocs" \
  27. org.apache.commons.logging org.apache.commons.logging.impl
  28. }
  29. package() {
  30. cd "${srcdir}/${_pkgname}-${pkgver}-src"
  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 "target/docs/apidocs" "${pkgdir}/usr/share/doc/${pkgname}"
  36. # Install Maven artifacts
  37. export DESTDIR=${pkgdir}
  38. jh mvn-install ${_pkgname} ${_pkgname} ${pkgver} \
  39. "${srcdir}/${_pkgname}-${pkgver}-src/pom.xml" \
  40. "${srcdir}/${_pkgname}-${pkgver}-src/target/${_pkgname}-${pkgver}.jar" \
  41. "${_pkgname}.jar"
  42. jh mvn-install ${_pkgname} "${_pkgname}-api" ${pkgver} \
  43. "${srcdir}/${_pkgname}-${pkgver}-src/pom-api.xml" \
  44. "${srcdir}/${_pkgname}-${pkgver}-src/target/${_pkgname}-api-${pkgver}.jar" \
  45. "${_pkgname}-api.jar"
  46. ln -s "/usr/share/java/${_pkgname}.jar" \
  47. "${pkgdir}/usr/share/java/${_pkgname}-${pkgver}.jar"
  48. ln -s "/usr/share/java/${_pkgname}-api.jar" \
  49. "${pkgdir}/usr/share/java/${_pkgname}-api-${pkgver}.jar"
  50. # Install commons-logging-adapters.jar
  51. install -Dm644 "target/${_pkgname}-adapters-${pkgver}.jar" \
  52. "${pkgdir}/usr/share/java/${_pkgname}-adapters-${pkgver}.jar"
  53. ln -s "/usr/share/java/${_pkgname}-adapters-${pkgver}.jar" \
  54. "${pkgdir}/usr/share/java/${_pkgname}-adapters.jar"
  55. }