makedeb


gradle 7.3.3-1


Powerful build system for the JVM

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for gradle.

# Maintainer: Matt Spaulding <matt@mattops.io>

pkgbase=gradle
pkgname=('gradle' 'gradle-doc' 'gradle-src')
pkgver=7.3.3
pkgrel=1
pkgdesc='Powerful build system for the JVM'
url='https://gradle.org/'
arch=('any')
license=('Apache')
depends=('openjdk-11-jre' 'bash' 'debianutils' 'coreutils' 'findutils' 'sed')
makedepends=('git' 'gradle' 'asciidoc' 'xmlto' 'kotlin' 'groovy' 'openjdk-11-jdk')
source=(https://services.gradle.org/distributions/${pkgbase}-${pkgver}-src.zip
        ${pkgbase}.sh)
sha256sums=('0232a17d15999ed533b37b0b4cd5f0059ccf0943f4338cae2a21e4d595a83684'
            '6f3472486278252417af49196847ba465b56819d286658fcdf918687f89ee032')
sha512sums=('757eb4f231c80683fd7322141b420139f45de65eaeaaf41475176b0a26669198e8492a7e63eea752f6cbb923dbb26a4d7ec63cfc5173976c04db0a67e5bb9f43'
            'a50b6cf8281b56b80f55a20ac9316e1eed6887da1d191ad575dec140c9819711644d7077c4dc693b8cb0f1b08ceba0033ba88b5ad138d33ffb73b786c0d4bf81')

build() {
  cd ${pkgbase}-${pkgver}
  # requires java language level 6, which >=13 has dropped
  export PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin:${PATH}"
  ./gradlew installAll \
    -PfinalRelease=true \
    -Pgradle_installPath="$(pwd)/dist"
}

package_gradle() {
  cd ${pkgbase}-${pkgver}/dist
  optdepends=(
    'gradle-doc: gradle documentation'
    'gradle-src: gradle sources'
  )

  # install profile.d script
  install -Dm 644 "${srcdir}/${pkgbase}.sh" "${pkgdir}/etc/profile.d/${pkgbase}.sh"

  # create the necessary directory structure
  install -d "${pkgdir}/usr/share/java/${pkgname}/bin"
  install -d "${pkgdir}/usr/share/java/${pkgname}/lib/plugins"
  install -d "${pkgdir}/usr/share/java/${pkgname}/init.d"
  install -d "${pkgdir}/usr/bin"

  # copy across jar files
  install -Dm 644 lib/*.jar "${pkgdir}/usr/share/java/${pkgname}/lib"
  install -Dm 644 lib/plugins/*.jar "${pkgdir}/usr/share/java/${pkgname}/lib/plugins"

  # copy across supporting text documentation and scripts
  install -m 644 NOTICE "${pkgdir}/usr/share/java/${pkgname}"
  install -m 755 bin/gradle "${pkgdir}/usr/share/java/${pkgname}/bin"
  install -m 644 init.d/*.* "${pkgdir}/usr/share/java/${pkgname}/init.d"

  # link gradle script to /usr/bin
  ln -s /usr/share/java/${pkgname}/bin/${pkgname} "${pkgdir}/usr/bin"
}

package_gradle-doc() {
  pkgdesc+=' (documentation)'
  options=('!strip')

  cd ${pkgbase}-${pkgver}/dist
  install -d "${pkgdir}/usr/share/java/gradle/docs"
  cp -r docs/* "${pkgdir}/usr/share/java/gradle/docs"
}

package_gradle-src() {
  pkgdesc+=' (sources)'
  options=('!strip')

  cd ${pkgbase}-${pkgver}/dist
  install -d "${pkgdir}/usr/share/java/gradle/src"
  cp -r src/* "${pkgdir}/usr/share/java/gradle/src"
}

# vim: ts=2 sw=2 et: