git.iko.soy/typeable/nixpkgs
on master help sign in
photon: init at 1.0.7 (#44269)
commit38e582c91d6a77d0579f0635de414ef0aa68dc02 authorBignaux Ronan <ronan@aimao.org> dateThu 2 Aug 2018, 09:49 (8 years ago) parent3676506
3 files changed+62
pkgs/tools/networking/photon/default.nix+40 pkgs/tools/networking/photon/destdir.patch+20 pkgs/top-level/all-packages.nix+2
pkgs/tools/networking/photon/default.nixnew file+40
@@ -0,0 +1,40 @@
1+{ stdenv, pythonPackages, fetchurl, makeWrapper }:
2+
3+with pythonPackages;
4+buildPythonApplication rec {
5+ pname = "photon";
6+ version = "1.0.7";
7+
8+ src = fetchurl {
9+ url = "https://github.com/s0md3v/Photon/archive/v${version}.tar.gz";
10+ sha256 = "0c5l1sbkkagfxmh8v7yvi6z58mhqbwjyr7fczb5qwxm7la42ah9y";
11+ };
12+
13+ patches = [ ./destdir.patch ];
14+ postPatch = ''
15+ substituteInPlace photon.py --replace DESTDIR $out/share/photon
16+ '';
17+
18+ dontBuild = true;
19+ doCheck = false;
20+ propagatedBuildInputs = [
21+ requests
22+ urllib3
23+ ];
24+
25+ installPhase = ''
26+ mkdir -p "$out"/{bin,share/photon}
27+ cp -R photon.py core plugins $out/share/photon
28+
29+ makeWrapper ${python.interpreter} $out/bin/photon \
30+ --set PYTHONPATH "$PYTHONPATH:$out/share/photon" \
31+ --add-flags "-O $out/share/photon/photon.py"
32+ '';
33+
34+ meta = with stdenv.lib; {
35+ description = "a lightning fast web crawler which extracts URLs, files, intel & endpoints from a target";
36+ homepage = https://github.com/s0md3v/Photon;
37+ license = licenses.gpl3;
38+ maintainers = with maintainers; [ genesis ];
39+ };
40+}
pkgs/tools/networking/photon/destdir.patchnew file+20
@@ -0,0 +1,20 @@
1+diff --git a/photon.py.old b/photon.py
2+index 92498e4..f7e2c3d 100644
3+--- a/photon.py.old
4++++ b/photon.py
5+@@ -185,7 +185,7 @@ if args.user_agent:
6+ user_agents = args.user_agent.split(',')
7+ else:
8+ user_agents = []
9+- with open(os.getcwd() + '/core/user-agents.txt', 'r') as uas:
10++ with open('DESTDIR/core/user-agents.txt', 'r') as uas:
11+ for agent in uas:
12+ user_agents.append(agent.strip('\n'))
13+
14+@@ -534,4 +534,4 @@ if args.export:
15+ if not colors: # if colors are disabled
16+ print ('%s Results saved in %s directory' % (good, output_dir))
17+ else:
18+- print ('%s Results saved in \033[;1m%s\033[0m directory' % (good, output_dir))
19+\ No newline at end of file
20++ print ('%s Results saved in \033[;1m%s\033[0m directory' % (good, output_dir))
pkgs/top-level/all-packages.nix+2
@@ -1444,6 +1444,8 @@ with pkgs;
14441444
14451445 pbzx = callPackage ../tools/compression/pbzx { };
14461446
1447+ photon = callPackage ../tools/networking/photon { };
1448+
14471449 playerctl = callPackage ../tools/audio/playerctl { };
14481450
14491451 ps_mem = callPackage ../tools/system/ps_mem { };