%global moz_extensions %{_datadir}/mozilla/extensions %global firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %global src_ext_id hacktools@lascc %global firefox_inst_dir %{moz_extensions}/%{firefox_app_id} Name: mozilla-hacktools Version: 0.5.0 Release: %{autorelease} Summary: The all-in-one browser extension for offensive security professionals. License: LGPL-3.0-only URL: https://github.com/LasCC/HackTools/ Source0: https://github.com/LasCC/HackTools/releases/download/%{version}/bundle_moz.zip Source1: mozilla-hacktools.metainfo.xml Patch0: manifest.patch Requires: mozilla-filesystem BuildArch: noarch # GNOME Software Center not present on EL < 7 %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: libappstream-glib %endif %description Hacktools, is a web extension facilitating your web application penetration tests, it includes cheat sheets as well as all the tools used during a test such as XSS payloads, Reverse shells to test your web application. %prep # Extract .zip contents to subdirectory for modification and access to dist directory %setup -c # Apply patch to manifest.json to inject correct extension ID cd dist %autopatch %build # Rebuild the .xpi with the patched manifest cd dist zip -qr ./hacktools-%{version}.xpi * %install # Install the rebuilt .xpi to the correct Firefox system extension directory cd dist install -Dpm644 hacktools-%{version}.xpi \ %{buildroot}%{firefox_inst_dir}/%{src_ext_id}.xpi # Install AppStream metadata install -Dpm644 %{SOURCE1} \ %{buildroot}%{_metainfodir}/%{name}.metainfo.xml # Validate AppStream metadata (relaxed mode) appstream-util validate-relax --nonet \ %{buildroot}%{_metainfodir}/%{name}.metainfo.xml %files %{firefox_inst_dir}/%{src_ext_id}.xpi # GNOME Software Center metadata %if 0%{?fedora} || 0%{?rhel} >= 7 %{_metainfodir}/%{name}.metainfo.xml %endif %changelog %autochangelog