diff options
author | anthraxx | 2019-07-15 21:07:44 +0200 |
---|---|---|
committer | anthraxx | 2019-07-15 21:08:58 +0200 |
commit | 68e3d510150479532104dc5d15f3aa546808f318 (patch) | |
tree | a25ce373d2fdffd1c2e21598caaa2f77a8f57773 | |
parent | 2b02db39f2283c5476860e4c7ca41024dc494a28 (diff) | |
download | aur-68e3d510150479532104dc5d15f3aa546808f318.tar.gz |
updpkg: ghidra 9.0.4 (built from source with dependencies)
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 90 | ||||
-rwxr-xr-x | ghidra | 3 |
3 files changed, 97 insertions, 22 deletions
@@ -1,18 +1,32 @@ pkgbase = ghidra - pkgdesc = A software reverse engineering (SRE) framework created and maintained by the National Security Agency Research Directorate - pkgver = 9.0.1 + pkgdesc = Software reverse engineering framework + pkgver = 9.0.4 pkgrel = 1 url = https://ghidra-sre.org/ arch = x86_64 license = Apache + makedepends = git + makedepends = gradle + makedepends = unzip depends = java-environment>=11 depends = bash optdepends = python2: for the Python feature optdepends = pam: for GhidraServer support - source = https://ghidra-sre.org/ghidra_9.0.1_PUBLIC_20190325.zip - source = ghidra - sha256sums = 58ffa488e6dc57e2c023670c1dfac0469bdb6f4e7da98f70610d9f561b65c774 - sha256sums = d1eac99a2d868c35aecb0ce66eba5f3d244cfd715510cd324821a05148b664a2 + noextract = AXMLPrinter2.jar + noextract = yajsw-stable-12.12.zip + noextract = hfsexplorer-0_21-bin.zip + source = https://github.com/NationalSecurityAgency/ghidra/archive/Ghidra_9.0.4_build.tar.gz + source = git+https://github.com/NationalSecurityAgency/ghidra-data#commit=60529abb6c1e28b689f539384a1ebd1fe13d6528 + source = https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip + source = https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar + source = https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-12.12/yajsw-stable-12.12.zip + source = https://sourceforge.net/projects/catacombae/files/HFSExplorer/0.21/hfsexplorer-0_21-bin.zip + sha512sums = SKIP + sha512sums = SKIP + sha512sums = c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358 + sha512sums = c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601 + sha512sums = 0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944 + sha512sums = b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415 pkgname = ghidra @@ -1,28 +1,92 @@ # Maintainer: Robin Broda <robin at broda dot me> +# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org> -pkgname='ghidra' -pkgver=9.0.1 +pkgname=ghidra +pkgver=9.0.4 +_ghidra_data=60529abb6c1e28b689f539384a1ebd1fe13d6528 +_d2j=2.0 +_yajsw=12.12 +_hfsx=0.21 pkgrel=1 -pkgdesc='A software reverse engineering (SRE) framework created and maintained by the National Security Agency Research Directorate' +pkgdesc='Software reverse engineering framework' arch=('x86_64') url='https://ghidra-sre.org/' license=('Apache') depends=('java-environment>=11' 'bash') +makedepends=('git' 'gradle' 'unzip') optdepends=('python2: for the Python feature' 'pam: for GhidraServer support') -source=('https://ghidra-sre.org/ghidra_9.0.1_PUBLIC_20190325.zip' 'ghidra') -sha256sums=('58ffa488e6dc57e2c023670c1dfac0469bdb6f4e7da98f70610d9f561b65c774' - 'd1eac99a2d868c35aecb0ce66eba5f3d244cfd715510cd324821a05148b664a2') +source=(https://github.com/NationalSecurityAgency/ghidra/archive/Ghidra_${pkgver}_build.tar.gz + "git+https://github.com/NationalSecurityAgency/ghidra-data#commit=${_ghidra_data}" + https://github.com/pxb1988/dex2jar/releases/download/${_d2j}/dex-tools-${_d2j}.zip + https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar + https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-${_yajsw}/yajsw-stable-${_yajsw}.zip + https://sourceforge.net/projects/catacombae/files/HFSExplorer/${_hfsx}/hfsexplorer-${_hfsx/./_}-bin.zip) +noextract=(AXMLPrinter2.jar + yajsw-stable-${_yajsw}.zip + hfsexplorer-${_hfsx/./_}-bin.zip) +sha512sums=('SKIP' + 'SKIP' + 'c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358' + 'c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601' + '0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944' + 'b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415') prepare() { - cd "${pkgname}_${pkgver}" + install -d hfsx + unzip -u hfsexplorer-${_hfsx/./_}-bin.zip -d hfsx + + cd ghidra-Ghidra_${pkgver}_build + + # Allow use of any Gradle version + sed -i '/gradleVersion/,+2d' build.gradle + + # Add repositories + cat >> build.gradle << EOF + +allprojects { + repositories { + mavenCentral() + jcenter() + flatDir name: 'localRepository', dirs: "\${rootDir}/lib" + } } +EOF -package() { - cd "${pkgname}_${pkgver}" + # Add libs + install -Dm 644 ../dex2jar-${_d2j}/lib/dex-*.jar \ + ../AXMLPrinter2.jar \ + ../hfsx/lib/{csframework,hfsx*,iharder-base64}.jar \ + -t lib + + # YAJSW expects this symlink + ln -sf ghidra-Ghidra_${pkgver}_build ../ghidra.bin + install -Dm 644 ../yajsw-stable-${_yajsw}.zip -t Ghidra/Features/GhidraServer + + # Add FID datasets + install -Dm 644 ../ghidra-data/FunctionID/*.fidb -t Ghidra/Features/FunctionID/src/main/fidb - install -Dm755 ../ghidra "${pkgdir}/usr/bin/ghidra" - install -dm655 "${pkgdir}/opt/ghidra" - cp -R * "${pkgdir}/opt/ghidra/" - chmod -R a+r "${pkgdir}/opt/ghidra" + # Ignore lack of licensing for YAJSW zip, packed FID datasets, and the native binaries + sed -i '/FileTree tree/a\\t\texclude "yajsw-stable-**.zip"\n\t\texclude "src/main/fidb/**.fidb"\n\t\texclude "os/linux64/**"' gradleScripts/ip.gradle } + +build() { + cd ghidra-Ghidra_${pkgver}_build + gradle yajswDevUnpack + gradle prebuildNatives_linux64 + gradle buildGhidra +} + +package() { + cd ghidra-Ghidra_${pkgver}_build + install -d "${pkgdir}"/{opt,usr/bin} + _appver=$(grep -oP '(?<=^application.version=).*$' Ghidra/application.properties) + _relname=$(grep -oP '(?<=^application.release.name=).*$' Ghidra/application.properties) + unzip -u "build/dist/ghidra_${_appver}_${_relname}_$(date +"%Y%m%d")_linux64.zip" -d "${pkgdir}"/opt + mv "${pkgdir}"/opt/ghidra{"_${_appver}",} + ln -s /opt/ghidra/ghidraRun "${pkgdir}"/usr/bin/ghidra + ln -s /opt/ghidra/support/analyzeHeadless "${pkgdir}"/usr/bin/ghidra-analyzeHeadless + install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/ghidra +} + +# vim: ts=2 sw=2 et: diff --git a/ghidra b/ghidra deleted file mode 100755 index d32a4edbd280..000000000000 --- a/ghidra +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -exec /opt/ghidra/ghidraRun "$@" |