diff options
author | James An | 2018-03-17 15:42:09 -0400 |
---|---|---|
committer | James An | 2018-03-17 15:57:55 -0400 |
commit | 5aae2e831ef69741cd7e68aa97d06072925e08a2 (patch) | |
tree | 39ac70c427a888744144f13109c27a4ea2225955 | |
parent | f78a7686360b7e8eddba4a7519f155a38da53f26 (diff) | |
download | aur-5aae2e831ef69741cd7e68aa97d06072925e08a2.tar.gz |
Updated to the latest upstream source release and cleaned up the PKGBUILD inline with the AUR package, pmd-bin.
Added custom shell scripts instead of patching the bundled scripts as suggested by the Java packaging guidelines.
Changed build() to generate the binary distributable package so the package() function is identical to that of pmd-bin.
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 65 | ||||
-rw-r--r-- | pmdapp | 29 | ||||
-rw-r--r-- | run.patch | 99 |
4 files changed, 55 insertions, 157 deletions
@@ -1,19 +1,18 @@ pkgbase = pmd - pkgdesc = A java source code scanner for detecting possible bugs, dead code, overcomplicated expressions and more - pkgver = 5.2.3 + pkgdesc = An extensible cross-language static code analyzer. + pkgver = 6.1.0 pkgrel = 1 - url = http://pmd.sourceforge.net/ + url = http://pmd.github.io arch = any - license = custom:BSD-style + license = BSD license = Apache - checkdepends = maven + makedepends = java-environment-common makedepends = maven - makedepends = unzip depends = java-environment - source = http://sourceforge.net/projects/pmd/files/pmd/5.2.3/pmd-src-5.2.3.zip - source = run.patch - md5sums = c468e0f3e2ec85bd6decda5a4570e4ec - md5sums = d565ff42cfcb1110dc74c504b9a619ec + source = https://github.com/pmd/pmd/releases/download/pmd_releases/6.1.0/pmd-src-6.1.0.zip + source = pmdapp + md5sums = 0f7ac91b14d57b18bf4c2192ce5c8152 + md5sums = 170b76a131d4651f24213f273164d175 pkgname = pmd @@ -1,67 +1,36 @@ # Maintainer: David Pugnasse <david.pugnasse@gmail.com> pkgname=pmd -pkgver=5.2.3 +pkgver=6.1.0 pkgrel=1 -pkgdesc="A java source code scanner for detecting possible bugs, dead code, overcomplicated expressions and more" +pkgdesc="An extensible cross-language static code analyzer." arch=('any') -url="http://pmd.sourceforge.net/" -license=('custom:BSD-style' 'Apache') +url="http://pmd.github.io" +license=('BSD' 'Apache') depends=('java-environment') -makedepends=('maven' 'unzip') -checkdepends=('maven') -source=( - "http://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgver/$pkgname-src-$pkgver.zip" - run.patch -) -md5sums=( - 'c468e0f3e2ec85bd6decda5a4570e4ec' - 'd565ff42cfcb1110dc74c504b9a619ec' -) -_M2_REPO=repo - -prepare() { - test -d "$_M2_REPO" || mkdir "$_M2_REPO" - cd "$pkgname-src-$pkgver" - mvn -Dmaven.repo.local="$srcdir/$_M2_REPO" \ - -Dmaven.test.skip=true \ - clean \ - validate - - patch -p1 -d "$pkgname-dist/src/main/scripts" < ../run.patch -} +makedepends=('java-environment-common' 'maven') +source=("https://github.com/$pkgname/$pkgname/releases/download/${pkgname}_releases/$pkgver/$pkgname-src-$pkgver.zip" + pmdapp) +md5sums=('0f7ac91b14d57b18bf4c2192ce5c8152' + '170b76a131d4651f24213f273164d175') build() { cd "$pkgname-src-$pkgver" - mvn -Dmaven.repo.local="$srcdir/$_M2_REPO" \ - -Dmaven.test.skip=true \ - compile - - for BIN in bgastviewer cpd cpdgui pmd pmd-designer; do - printf "#%c/bin/sh\nexec /usr/bin/$pkgname-run $BIN \"\$@\"\n" ! > "../$BIN" - done -} -check() { - cd "$pkgname-src-$pkgver" - mvn -Dmaven.repo.local="$srcdir/$_M2_REPO" \ - test + sh mvnw clean package -DskipTests=true -Dmaven.javadoc.skip=true + bsdtar -xzf pmd-dist/target/pmd-bin-6.1.0.zip --strip-components 1 pmd-bin-6.1.0/lib } package() { cd "$pkgname-src-$pkgver" - mvn -Dmaven.repo.local="$srcdir/$_M2_REPO" \ - -Dmaven.test.skip=true \ - verify - unzip -o "$pkgname-dist/target/$pkgname-bin-$pkgver.zip" -d "$srcdir" - cd "$srcdir/$pkgname-bin-$pkgver" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - install -Dm755 bin/run.sh "$pkgdir/usr/bin/$pkgname-run" - for BIN in bgastviewer cpd cpdgui pmd pmd-designer; do - install -Dm755 "../$BIN" "$pkgdir/usr/bin/$BIN" + + for app in pmd-bgastviewer pmd-cpd pmd-cpdgui pmd-designer pmd-designerold pmd; do + install -Dm755 "../pmdapp" "$pkgdir/usr/bin/$app" done + cd lib - for JAR in *.jar; do - install -Dm644 "$JAR" "$pkgdir/usr/share/java/$pkgname/$JAR" + for file in *.jar; do + install -Dm644 "$file" "$pkgdir/usr/share/java/$pkgname/$file" done } diff --git a/pmdapp b/pmdapp new file mode 100644 index 000000000000..01d08578760a --- /dev/null +++ b/pmdapp @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +app=$(basename $0) +case "$app" in + 'pmd') + readonly class='net.sourceforge.pmd.PMD' + ;; + 'pmd-cpd') + readonly class='net.sourceforge.pmd.cpd.CPD' + ;; + 'pmd-designer') + readonly class='net.sourceforge.pmd.util.fxdesigner.Designer' + ;; + 'pmd-designerold') + readonly class='net.sourceforge.pmd.util.designer.Designer' + ;; + 'pmd-bgastviewer') + readonly class='net.sourceforge.pmd.util.viewer.Viewer' + ;; + 'pmd-cpdgui') + readonly class='net.sourceforge.pmd.cpd.GUI' + ;; +esac + +for file in /usr/share/java/pmd/*.jar; do + CP="$CP:$file" +done + +exec /usr/bin/java -cp "$CP" "$class" "$@" diff --git a/run.patch b/run.patch deleted file mode 100644 index 7fec56c9fcde..000000000000 --- a/run.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- bin/run.sh 2015-01-07 06:40:19.614130823 -0500 -+++ bin/run.sh 2015-01-07 06:42:04.648794800 -0500 -@@ -5,7 +5,7 @@ - echo " $(basename $0) <application-name> [-h|-v] ..." - echo "" - echo "application-name: valid options are: $(valid_app_options)" -- echo "-h print this help" -+ echo "-h print this help" - echo "-v display PMD's version" - } - -@@ -13,37 +13,6 @@ - echo "pmd, cpd, cpdgui, designer, bgastviewer" - } - --is_cygwin() { -- case "$(uname)" in -- CYGWIN*) -- readonly cygwin=true -- ;; -- esac -- # OS specific support. $var _must_ be set to either true or false. -- if [ -z ${cygwin} ] ; then -- readonly cygwin=false -- fi --} -- --cygwin_paths() { -- # For Cygwin, switch paths to Windows format before running java -- if ${cygwin} ; then -- JAVA_HOME=$(cygpath --windows "${JAVA_HOME}") -- classpath=$(cygpath --path --windows "${classpath}") -- DIRECTORY=$(cygpath --windows "${DIRECTORY}") -- fi --} -- --convert_cygwin_vars() { -- # If cygwin, convert to Unix form before manipulating -- if ${cygwin} ; then -- [ -n "${JAVA_HOME}" ] && -- JAVA_HOME=$(cygpath --unix "${JAVA_HOME}") -- [ -n "${CLASSPATH}" ] && -- CLASSPATH=$(cygpath --path --unix "${CLASSPATH}") -- fi --} -- - java_heapsize_settings() { - local heapsize=${HEAPSIZE} - case "${heapsize}" in -@@ -58,24 +27,6 @@ - esac - } - -- --set_lib_dir() { -- if [ -z ${LIB_DIR} ]; then -- local script_dir=$(dirname ${0}) -- local cwd="${PWD}" -- -- cd "${script_dir}/../lib" -- readonly LIB_DIR=$(pwd -P) -- cd "${cwd}" -- fi --} -- --check_lib_dir() { -- if [ ! -e "${LIB_DIR}" ]; then -- echo "The jar directory [${LIB_DIR}] does not exist" -- fi --} -- - readonly APPNAME="${1}" - if [ -z "${APPNAME}" ]; then - usage -@@ -104,23 +55,6 @@ - ;; - esac - --is_cygwin -- --set_lib_dir --check_lib_dir -- --convert_cygwin_vars -- --classpath=$CLASSPATH -- --cd "${CWD}" -- --for jarfile in ${LIB_DIR}/*.jar; do -- classpath=$classpath:$jarfile --done -- --cygwin_paths -- - java_heapsize_settings - --java ${HEAPSIZE} -cp "${classpath}" "${CLASSNAME}" ${@} -+java ${HEAPSIZE} -Djava.ext.dirs=/usr/share/java/pmd "${CLASSNAME}" ${@} |