PageRenderTime 36ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Formula/ettercap.rb

https://github.com/Drarok/homebrew
Ruby | 60 lines | 43 code | 11 blank | 6 comment | 6 complexity | 2436fd61f91538135e5ef3b3a08c669b MD5 | raw file
  1. require 'formula'
  2. class Ettercap < Formula
  3. homepage 'http://ettercap.github.io/ettercap/'
  4. stable do
  5. url "https://github.com/Ettercap/ettercap/archive/v0.8.0.tar.gz"
  6. sha1 "008fca94bbd67b578699300eb321766cd41fbfff"
  7. patch do
  8. # Fixes issue #326: redefinition of 'bpf_program', 'bpf_version',
  9. # and 'bpf_insn' in ec_send.c on Mac OS X.
  10. # url: https://github.com/Ettercap/ettercap/issues/326
  11. url "https://github.com/Ettercap/ettercap/commit/4aaaa2.diff"
  12. sha1 "c1c78b38f3f1ffcdbb1d16a292c0fc6d96991ed0"
  13. end
  14. patch do
  15. # Fixes issue #344: undefined symbol safe_free_mem caused by the previous fix.
  16. # url: https://github.com/Ettercap/ettercap/issues/344
  17. url "https://github.com/Ettercap/ettercap/commit/33ac95.diff"
  18. sha1 "cdaff33bec2a73e2c44230c28f3727b8f36e45e2"
  19. end
  20. end
  21. head "https://github.com/Ettercap/ettercap.git"
  22. option "without-curses", "Install without curses interface"
  23. option "without-plugins", "Install without plugins support"
  24. option "with-ipv6", "Install with IPv6 support"
  25. depends_on 'cmake' => :build
  26. depends_on 'ghostscript' => [:build, :optional]
  27. depends_on 'pcre'
  28. depends_on 'libnet'
  29. depends_on 'curl' # require libcurl >= 7.26.0
  30. depends_on 'gtk+' => :optional
  31. depends_on 'luajit' => :optional
  32. def install
  33. args = std_cmake_args
  34. # specify build type manually since std_cmake_args sets the build type to "None".
  35. args << "-DCMAKE_BUILD_TYPE=Release"
  36. args << "-DINSTALL_SYSCONFDIR=#{etc}"
  37. args << "-DENABLE_CURSES=OFF" if build.without? "curses"
  38. args << "-DENABLE_PLUGINS=OFF" if build.without? "plugins"
  39. args << "-DENABLE_IPV6=ON" if build.with? "ipv6"
  40. args << "-DENABLE_PDF_DOCS=ON" if build.with? "ghostscript"
  41. args << "-DENABLE_GTK=OFF" if build.without? "gtk+"
  42. args << "-DENABLE_LUA=ON" if build.with? "luajit"
  43. args << ".."
  44. mkdir "build" do
  45. system "cmake", *args
  46. system "make install"
  47. end
  48. end
  49. end