%global debug_package %{nil} %global gradle_ver 7.6.1 %global dex_ver 2.1 %global yajsw_ver 13.09 %global pydev_ver 6.3.1 %global cdt_ver 8.6.0 %global cdt_short_ver 8.6 %global sarif_ver 2.1 %global ghidra_dir ghidra-Ghidra_%{version}_build %global dep_dir %{ghidra_dir}/dependencies %global flat_repo_dir %{dep_dir}/flatRepo %global fid_dir %{dep_dir}/fidb %global jre_ver 17 Name: ghidra Version: 11.1.2 %global short_version %{version} Release: 1%{?dist} Summary: ghidra - Software reverse engineering (SRE) suite of tools License: Apache 2.0 URL: https://ghidra-sre.org/ Source0: https://github.com/NationalSecurityAgency/ghidra/archive/Ghidra_%{version}_build.tar.gz Source1: https://downloads.gradle.org/distributions/gradle-%{gradle_ver}-bin.zip Source2: https://github.com/pxb1988/dex2jar/releases/download/v%{dex_ver}/dex2jar-%{dex_ver}.zip Source3: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar Source4: https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-%{yajsw_ver}/yajsw-stable-%{yajsw_ver}.zip Source5: https://sourceforge.net/projects/pydev/files/pydev/PyDev%20%{pydev_ver}/PyDev%20%{pydev_ver}.zip#/PyDev-%{pydev_ver}.zip Source6: https://archive.eclipse.org/tools/cdt/releases/%{cdt_short_ver}/cdt-%{cdt_ver}.zip Source7: https://github.com/NationalSecurityAgency/ghidra-data/raw/Ghidra_%{version}/lib/java-sarif-%{sarif_ver}-modified.jar Source8: ghidra.desktop Requires: java-%{jre_ver}-openjdk BuildRequires: java-%{jre_ver}-openjdk-devel BuildRequires: java-%{jre_ver}-openjdk-headless BuildRequires: gcc gcc-c++ BuildRequires: bison flex BuildRequires: desktop-file-utils %description Ghidra is a software reverse engineering (SRE) framework developed by NSA's Research Directorate for NSA's cybersecurity mission. It helps analyze malicious code and malware like viruses, and can give cybersecurity professionals a better understanding of potential vulnerabilities in their networks and systems. %package server Summary: Ghidra Server Requires: %{name}%{?_isa} = %{version} %description server Ghidra Server %package docs Summary: Ghidra Documentation Requires: %{name}%{?_isa} = %{version} %description docs Ghidra Documentation %prep %setup -q -c %{name}-%{version} -a 1 -a 2 -a 5 mkdir -p %{dep_dir}/{GhidraDev,GhidraServer} %{flat_repo_dir} %{fid_dir} cp dex-tools-%{dex_ver}/lib/dex-*.jar %{flat_repo_dir} cp "%{SOURCE3}" "%{flat_repo_dir}" cp "%{SOURCE4}" "%{dep_dir}/GhidraServer" cp "%{SOURCE5}" "%{dep_dir}/GhidraDev" cp "%{SOURCE6}" "%{dep_dir}/GhidraDev" cp "%{SOURCE7}" "%{flat_repo_dir}" %build cd %{ghidra_dir} JAVA_HOME=%{_jvmdir}/jre-%{jre_ver}-openjdk \ ../gradle-%{gradle_ver}/bin/gradle buildGhidra \ -x buildPyPackage %install mkdir -p %{buildroot}/%{_libdir}/%{name}/ %{buildroot}/%{_bindir}/ unzip %{ghidra_dir}/build/dist/ghidra_%{short_version}_DEV_%{lua: print(os.date("%Y%m%d"))}_linux*.zip cp -r ghidra_%{short_version}_DEV/* %{buildroot}/%{_libdir}/%{name} ln -s %{_libdir}/%{name}/ghidraRun %{buildroot}/%{_bindir}/%{name} ln -s %{_libdir}/%{name}/server/ghidraSvr %{buildroot}/%{_bindir}/%{name}-server ln -s %{_libdir}/%{name}/server/svrAdmin %{buildroot}/%{_bindir}/%{name}-server-admin ln -s %{_libdir}/%{name}/server/svrInstall %{buildroot}/%{_bindir}/%{name}-server-install ln -s %{_libdir}/%{name}/server/svrUninstall %{buildroot}/%{_bindir}/%{name}-server-uninstall mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps/ install -p -m 0644 %{ghidra_dir}/Ghidra/RuntimeScripts/Windows/support/ghidra.ico %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps/ghidra.ico desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE8} %files %{_bindir}/%{name} %dir %{_libdir}/%{name} %{_libdir}/%{name}/ghidraRun %{_libdir}/%{name}/LICENSE %{_libdir}/%{name}/Extensions/ %{_libdir}/%{name}/Ghidra/ %{_libdir}/%{name}/GPL/ %{_libdir}/%{name}/licenses/ %{_libdir}/%{name}/support/ %{_libdir}/%{name}/bom.json %{_datadir}/applications/ghidra.desktop %{_datadir}/icons/hicolor/scalable/apps/ghidra.ico %license %{ghidra_dir}/LICENSE %files server %{_bindir}/%{name}-server %{_bindir}/%{name}-server-admin %{_bindir}/%{name}-server-install %{_bindir}/%{name}-server-uninstall %{_libdir}/%{name}/server/ %files docs %{_libdir}/%{name}/docs/ %changelog * Sun Jul 14 2024 Jan200101 - 11.1.2-1 - Update to 11.1.2 * Sun Jan 14 2024 Jan Drögehoff - 11.0-1 - Update to 11.0 * Sat Oct 28 2023 Jan Drögehoff - 10.4-1 - Update to 10.4 * Tue Jul 25 2023 Jan Drögehoff - 10.3.2-1 - Update to 10.3.2 * Sun Jun 18 2023 Jan Drögehoff - 10.3.1-1 - Update to 10.3.1 * Fri May 12 2023 Jan Drögehoff - 10.3-1 - Update to 10.3 * Wed Apr 19 2023 Jan Drögehoff - 10.2.3-1 - Update to 10.2.3 * Mon Nov 14 2022 Jan Drögehoff - 10.2.1-1 - Update to 10.2.1 * Sat May 21 2022 Jan Drögehoff - 10.1.4-1 - Update to 10.1.4 * Sun Jan 30 2022 Jan Drögehoff - 10.1.2-1 - Update to 10.1.2 * Sun Jan 30 2022 Jan Drögehoff - 10.1.1-1 - Update to 10.1.1 * Sun Jan 30 2022 Jan Drögehoff - 10.1-1 - Update to 10.1 * Wed Oct 06 2021 Jan Drögehoff - 10.0.4-2 - Update to 10.0.4 * Wed Oct 06 2021 Jan Drögehoff - 10.0-1 - Update to 10.0 * Fri Jun 18 2021 Jan Drögehoff - 9.2.4-1 - Update Ghidra * Sun May 16 2021 Jan Drögehoff - 9.2.3-1 - Update * Sat Nov 14 14:05:36 CET 2020 Jan Drögehoff - 9.2-1 - Update to ghidra 9.2 * Fri Sep 18 2020 Jan Drögehoff - 9.1.2-1 - Initial spec