From de49812990871e1705b64051c35161d5e6400269 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 24 Dec 2018 14:11:38 +0000 Subject: gentoo resync : 24.12.2018 --- net-analyzer/metasploit/Manifest | 7 +- .../metasploit/metasploit-4.14.16-r1.ebuild | 335 -------------------- .../metasploit/metasploit-4.14.16-r2.ebuild | 335 ++++++++++++++++++++ net-analyzer/metasploit/metasploit-4.14.16.ebuild | 332 -------------------- .../metasploit/metasploit-4.17.21-r4.ebuild | 348 +++++++++++++++++++++ net-analyzer/metasploit/metasploit-9999.ebuild | 91 +++--- 6 files changed, 742 insertions(+), 706 deletions(-) delete mode 100644 net-analyzer/metasploit/metasploit-4.14.16-r1.ebuild create mode 100644 net-analyzer/metasploit/metasploit-4.14.16-r2.ebuild delete mode 100644 net-analyzer/metasploit/metasploit-4.14.16.ebuild create mode 100644 net-analyzer/metasploit/metasploit-4.17.21-r4.ebuild (limited to 'net-analyzer/metasploit') diff --git a/net-analyzer/metasploit/Manifest b/net-analyzer/metasploit/Manifest index 081cc3812c55..93faf880e626 100644 --- a/net-analyzer/metasploit/Manifest +++ b/net-analyzer/metasploit/Manifest @@ -1,6 +1,7 @@ AUX database.yml 613 BLAKE2B c724103b21f7650e4c6a221a22984cbff1be21ae761b62666db5d048e087f3d4e891e30b75fcacdcb5dc2fc369dd8dff4de042d6b87f47bffffeb45bd05aca46 SHA512 b178724382a88b87b9007f950fb5e8f93936f3e5a58f89c90f67120c4d50c98d4de758c8a6e321a0a68caa12ccab003d502377621bfe762279eb5ae2a3d5ff2b DIST metasploit-4.14.16.tar.gz 23726763 BLAKE2B ab2d3f10c948db394643f2bcd9b08822f16133ef81abe7048b6c4e49bf635abded40d7359b9787f7f955ba6eccfdb81ff6372d24dd2acd732ba9f16cb41ca8b4 SHA512 882968e68ff5adf10426f6e8480f3eac7cd9b289c1e641a91e537d31a434858f2c47b4f7b5bf23fcfc22eceecd2527eedb7eac3e9a8ad4a212187762b1b9aab2 -EBUILD metasploit-4.14.16-r1.ebuild 11780 BLAKE2B ffdfc70a91f860a96e7cd3b9c3e77e67ad1662a7feb1e4fa40509ed2778f671aaf5b68c7d5e12c3f646863d65ebbbd1a978eb510403814a2a80c1be150bf5f34 SHA512 ca2fa7835ddab2e7e106409e94ffc406877cf0f7c03b6d4b97c9bb03db0439f511ac35f51e13b5864b1cbc4fc3e37b69a134baaaf026f378e363317a01c84825 -EBUILD metasploit-4.14.16.ebuild 11665 BLAKE2B 37e41d7e070d586ad86328114600fd2906142713244878158f2bc672f12c3197737df61e898812991d83ceec2a47776a19dbea3713da13196a9668c924cbdb26 SHA512 16c7a9ccaa1f001605a8e33fee78a3fc2541950f419396a158012cbee9b41df49aae1d39950ac0b86e008d975915385404820d1c52743b0d87ac7d1677a5f51e -EBUILD metasploit-9999.ebuild 11578 BLAKE2B 1d1d3580743872eaa8f20031ec0f01159486f4694bce173e75c52b7e961861a2ea60e9463d9b51d4f0080ad34d9875724be0b8d3ca81c603ad2d334d9ab68f54 SHA512 021ffb2749c626adfa7448971cfda65b0f86bc7afab642f5d03492ec846f31fc61a4846804c9efa1164b45d265cd436363c5c58b264f1329e75cc4241944cf48 +DIST metasploit-4.17.21.tar.gz 28812125 BLAKE2B 15ff8ccac99d783b7b9cd20d6512df551b3143b4947d2f347b2558d1bafd2861d41fe6b051034c75cd25030ad85d26f261ffe9149dd27d551f92f17fcc0b4075 SHA512 00763f515bc6b556d4dbe15a7c58fac3c7febb64fb339fd5c05ad2b18b5b55bdf8815daca35f24bb22bea3d376db4f4610918730d813079e5ac3f8d5ad16d2d9 +EBUILD metasploit-4.14.16-r2.ebuild 11790 BLAKE2B 8b2fb60ffa9bf4636f4c0cbd25802fa531339d4e439478118fbef1fd2b411095544984195bccf69100049ecdca7f7e276e2f79ca489d953e2a597f9ce6cfde34 SHA512 a9a189b1d3eef0054aa63628b16b51a5c16be4861b12afae2442083cffbc37e3e18fd8ed0955d4e9190fefe0c72417b4623aca17a68c35d363097eeb4dcfaf17 +EBUILD metasploit-4.17.21-r4.ebuild 12232 BLAKE2B 6634d2be9375e19e5048ced4801f55424ac143b46b1675be8040230ee51a586e6512821509ad00dcb841411ebe715615ee8ec36715d14e1b17a1fa68206a767a SHA512 abbb8fa6cb57158bd38457456d3b63d5bf2f1a8aa2bef5a7512492bebc1174cf1572f0250801f6a954ae3f717542b864ae029993fa4581ec92c20379a9af0940 +EBUILD metasploit-9999.ebuild 12233 BLAKE2B 43593e3349db4932a2c4808be403b07e4dceb79abdad407a3285a515f31209ddddbeddf371822fc71156f99c1dae3dbbee8423d776370926a6108adcafa4dcce SHA512 eea4237aaaf6a6c36f6df83a1b4475126797c3fa2c2c5758042e28079b46637e56e0b509abe28eaa149029dd5db683111773d479c59c972b4b4f1d258483e799 MISC metadata.xml 853 BLAKE2B 9b0b2e6c82a4df1327ded8b8381fa1e557ba4353ae5dab9665e7b59950d36e61faead5d8672e2cc10dad68b5a3250126a7fb1c4edc7f6814f28ea3f6df663473 SHA512 9af2dae0c12ae84ae2a7887fad0e7f5ea1d945a8b6e6674ba9e3c3bbff167b00a4aeff2da8b457ff8657f83d617dad67f633b260578a1e9608475fe45585cad0 diff --git a/net-analyzer/metasploit/metasploit-4.14.16-r1.ebuild b/net-analyzer/metasploit/metasploit-4.14.16-r1.ebuild deleted file mode 100644 index 1609560a6419..000000000000 --- a/net-analyzer/metasploit/metasploit-4.14.16-r1.ebuild +++ /dev/null @@ -1,335 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -#never ever ever have more than one ruby in here -USE_RUBY="ruby23" -inherit eutils ruby-ng - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" - EGIT_CHECKOUT_DIR="${WORKDIR}"/all - inherit git-r3 - KEYWORDS="" - SLOT="9999" -else - ##Tags https://github.com/rapid7/metasploit-framework/releases - MY_PV=${PV/_p/-} - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm" - RUBY_S="${PN}-framework-${MY_PV}" - inherit versionator - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" -fi - -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" -HOMEPAGE="http://www.metasploit.org/" -LICENSE="BSD" -IUSE="development +java nexpose openvas oracle +pcap test" - -#multiple known bugs with tests reported upstream and ignored -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) -RESTRICT="test" - -RUBY_COMMON_DEPEND="virtual/ruby-ssl - >=dev-ruby/activesupport-4.2.6:4.2 - >=dev-ruby/actionpack-4.2.6:4.2 - >=dev-ruby/activerecord-4.2.6:4.2 - dev-ruby/bcrypt-ruby - dev-ruby/bit-struct - >=dev-ruby/builder-3.0 - dev-ruby/bundler - dev-ruby/filesize - >=dev-ruby/jsobfu-0.3.0 - dev-ruby/json:* - dev-ruby/kissfft - dev-ruby/metasm:1.0.2 - >=dev-ruby/metasploit_data_models-2.0.0 - dev-ruby/meterpreter_bins:0.0.22 - dev-ruby/metasploit-payloads:1.2.24 - dev-ruby/metasploit_payloads-mettle:0.1.9 - >=dev-ruby/metasploit-credential-2.0.0 - >=dev-ruby/metasploit-concern-2.0.0 - >=dev-ruby/metasploit-model-2.0.0 - dev-ruby/msgpack - dev-ruby/net-ssh:* - dev-ruby/nokogiri - dev-ruby/octokit - dev-ruby/openssl-ccm:1.2.1 - dev-ruby/patch_finder - >=dev-ruby/recog-2.0.14 - dev-ruby/redcarpet - >=dev-ruby/rkelly-remix-0.0.6 - dev-ruby/rex-arch - dev-ruby/rex-bin_tools - dev-ruby/rex-core - dev-ruby/rex-encoder - dev-ruby/rex-exploitation - dev-ruby/rex-java - dev-ruby/rex-mime - dev-ruby/rex-nop - dev-ruby/rex-ole - dev-ruby/rex-powershell - dev-ruby/rex-random_identifier - dev-ruby/rex-registry - dev-ruby/rex-socket - dev-ruby/rex-sslscan - dev-ruby/rex-rop_builder - dev-ruby/rex-struct2 - dev-ruby/rex-text - dev-ruby/rex-zip - dev-ruby/ruby_smb - dev-ruby/sqlite3 - >=dev-ruby/pg-0.11 - dev-ruby/packetfu:1.1.13 - >=dev-ruby/rubyzip-1.1 - >=dev-ruby/rb-readline-0.5.4 - dev-ruby/robots - dev-ruby/sshkey - dev-ruby/tzinfo:* - dev-ruby/windows_error - dev-ruby/xmlrpc - java? ( dev-ruby/rjb ) - nexpose? ( dev-ruby/nexpose ) - openvas? ( dev-ruby/openvas-omp ) - oracle? ( dev-ruby/ruby-oci8 ) - pcap? ( dev-ruby/pcaprub:* - dev-ruby/network_interface ) - development? ( dev-ruby/fivemat - dev-ruby/pry - dev-ruby/redcarpet - dev-ruby/yard - >=dev-ruby/rake-10.0.0 - >=dev-ruby/factory_girl-4.1.0 )" - #lorcon doesn't support ruby21 - #lorcon? ( net-wireless/lorcon[ruby] ) -ruby_add_bdepend "${RUBY_COMMON_DEPEND} - test? ( >=dev-ruby/factory_girl-4.1.0 - dev-ruby/fivemat - dev-ruby/database_cleaner - >=dev-ruby/rspec-2.12 - dev-ruby/shoulda-matchers - dev-ruby/timecop - >=dev-ruby/rake-10.0.0 )" -ruby_add_rdepend "${RUBY_COMMON_DEPEND}" - -COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] - net-analyzer/nmap" -RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.16" - -RESTRICT="strip" - -QA_PREBUILT=" - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so - " - -pkg_setup() { - if use test; then - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail - su postgres -c "createuser msf_test_user -d -S -R" - if [ $? -ne 0 ]; then - su postgres -c "dropuser msf_test_user" || die - su postgres -c "createuser msf_test_user -d -S -R" || die - fi - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die - fi - ruby-ng_pkg_setup -} - -all_ruby_unpack() { - if [[ ${PV} == "9999" ]] ; then - git-r3_src_unpack - else - default_src_unpack -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all -# rm -r msf3 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) - #msf_version=${msf_version#*=} - fi -} - -all_ruby_prepare() { - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" - eapply_user - - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run - rm -r data/cpuinfo - - #remove unneeded ruby bundler versioning files - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements - #we regen this file in each_ruby_prepare - rm Gemfile.lock - - #The Gemfile contains real known deps - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die - #use released packetfu - sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die - #git gems are only for ruby24 support and we are not there yet - sed -i "/git:/d" Gemfile || die - - #now we edit the Gemfile based on use flags - if ! use pcap; then - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die - fi - if ! use nexpose; then - sed -i -e "/nexpose/d" metasploit-framework.gemspec || die - fi - #no support for nessus right now - #if ! use nessus; then - sed -i -e "/nessus/d" metasploit-framework.gemspec || die - #fi - if ! use openvas; then - sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die - fi - #even if we pass --without=blah bundler still calculates the deps and messes us up - if ! use development; then - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die - fi - if ! use test; then - sed -i -e "/^group :test/,/^end$/d" Gemfile || die - fi - if ! use test && ! use development; then - sed -i -e "/^group :development/,/^end$/d" Gemfile || die - fi - #We don't need simplecov - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - - #we need to edit the gemspec too, since it tries to call git instead of anything sane - #probably a better way to fix this... if I care at some point - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die - - #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo - sed -i '/tzinfo-data/d' metasploit-framework.gemspec - - #avoid specifically versioned rex-arch - sed -i -e "/rex-arch/ s/, '0.1.4'//" metasploit-framework.gemspec || die - - #let's bogart msfupdate - rm msfupdate - echo "#!/bin/sh" > msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"\"" >> msfupdate - if [[ ${PV} == "9999" ]] ; then - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate - echo "else" >> msfupdate - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate - echo "fi" >> msfupdate - else - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate - fi - #this is set executable in src_install - - #install our database.yml file before tests are run - cp "${FILESDIR}"/database.yml config/ - -} - -each_ruby_prepare() { - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die - - #force all metasploit executables to use desired ruby version - #https://dev.metasploit.com/redmine/issues/8357 - for file in $(ls -1 msf*) - do - #poorly adapted from python.eclass - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" - done -} - -each_ruby_test() { - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox - - #we bogart msfupdate so no point in trying to test it - rm spec/msfupdate_spec.rb || die - #we don't really want to be uploading to virustotal during the tests - rm spec/tools/virustotal_spec.rb || die - - # https://dev.metasploit.com/redmine/issues/8425 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die - - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" -} - -each_ruby_install() { - #Tests have already been run, we don't need this stuff - rm -r spec || die - rm -r test || die - rm Gemfile.lock || die - - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. - # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md - fowners -R root:0 / - -} - -all_ruby_install() { - # do not remove LICENSE, bug #238137 - dodir /usr/share/doc/${PF} - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation - - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate - - #tell revdep-rebuild to ignore binaries meant for the target - dodir /etc/revdep-rebuild - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} - #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - EOF -} - -pkg_postinst() { - elog "Before use you should run 'env-update' and '. /etc/profile'" - elog "otherwise you may be missing important environmental variables." - - elog "You need to prepare the database by running:" - elog "emerge --config postgresql" - elog "/etc/init.d/postgresql- start" - elog "emerge --config =metasploit-${PV}" - - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} - - einfo - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" -} - -pkg_config() { - einfo "If the following fails, it is likely because you forgot to start/config postgresql first" - su postgres -c "createuser msf_user -D -S -R" - su postgres -c "createdb --owner=msf_user msf_database" -} diff --git a/net-analyzer/metasploit/metasploit-4.14.16-r2.ebuild b/net-analyzer/metasploit/metasploit-4.14.16-r2.ebuild new file mode 100644 index 000000000000..fb8f4c563b88 --- /dev/null +++ b/net-analyzer/metasploit/metasploit-4.14.16-r2.ebuild @@ -0,0 +1,335 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +#never ever ever have more than one ruby in here +USE_RUBY="ruby23" +inherit eutils ruby-ng + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" + EGIT_CHECKOUT_DIR="${WORKDIR}"/all + inherit git-r3 + KEYWORDS="" + SLOT="9999" +else + ##Tags https://github.com/rapid7/metasploit-framework/releases + MY_PV=${PV/_p/-} + SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm" + RUBY_S="${PN}-framework-${MY_PV}" + inherit eapi7-ver + SLOT="$(ver_cut 1).$(ver_cut 2)" +fi + +DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" +HOMEPAGE="http://www.metasploit.org/" +LICENSE="BSD" +IUSE="development +java nexpose openvas oracle +pcap test" + +#multiple known bugs with tests reported upstream and ignored +#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) +RESTRICT="test" + +RUBY_COMMON_DEPEND="virtual/ruby-ssl + >=dev-ruby/activesupport-4.2.6:4.2 + >=dev-ruby/actionpack-4.2.6:4.2 + >=dev-ruby/activerecord-4.2.6:4.2 + dev-ruby/bcrypt-ruby + dev-ruby/bit-struct + >=dev-ruby/builder-3.0 + dev-ruby/bundler + dev-ruby/filesize:* + >=dev-ruby/jsobfu-0.3.0:* + dev-ruby/json:* + dev-ruby/kissfft + dev-ruby/metasm:1.0.2 + >=dev-ruby/metasploit_data_models-2.0.0 + dev-ruby/meterpreter_bins:0.0.22 + dev-ruby/metasploit-payloads:1.2.24 + dev-ruby/metasploit_payloads-mettle:0.1.9 + >=dev-ruby/metasploit-credential-2.0.0 + >=dev-ruby/metasploit-concern-2.0.0 + >=dev-ruby/metasploit-model-2.0.0 + dev-ruby/msgpack + dev-ruby/net-ssh:* + dev-ruby/nokogiri + dev-ruby/octokit + dev-ruby/openssl-ccm:1.2.1 + dev-ruby/patch_finder + >=dev-ruby/recog-2.0.14 + dev-ruby/redcarpet + >=dev-ruby/rkelly-remix-0.0.6 + dev-ruby/rex-arch + dev-ruby/rex-bin_tools + dev-ruby/rex-core + dev-ruby/rex-encoder + dev-ruby/rex-exploitation + dev-ruby/rex-java + dev-ruby/rex-mime + dev-ruby/rex-nop + dev-ruby/rex-ole + dev-ruby/rex-powershell + dev-ruby/rex-random_identifier + dev-ruby/rex-registry + dev-ruby/rex-socket + dev-ruby/rex-sslscan + dev-ruby/rex-rop_builder + dev-ruby/rex-struct2 + dev-ruby/rex-text + dev-ruby/rex-zip + dev-ruby/ruby_smb:* + dev-ruby/sqlite3 + >=dev-ruby/pg-0.11:* + dev-ruby/packetfu:1.1.13 + >=dev-ruby/rubyzip-1.1 + >=dev-ruby/rb-readline-0.5.4 + dev-ruby/robots + dev-ruby/sshkey + dev-ruby/tzinfo:* + dev-ruby/windows_error + dev-ruby/xmlrpc + java? ( dev-ruby/rjb ) + nexpose? ( dev-ruby/nexpose ) + openvas? ( dev-ruby/openvas-omp ) + oracle? ( dev-ruby/ruby-oci8 ) + pcap? ( dev-ruby/pcaprub:* + dev-ruby/network_interface ) + development? ( dev-ruby/fivemat + dev-ruby/pry + dev-ruby/redcarpet + dev-ruby/yard + >=dev-ruby/rake-10.0.0 + >=dev-ruby/factory_girl-4.1.0 )" + #lorcon doesn't support ruby21 + #lorcon? ( net-wireless/lorcon[ruby] ) +ruby_add_bdepend "${RUBY_COMMON_DEPEND} + test? ( >=dev-ruby/factory_girl-4.1.0 + dev-ruby/fivemat + dev-ruby/database_cleaner + >=dev-ruby/rspec-2.12 + dev-ruby/shoulda-matchers + dev-ruby/timecop + >=dev-ruby/rake-10.0.0 )" +ruby_add_rdepend "${RUBY_COMMON_DEPEND}" + +COMMON_DEPEND="dev-db/postgresql[server] + || ( app-crypt/johntheripper-jumbo >=app-crypt/johntheripper-1.7.9-r1[-minimal] ) + net-analyzer/nmap" +RDEPEND+=" ${COMMON_DEPEND} + >=app-eselect/eselect-metasploit-0.16" + +RESTRICT="strip" + +QA_PREBUILT=" + usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin + usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin + usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso + usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin + usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf + usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so + usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so + usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so + " + +pkg_setup() { + if use test; then + su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail + su postgres -c "createuser msf_test_user -d -S -R" + if [ $? -ne 0 ]; then + su postgres -c "dropuser msf_test_user" || die + su postgres -c "createuser msf_test_user -d -S -R" || die + fi + su postgres -c "createdb --owner=msf_test_user msf_test_database" || die + fi + ruby-ng_pkg_setup +} + +all_ruby_unpack() { + if [[ ${PV} == "9999" ]] ; then + git-r3_src_unpack + else + default_src_unpack +# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all +# rm -r msf3 + #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) + #msf_version=${msf_version#*=} + fi +} + +all_ruby_prepare() { + # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs + #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" + eapply_user + + #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run + rm -r data/cpuinfo + + #remove unneeded ruby bundler versioning files + #Gemfile.lock contains the versions tested by the msf team but not the hard requirements + #we regen this file in each_ruby_prepare + rm Gemfile.lock + + #The Gemfile contains real known deps + sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die + #use released packetfu + sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die + #git gems are only for ruby24 support and we are not there yet + sed -i "/git:/d" Gemfile || die + + #now we edit the Gemfile based on use flags + if ! use pcap; then + sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die + fi + if ! use nexpose; then + sed -i -e "/nexpose/d" metasploit-framework.gemspec || die + fi + #no support for nessus right now + #if ! use nessus; then + sed -i -e "/nessus/d" metasploit-framework.gemspec || die + #fi + if ! use openvas; then + sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die + fi + #even if we pass --without=blah bundler still calculates the deps and messes us up + if ! use development; then + sed -i -e "/^group :development do/,/^end$/d" Gemfile || die + fi + if ! use test; then + sed -i -e "/^group :test/,/^end$/d" Gemfile || die + fi + if ! use test && ! use development; then + sed -i -e "/^group :development/,/^end$/d" Gemfile || die + fi + #We don't need simplecov + sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die + sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die + + #we need to edit the gemspec too, since it tries to call git instead of anything sane + #probably a better way to fix this... if I care at some point + sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die + + #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo + sed -i '/tzinfo-data/d' metasploit-framework.gemspec + + #avoid specifically versioned rex-arch + sed -i -e "/rex-arch/ s/, '0.1.4'//" metasploit-framework.gemspec || die + + #let's bogart msfupdate + rm msfupdate + echo "#!/bin/sh" > msfupdate + echo "echo \"[*]\"" >> msfupdate + echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate + echo "echo \"[*]\"" >> msfupdate + echo "echo \"\"" >> msfupdate + if [[ ${PV} == "9999" ]] ; then + echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate + echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate + echo "else" >> msfupdate + echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate + echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate + echo "fi" >> msfupdate + else + echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate + echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate + echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate + fi + #this is set executable in src_install + + #install our database.yml file before tests are run + cp "${FILESDIR}"/database.yml config/ + +} + +each_ruby_prepare() { + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die + + #force all metasploit executables to use desired ruby version + #https://dev.metasploit.com/redmine/issues/8357 + for file in $(ls -1 msf*) + do + #poorly adapted from python.eclass + sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" + done +} + +each_ruby_test() { + #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox + + #we bogart msfupdate so no point in trying to test it + rm spec/msfupdate_spec.rb || die + #we don't really want to be uploading to virustotal during the tests + rm spec/tools/virustotal_spec.rb || die + + # https://dev.metasploit.com/redmine/issues/8425 + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die + + MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die + su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" +} + +each_ruby_install() { + #Tests have already been run, we don't need this stuff + rm -r spec || die + rm -r test || die + rm Gemfile.lock || die + + #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. + # should be as simple as copying everything into the target... + dodir /usr/$(get_libdir)/${PN}${SLOT} + cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" + rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md + fowners -R root:0 / + +} + +all_ruby_install() { + # do not remove LICENSE, bug #238137 + dodir /usr/share/doc/${PF} + cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die + ln -s "../../share/doc/${PF}/documentation" "${ED}/usr/$(get_libdir)/${PN}${SLOT}/documentation" + + fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate + + #tell revdep-rebuild to ignore binaries meant for the target + dodir /etc/revdep-rebuild + cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} + #These dirs contain prebuilt binaries for running on the TARGET not the HOST + SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" + SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" + EOF +} + +pkg_postinst() { + elog "Before use you should run 'env-update' and '. /etc/profile'" + elog "otherwise you may be missing important environmental variables." + + elog "You need to prepare the database by running:" + elog "emerge --config postgresql" + elog "/etc/init.d/postgresql- start" + elog "emerge --config =metasploit-${PV}" + + "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} + + einfo + elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" +} + +pkg_config() { + einfo "If the following fails, it is likely because you forgot to start/config postgresql first" + su postgres -c "createuser msf_user -D -S -R" + su postgres -c "createdb --owner=msf_user msf_database" +} diff --git a/net-analyzer/metasploit/metasploit-4.14.16.ebuild b/net-analyzer/metasploit/metasploit-4.14.16.ebuild deleted file mode 100644 index 5057b32c61ab..000000000000 --- a/net-analyzer/metasploit/metasploit-4.14.16.ebuild +++ /dev/null @@ -1,332 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -#never ever ever have more than one ruby in here -USE_RUBY="ruby23" -inherit eutils ruby-ng - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" - EGIT_CHECKOUT_DIR="${WORKDIR}"/all - inherit git-r3 - KEYWORDS="" - SLOT="9999" -else - ##Tags https://github.com/rapid7/metasploit-framework/releases - MY_PV=${PV/_p/-} - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm" - RUBY_S="${PN}-framework-${MY_PV}" - inherit versionator - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" -fi - -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" -HOMEPAGE="http://www.metasploit.org/" -LICENSE="BSD" -IUSE="development +java nexpose openvas oracle +pcap test" - -#multiple known bugs with tests reported upstream and ignored -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) -RESTRICT="test" - -RUBY_COMMON_DEPEND="virtual/ruby-ssl - >=dev-ruby/activesupport-4.2.6:4.2 - >=dev-ruby/actionpack-4.2.6:4.2 - >=dev-ruby/activerecord-4.2.6:4.2 - dev-ruby/bcrypt-ruby - dev-ruby/bit-struct - >=dev-ruby/builder-3.0 - dev-ruby/bundler - dev-ruby/filesize - >=dev-ruby/jsobfu-0.3.0 - dev-ruby/json:* - dev-ruby/kissfft - dev-ruby/metasm:1.0.2 - >=dev-ruby/metasploit_data_models-2.0.0 - dev-ruby/meterpreter_bins:0.0.22 - dev-ruby/metasploit-payloads:1.2.24 - dev-ruby/metasploit_payloads-mettle:0.1.9 - >=dev-ruby/metasploit-credential-2.0.0 - >=dev-ruby/metasploit-concern-2.0.0 - >=dev-ruby/metasploit-model-2.0.0 - dev-ruby/msgpack - dev-ruby/net-ssh:* - dev-ruby/nokogiri - dev-ruby/octokit - dev-ruby/openssl-ccm:1.2.1 - dev-ruby/patch_finder - >=dev-ruby/recog-2.0.14 - dev-ruby/redcarpet - >=dev-ruby/rkelly-remix-0.0.6 - dev-ruby/rex-arch - dev-ruby/rex-bin_tools - dev-ruby/rex-core - dev-ruby/rex-encoder - dev-ruby/rex-exploitation - dev-ruby/rex-java - dev-ruby/rex-mime - dev-ruby/rex-nop - dev-ruby/rex-ole - dev-ruby/rex-powershell - dev-ruby/rex-random_identifier - dev-ruby/rex-registry - dev-ruby/rex-socket - dev-ruby/rex-sslscan - dev-ruby/rex-rop_builder - dev-ruby/rex-struct2 - dev-ruby/rex-text - dev-ruby/rex-zip - dev-ruby/ruby_smb - dev-ruby/sqlite3 - >=dev-ruby/pg-0.11 - dev-ruby/packetfu:1.1.13 - >=dev-ruby/rubyzip-1.1 - >=dev-ruby/rb-readline-0.5.4 - dev-ruby/robots - dev-ruby/sshkey - dev-ruby/tzinfo:* - dev-ruby/windows_error - dev-ruby/xmlrpc - java? ( dev-ruby/rjb ) - nexpose? ( dev-ruby/nexpose ) - openvas? ( dev-ruby/openvas-omp ) - oracle? ( dev-ruby/ruby-oci8 ) - pcap? ( dev-ruby/pcaprub:* - dev-ruby/network_interface ) - development? ( dev-ruby/fivemat - dev-ruby/pry - dev-ruby/redcarpet - dev-ruby/yard - >=dev-ruby/rake-10.0.0 - >=dev-ruby/factory_girl-4.1.0 )" - #lorcon doesn't support ruby21 - #lorcon? ( net-wireless/lorcon[ruby] ) -ruby_add_bdepend "${RUBY_COMMON_DEPEND} - test? ( >=dev-ruby/factory_girl-4.1.0 - dev-ruby/fivemat - dev-ruby/database_cleaner - >=dev-ruby/rspec-2.12 - dev-ruby/shoulda-matchers - dev-ruby/timecop - >=dev-ruby/rake-10.0.0 )" -ruby_add_rdepend "${RUBY_COMMON_DEPEND}" - -COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] - net-analyzer/nmap" -RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.16" - -RESTRICT="strip" - -QA_PREBUILT=" - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so - " - -pkg_setup() { - if use test; then - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail - su postgres -c "createuser msf_test_user -d -S -R" - if [ $? -ne 0 ]; then - su postgres -c "dropuser msf_test_user" || die - su postgres -c "createuser msf_test_user -d -S -R" || die - fi - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die - fi - ruby-ng_pkg_setup -} - -all_ruby_unpack() { - if [[ ${PV} == "9999" ]] ; then - git-r3_src_unpack - else - default_src_unpack -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all -# rm -r msf3 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) - #msf_version=${msf_version#*=} - fi -} - -all_ruby_prepare() { - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" - eapply_user - - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run - rm -r data/cpuinfo - - #remove unneeded ruby bundler versioning files - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements - #we regen this file in each_ruby_prepare - rm Gemfile.lock - - #The Gemfile contains real known deps - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die - #use released packetfu - sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die - #git gems are only for ruby24 support and we are not there yet - sed -i "/git:/d" Gemfile || die - - #now we edit the Gemfile based on use flags - if ! use pcap; then - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die - fi - if ! use nexpose; then - sed -i -e "/nexpose/d" metasploit-framework.gemspec || die - fi - #no support for nessus right now - #if ! use nessus; then - sed -i -e "/nessus/d" metasploit-framework.gemspec || die - #fi - if ! use openvas; then - sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die - fi - #even if we pass --without=blah bundler still calculates the deps and messes us up - if ! use development; then - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die - fi - if ! use test; then - sed -i -e "/^group :test/,/^end$/d" Gemfile || die - fi - if ! use test && ! use development; then - sed -i -e "/^group :development/,/^end$/d" Gemfile || die - fi - #We don't need simplecov - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - - #we need to edit the gemspec too, since it tries to call git instead of anything sane - #probably a better way to fix this... if I care at some point - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die - - #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo - sed -i '/tzinfo-data/d' metasploit-framework.gemspec - - #let's bogart msfupdate - rm msfupdate - echo "#!/bin/sh" > msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"\"" >> msfupdate - if [[ ${PV} == "9999" ]] ; then - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate - echo "else" >> msfupdate - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate - echo "fi" >> msfupdate - else - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate - fi - #this is set executable in src_install - - #install our database.yml file before tests are run - cp "${FILESDIR}"/database.yml config/ - -} - -each_ruby_prepare() { - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die - - #force all metasploit executables to use desired ruby version - #https://dev.metasploit.com/redmine/issues/8357 - for file in $(ls -1 msf*) - do - #poorly adapted from python.eclass - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" - done -} - -each_ruby_test() { - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox - - #we bogart msfupdate so no point in trying to test it - rm spec/msfupdate_spec.rb || die - #we don't really want to be uploading to virustotal during the tests - rm spec/tools/virustotal_spec.rb || die - - # https://dev.metasploit.com/redmine/issues/8425 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die - - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" -} - -each_ruby_install() { - #Tests have already been run, we don't need this stuff - rm -r spec || die - rm -r test || die - rm Gemfile.lock || die - - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. - # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md - fowners -R root:0 / - -} - -all_ruby_install() { - # do not remove LICENSE, bug #238137 - dodir /usr/share/doc/${PF} - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation - - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate - - #tell revdep-rebuild to ignore binaries meant for the target - dodir /etc/revdep-rebuild - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} - #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - EOF -} - -pkg_postinst() { - elog "Before use you should run 'env-update' and '. /etc/profile'" - elog "otherwise you may be missing important environmental variables." - - elog "You need to prepare the database by running:" - elog "emerge --config postgresql" - elog "/etc/init.d/postgresql- start" - elog "emerge --config =metasploit-${PV}" - - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} - - einfo - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" -} - -pkg_config() { - einfo "If the following fails, it is likely because you forgot to start/config postgresql first" - su postgres -c "createuser msf_user -D -S -R" - su postgres -c "createdb --owner=msf_user msf_database" -} diff --git a/net-analyzer/metasploit/metasploit-4.17.21-r4.ebuild b/net-analyzer/metasploit/metasploit-4.17.21-r4.ebuild new file mode 100644 index 000000000000..9c5d8872886b --- /dev/null +++ b/net-analyzer/metasploit/metasploit-4.17.21-r4.ebuild @@ -0,0 +1,348 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +#never ever ever have more than one ruby in here +USE_RUBY="ruby24" +inherit eutils ruby-ng + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" + EGIT_BRANCH="4.x" + EGIT_CHECKOUT_DIR="${WORKDIR}"/all + inherit git-r3 + KEYWORDS="" + SLOT="9999" +else + ##Tags https://github.com/rapid7/metasploit-framework/releases + MY_PV=${PV/_p/-} + SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" + RUBY_S="${PN}-framework-${MY_PV}" + inherit eapi7-ver + SLOT="$(ver_cut 1).$(ver_cut 2)" +fi + +DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" +HOMEPAGE="http://www.metasploit.org/" +LICENSE="BSD" +IUSE="development +java nexpose openvas oracle +pcap test" + +#multiple known bugs with tests reported upstream and ignored +#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) +RESTRICT="test" + +#grep spec.add_runtime_dependency metasploit-framework.gemspec | sort +RUBY_COMMON_DEPEND="virtual/ruby-ssl + >=dev-ruby/actionpack-4.2.6:4.2 + >=dev-ruby/activerecord-4.2.6:4.2 + >=dev-ruby/activesupport-4.2.6:4.2 + dev-ruby/backports + dev-ruby/bcrypt-ruby + dev-ruby/bcrypt_pbkdf + dev-ruby/bit-struct + dev-ruby/bundler + dev-ruby/dnsruby + dev-ruby/faker + dev-ruby/filesize:* + dev-ruby/jsobfu:* + dev-ruby/json:* + dev-ruby/metasm:* + dev-ruby/metasploit-concern + =dev-ruby/rake-10.0.0 + >=dev-ruby/factory_girl-4.1.0 )" + #lorcon doesn't support ruby21 + #lorcon? ( net-wireless/lorcon[ruby] ) +ruby_add_bdepend "${RUBY_COMMON_DEPEND} + test? ( >=dev-ruby/factory_girl-4.1.0 + dev-ruby/fivemat + dev-ruby/database_cleaner + >=dev-ruby/rspec-2.12 + dev-ruby/shoulda-matchers + dev-ruby/timecop + >=dev-ruby/rake-10.0.0 )" +ruby_add_rdepend "${RUBY_COMMON_DEPEND}" + +COMMON_DEPEND="dev-db/postgresql[server] + || ( app-crypt/johntheripper-jumbo >=app-crypt/johntheripper-1.7.9-r1[-minimal] ) + net-analyzer/nmap" +RDEPEND+=" ${COMMON_DEPEND} + >=app-eselect/eselect-metasploit-0.16" + +RESTRICT="strip" + +QA_PREBUILT=" + usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin + usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin + usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin + usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin + usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso + usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso + usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin + usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf + usr/lib*/${PN}${SLOT}/data/exploits/mysql/lib_mysqludf_sys_32.so + usr/lib*/${PN}${SLOT}/data/exploits/* + usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so + usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so + usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so + usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_aarch64_linux.bin + " + +pkg_setup() { + if use test; then + su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail + su postgres -c "createuser msf_test_user -d -S -R" + if [ $? -ne 0 ]; then + su postgres -c "dropuser msf_test_user" || die + su postgres -c "createuser msf_test_user -d -S -R" || die + fi + su postgres -c "createdb --owner=msf_test_user msf_test_database" || die + fi + ruby-ng_pkg_setup +} + +all_ruby_unpack() { + if [[ ${PV} == "9999" ]] ; then + git-r3_src_unpack + else + default_src_unpack +# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all +# rm -r msf3 + #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) + #msf_version=${msf_version#*=} + fi +} + +all_ruby_prepare() { + # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs + #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" + eapply_user + + #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run + rm -r data/cpuinfo + + #remove unneeded ruby bundler versioning files + #Gemfile.lock contains the versions tested by the msf team but not the hard requirements + #we regen this file in each_ruby_prepare + rm Gemfile.lock + + #The Gemfile contains real known deps + sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die + #use released packetfu + sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die + #use the stable pg + #https://github.com/rapid7/metasploit-framework/issues/10234 + sed -i "s/dependency 'pg', '0.20.0'/dependency 'pg', '0.21.0'/" metasploit-framework.gemspec || die + #git gems are only for ruby24 support and we are not there yet + sed -i "/git:/d" Gemfile || die + + #now we edit the Gemfile based on use flags + if ! use pcap; then + sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die + fi + if ! use nexpose; then + sed -i -e "/nexpose/d" metasploit-framework.gemspec || die + fi + #no support for nessus right now + #if ! use nessus; then + sed -i -e "/nessus/d" metasploit-framework.gemspec || die + #fi + if ! use openvas; then + sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die + fi + #even if we pass --without=blah bundler still calculates the deps and messes us up + if ! use development; then + sed -i -e "/^group :development do/,/^end$/d" Gemfile || die + fi + if ! use test; then + sed -i -e "/^group :test/,/^end$/d" Gemfile || die + fi + if ! use test && ! use development; then + sed -i -e "/^group :development/,/^end$/d" Gemfile || die + fi + #We don't need simplecov + sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die + sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die + + #we need to edit the gemspec too, since it tries to call git instead of anything sane + #probably a better way to fix this... if I care at some point + sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die + + #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo + sed -i '/tzinfo-data/d' metasploit-framework.gemspec + + #let's bogart msfupdate + rm msfupdate + echo "#!/bin/sh" > msfupdate + echo "echo \"[*]\"" >> msfupdate + echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate + echo "echo \"[*]\"" >> msfupdate + echo "echo \"\"" >> msfupdate + if [[ ${PV} == "9999" ]] ; then + echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate + echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate + echo "else" >> msfupdate + echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate + echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate + echo "fi" >> msfupdate + else + echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate + echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate + echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate + fi + #this is set executable in src_install + + #install our database.yml file before tests are run + cp "${FILESDIR}"/database.yml config/ + +} + +each_ruby_prepare() { + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die + + #force all metasploit executables to use desired ruby version + #https://dev.metasploit.com/redmine/issues/8357 + for file in $(ls -1 msf*) + do + #poorly adapted from python.eclass + sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" + done +} + +each_ruby_test() { + #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox + + #we bogart msfupdate so no point in trying to test it + rm spec/msfupdate_spec.rb || die + #we don't really want to be uploading to virustotal during the tests + rm spec/tools/virustotal_spec.rb || die + + # https://dev.metasploit.com/redmine/issues/8425 + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die + + MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die + su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" +} + +each_ruby_install() { + #Tests have already been run, we don't need this stuff + rm -r spec || die + rm -r test || die + rm Gemfile.lock || die + + #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. + # should be as simple as copying everything into the target... + dodir /usr/lib/${PN}${SLOT} + cp -R * "${ED}"/usr/lib/${PN}${SLOT} || die "Copy files failed" + rm -Rf "${ED}"/usr/lib/${PN}${SLOT}/documentation "${ED}"/usr/lib${PN}${SLOT}/README.md + fowners -R root:0 / + +} + +all_ruby_install() { + # do not remove LICENSE, bug #238137 + dodir /usr/share/doc/${PF} + cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die + ln -s "../../share/doc/${PF}/documentation" "${ED}/usr/lib/${PN}${SLOT}/documentation" + + fperms +x /usr/lib/${PN}${SLOT}/msfupdate + + #tell revdep-rebuild to ignore binaries meant for the target + dodir /etc/revdep-rebuild + cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} + #These dirs contain prebuilt binaries for running on the TARGET not the HOST + SEARCH_DIRS_MASK="/usr/lib/${PN}${SLOT}/data/meterpreter" + SEARCH_DIRS_MASK="/usr/lib/${PN}${SLOT}/data/exploits" + EOF +} + +pkg_postinst() { + elog "Before use you should run 'env-update' and '. /etc/profile'" + elog "otherwise you may be missing important environmental variables." + + elog "You need to prepare the database by running:" + elog "emerge --config postgresql" + elog "/etc/init.d/postgresql- start" + elog "emerge --config =metasploit-${PV}" + + "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} + + einfo + elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" +} + +pkg_config() { + einfo "If the following fails, it is likely because you forgot to start/config postgresql first" + su postgres -c "createuser msf_user -D -S -R" + su postgres -c "createdb --owner=msf_user msf_database" +} diff --git a/net-analyzer/metasploit/metasploit-9999.ebuild b/net-analyzer/metasploit/metasploit-9999.ebuild index 3f4e20c9c000..dbc324bc0ec4 100644 --- a/net-analyzer/metasploit/metasploit-9999.ebuild +++ b/net-analyzer/metasploit/metasploit-9999.ebuild @@ -1,14 +1,15 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="6" #never ever ever have more than one ruby in here -USE_RUBY="ruby23" +USE_RUBY="ruby24" inherit eutils ruby-ng if [[ ${PV} == "9999" ]] ; then EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" + EGIT_BRANCH="4.x" EGIT_CHECKOUT_DIR="${WORKDIR}"/all inherit git-r3 KEYWORDS="" @@ -17,10 +18,10 @@ else ##Tags https://github.com/rapid7/metasploit-framework/releases MY_PV=${PV/_p/-} SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm ~x86" + KEYWORDS="~amd64 ~x86" RUBY_S="${PN}-framework-${MY_PV}" - inherit versionator - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" + inherit eapi7-ver + SLOT="$(ver_cut 1).$(ver_cut 2)" fi DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" @@ -32,35 +33,43 @@ IUSE="development +java nexpose openvas oracle +pcap test" #http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) RESTRICT="test" +#grep spec.add_runtime_dependency metasploit-framework.gemspec | sort RUBY_COMMON_DEPEND="virtual/ruby-ssl - >=dev-ruby/activesupport-4.2.6:4.2 >=dev-ruby/actionpack-4.2.6:4.2 >=dev-ruby/activerecord-4.2.6:4.2 + >=dev-ruby/activesupport-4.2.6:4.2 + dev-ruby/backports dev-ruby/bcrypt-ruby + dev-ruby/bcrypt_pbkdf dev-ruby/bit-struct - >=dev-ruby/builder-3.0 dev-ruby/bundler - dev-ruby/filesize - >=dev-ruby/jsobfu-0.3.0 + dev-ruby/dnsruby + dev-ruby/faker + dev-ruby/filesize:* + dev-ruby/jsobfu:* dev-ruby/json:* - dev-ruby/kissfft - dev-ruby/metasm:1.0.2 - >=dev-ruby/metasploit_data_models-2.0.0 - dev-ruby/meterpreter_bins:0.0.22 - dev-ruby/metasploit-payloads:1.2.28 - dev-ruby/metasploit_payloads-mettle:0.1.9 - >=dev-ruby/metasploit-credential-2.0.0 - >=dev-ruby/metasploit-concern-2.0.0 - >=dev-ruby/metasploit-model-2.0.0 + dev-ruby/metasm:* + dev-ruby/metasploit-concern + =dev-ruby/recog-2.0.14 + dev-ruby/pdf-reader:* + ~dev-ruby/pg-0.21.0 + dev-ruby/railties:* + dev-ruby/rb-readline + dev-ruby/recog:* dev-ruby/redcarpet - >=dev-ruby/rkelly-remix-0.0.6 dev-ruby/rex-arch dev-ruby/rex-bin_tools dev-ruby/rex-core @@ -70,25 +79,24 @@ RUBY_COMMON_DEPEND="virtual/ruby-ssl dev-ruby/rex-mime dev-ruby/rex-nop dev-ruby/rex-ole - dev-ruby/rex-powershell + =dev-ruby/pg-0.11 - dev-ruby/packetfu:1.1.13 - >=dev-ruby/rubyzip-1.1 - >=dev-ruby/rb-readline-0.5.4 - dev-ruby/robots dev-ruby/sshkey dev-ruby/tzinfo:* dev-ruby/windows_error + dev-ruby/xdr:2.0.0 dev-ruby/xmlrpc java? ( dev-ruby/rjb ) nexpose? ( dev-ruby/nexpose ) @@ -115,7 +123,7 @@ ruby_add_bdepend "${RUBY_COMMON_DEPEND} ruby_add_rdepend "${RUBY_COMMON_DEPEND}" COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] + || ( app-crypt/johntheripper-jumbo >=app-crypt/johntheripper-1.7.9-r1[-minimal] ) net-analyzer/nmap" RDEPEND+=" ${COMMON_DEPEND} >=app-eselect/eselect-metasploit-0.16" @@ -138,9 +146,14 @@ QA_PREBUILT=" usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf + usr/lib*/${PN}${SLOT}/data/exploits/mysql/lib_mysqludf_sys_32.so + usr/lib*/${PN}${SLOT}/data/exploits/* usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so + usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux_dll.bin + usr/lib*/${PN}${SLOT}/data/templates/template_aarch64_linux.bin " pkg_setup() { @@ -180,8 +193,14 @@ all_ruby_prepare() { #Gemfile.lock contains the versions tested by the msf team but not the hard requirements #we regen this file in each_ruby_prepare rm Gemfile.lock + #The Gemfile contains real known deps sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die + #use released packetfu + sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die + #use the stable pg + #https://github.com/rapid7/metasploit-framework/issues/10234 + sed -i "s/dependency 'pg', '0.20.0'/dependency 'pg', '0.21.0'/" metasploit-framework.gemspec || die #git gems are only for ruby24 support and we are not there yet sed -i "/git:/d" Gemfile || die @@ -283,9 +302,9 @@ each_ruby_install() { #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md + dodir /usr/lib/${PN}${SLOT} + cp -R * "${ED}"/usr/lib/${PN}${SLOT} || die "Copy files failed" + rm -Rf "${ED}"/usr/lib/${PN}${SLOT}/documentation "${ED}"/usr/lib/${PN}${SLOT}/README.md fowners -R root:0 / } @@ -294,16 +313,16 @@ all_ruby_install() { # do not remove LICENSE, bug #238137 dodir /usr/share/doc/${PF} cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation + ln -s "../../share/doc/${PF}/documentation" "${ED}/usr/lib/${PN}${SLOT}/documentation" - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate + fperms +x /usr/lib/${PN}${SLOT}/msfupdate #tell revdep-rebuild to ignore binaries meant for the target dodir /etc/revdep-rebuild cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" + SEARCH_DIRS_MASK="/usr/lib/${PN}${SLOT}/data/meterpreter" + SEARCH_DIRS_MASK="/usr/lib/${PN}${SLOT}/data/exploits" EOF } -- cgit v1.2.3