summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames An2015-01-10 03:47:57 -0500
committerJames An2015-01-10 03:47:57 -0500
commitbc8b9ddc05f0acd02273e78b4e789fd5b0d96348 (patch)
tree5cbd611254c657fd6c401a80d23250ce3a01b438
downloadaur-bc8b9ddc05f0acd02273e78b4e789fd5b0d96348.tar.gz
Added new pmd-bin AUR package, derived from pmd except using binary source files.
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD46
-rw-r--r--run.patch99
3 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d78ade406bf2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = pmd-bin
+ pkgdesc = A java source code scanner for detecting possible bugs, dead code, overcomplicated expressions and more
+ pkgver = 5.2.3
+ pkgrel = 2
+ url = http://pmd.sourceforge.net/
+ arch = any
+ license = custom:BSD-style
+ license = Apache
+ makedepends = unzip
+ depends = java-environment
+ provides = pmd
+ conflicts = pmd
+ source = http://sourceforge.net/projects/pmd/files/pmd/5.2.3/pmd-bin-5.2.3.zip
+ source = run.patch
+ md5sums = b66632f523cbeef93dd3c820f7007a4a
+ md5sums = 764732c9d41b5f2d7d15af1f7f819f27
+
+pkgname = pmd-bin
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c30a6c383ed8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: James An <james@jamesan.ca>
+# Contributor: David Pugnasse <david.pugnasse@gmail.com>
+
+_pkgname=pmd
+pkgname="$_pkgname-bin"
+pkgver=5.2.3
+pkgrel=2
+pkgdesc="A java source code scanner for detecting possible bugs, dead code, overcomplicated expressions and more"
+arch=('any')
+url="http://pmd.sourceforge.net/"
+license=('custom:BSD-style' 'Apache')
+depends=('java-environment')
+makedepends=('unzip')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+source=(
+ "http://sourceforge.net/projects/$_pkgname/files/$_pkgname/$pkgver/$_pkgname-bin-$pkgver.zip"
+ run.patch
+)
+md5sums=(
+ 'b66632f523cbeef93dd3c820f7007a4a'
+ '764732c9d41b5f2d7d15af1f7f819f27'
+)
+
+prepare() {
+ patch -p1 -d "$_pkgname-bin-$pkgver/bin" < run.patch
+}
+
+build() {
+ for BIN in bgastviewer cpd cpdgui pmd pmd-designer; do
+ printf "#%c/bin/sh\nexec /usr/bin/$_pkgname-run $BIN \"\$@\"\n" ! > "$BIN"
+ done
+}
+
+package() {
+ cd "$_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"
+ done
+ cd lib
+ for JAR in *.jar; do
+ install -Dm644 "$JAR" "$pkgdir/usr/share/java/$_pkgname/$JAR"
+ done
+}
diff --git a/run.patch b/run.patch
new file mode 100644
index 000000000000..fa7e07862065
--- /dev/null
+++ b/run.patch
@@ -0,0 +1,99 @@
+--- 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}" ${@}