├── .github └── workflows │ └── verify.yml ├── .gitignore ├── .gitmodules ├── .ruby-version ├── Berksfile ├── Gemfile ├── Gemfile.lock ├── Makefile ├── README.md ├── USAGE.md ├── config ├── patches │ ├── gdbm │ │ └── v1.8.3-Makefile.in.patch │ ├── jemalloc │ │ └── jemalloc-centos-fix.patch │ ├── libedit │ │ ├── freebsd-vi-fix.patch │ │ └── openbsd-weak-alias-fix.patch │ ├── libffi │ │ └── libffi-3.2.1-disable-multi-os-directory.patch │ ├── libiconv │ │ ├── libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch │ │ └── v1.14.ppc64le-ldemulation.patch │ ├── libxslt │ │ ├── libxslt-cve-2015-7995.patch │ │ ├── libxslt-mingw32.patch │ │ ├── libxslt-solaris-configure.patch │ │ ├── libxslt-windows-relocate-1.1.30.patch │ │ └── libxslt-windows-relocate.patch │ ├── libyaml │ │ └── v0.1.6.windows-configure.patch │ ├── ncurses │ │ ├── ncurses-5.9-gcc-5.patch │ │ ├── ncurses-5.9-solaris-xopen_source_extended-detection.patch │ │ ├── ncurses-clang.patch │ │ ├── patch-aa │ │ ├── patch-ab │ │ ├── patch-ac │ │ ├── patch-ad │ │ ├── patch-cxx_cursesf.h │ │ ├── patch-cxx_cursesm.h │ │ └── patch-ncurses_tinfo_lib__baudrate.c │ ├── openssl │ │ ├── openssl-1.0.1f-do-not-build-docs.patch │ │ ├── openssl-1.0.1j-windows-relocate-dll.patch │ │ ├── openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch │ │ ├── openssl-1.0.2k-no-bang.patch │ │ ├── openssl-1.0.2x-darwin-arm64.patch │ │ └── openssl-1.1.0f-do-not-install-docs.patch │ ├── pkg-config │ │ └── openbsd-charset.patch │ ├── ruby │ │ ├── patch-configure │ │ ├── remove_nano.patch │ │ ├── ruby-2.6.4-bug14834.patch │ │ ├── ruby-2.6.7_c99.patch │ │ ├── ruby-2.7.1-rubygemsperf.patch │ │ ├── ruby-3.0.1-configure.patch │ │ ├── ruby-3.0.2-configure.patch │ │ ├── ruby-aix-atomic.patch │ │ ├── ruby-aix-configure_26_and_later.patch │ │ ├── ruby-aix-vm-core.patch │ │ ├── ruby-fast-load_26.patch │ │ ├── ruby-fast-load_31.patch │ │ ├── ruby-faster-load_26.patch │ │ ├── ruby-faster-load_27.patch │ │ ├── ruby-mkmf.patch │ │ ├── ruby-no-stack-protector-strong.patch │ │ ├── ruby-no-stack-protector.patch │ │ ├── ruby-win32_warning_removal.patch │ │ ├── ruby_aix_openssl.patch │ │ ├── ruby_aix_ssl_EAGAIN.patch │ │ └── rvm-cflags.patch │ ├── rubygems │ │ └── rubygems-3.5.10.patch │ └── zlib │ │ └── zlib-windows-relocate.patch ├── projects │ └── metasploit-framework.rb ├── software │ ├── bundler.rb │ ├── cacerts.rb │ ├── config_guess.rb │ ├── gdbm.rb │ ├── jemalloc.rb │ ├── john.rb │ ├── libedit.rb │ ├── libffi.rb │ ├── libiconv.rb │ ├── liblzma.rb │ ├── libossp-uuid.rb │ ├── libpcap.rb │ ├── libtool.rb │ ├── libuuid.rb │ ├── libxml2.rb │ ├── libxslt.rb │ ├── libyaml-windows.rb │ ├── libyaml.rb │ ├── makedepend.rb │ ├── metasploit-framework-wrappers-windows.rb │ ├── metasploit-framework-wrappers.rb │ ├── metasploit-framework.rb │ ├── ncurses.rb │ ├── nmap.rb │ ├── nokogiri.rb │ ├── openssl-windows.rb │ ├── openssl.rb │ ├── pcaprub.rb │ ├── pkg-config-lite.rb │ ├── pkg-config.rb │ ├── postgresql-prev.rb │ ├── postgresql-windows-prev.rb │ ├── postgresql-windows.rb │ ├── postgresql.rb │ ├── ruby-windows-devkit.rb │ ├── ruby-windows-msys2.rb │ ├── ruby-windows.rb │ ├── ruby.rb │ ├── rubygems.rb │ ├── util-macros.rb │ ├── winpcap-devpack.rb │ ├── xproto.rb │ └── zlib.rb └── templates │ ├── metasploit-framework-wrappers-windows │ ├── msfdb.bat.erb │ ├── msfremove.bat.erb │ ├── msfremove.ps1.erb │ ├── msfupdate.bat.erb │ ├── msfupdate.ps1.erb │ └── msfwrapper.bat.erb │ ├── metasploit-framework-wrappers │ ├── msfdb.erb │ ├── msfremove.erb │ ├── msfupdate.erb │ └── msfwrapper.erb │ └── metasploit-framework │ ├── msfdb-kali.erb │ ├── msfdb.erb │ └── version.yml.erb ├── cortex.yaml ├── docker ├── centos6-x64 │ ├── .dockerignore │ ├── Dockerfile │ └── yum.repos.d │ │ ├── CentOS-Base.repo │ │ ├── CentOS-SCLo-scl.repo │ │ └── CentOS-fasttrack.repo ├── debian-aarch64 │ ├── .dockerignore │ ├── Dockerfile │ └── apt │ │ └── sources.list ├── debian-armv7 │ ├── .dockerignore │ ├── Dockerfile │ └── apt │ │ └── sources.list ├── fedora30-x64 │ └── Dockerfile ├── kali109-x64 │ └── Dockerfile ├── ubuntu1204-x64 │ └── Dockerfile ├── ubuntu1204-x86 │ └── Dockerfile └── ubuntu1804-x64 │ └── Dockerfile ├── omnibus.rb ├── package-scripts └── metasploit-framework │ ├── postinst │ ├── postrm │ ├── preinst │ └── prerm ├── packer ├── configure_ami.sh ├── ubuntu-amd64-ami.json └── ubuntu-arm64-ami.json ├── pkg └── .gitignore └── resources └── metasploit-framework ├── msi ├── assets │ ├── LICENSE.rtf │ ├── banner_background.bmp │ ├── dialog_background.bmp │ ├── project.ico │ ├── project_16x16.ico │ └── project_32x32.ico ├── localization-en-us.wxl.erb ├── parameters.wxi.erb └── source.wxs.erb └── pkg ├── background.png ├── distribution.xml.erb ├── license.html.erb └── welcome.html.erb /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *~ 3 | .bundle 4 | .DS_Store 5 | local/build 6 | local/src 7 | vendor/bundle 8 | pkg/* 9 | bin/* 10 | files/**/cache/ 11 | vendor/cookbooks 12 | certs 13 | .idea 14 | 15 | # RVM management 16 | .ruby-version 17 | .ruby-gemset 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "local/cache"] 2 | path = local/cache 3 | url = https://github.com/rapid7/metasploit-omnibus-cache.git 4 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.5 2 | -------------------------------------------------------------------------------- /Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://api.berkshelf.com' 2 | 3 | cookbook 'omnibus' 4 | 5 | # Uncomment to use the latest version of the Omnibus cookbook from GitHub 6 | # cookbook 'omnibus', github: 'opscode-cookbooks/omnibus' 7 | 8 | group :integration do 9 | cookbook 'apt', '~> 2.3' 10 | cookbook 'freebsd', '~> 0.1' 11 | cookbook 'yum-epel', '~> 0.3' 12 | end 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Install omnibus 4 | # gem 'omnibus', '~> 4.0' 5 | gem 'omnibus', git: 'https://github.com/rapid7/omnibus', branch: 'r7_9.0.23_custom' 6 | 7 | # Use Chef's software definitions. It is recommended that you write your own 8 | # software definitions, but you can clone/fork Chef's to get you started. 9 | # gem 'omnibus-software', github: 'opscode/omnibus-software' 10 | 11 | group :development do 12 | gem 'pry-byebug' 13 | end 14 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/rapid7/omnibus 3 | revision: c6dc312d985e85fb35b8e9f8e49b607abd91665c 4 | branch: r7_9.0.23_custom 5 | specs: 6 | omnibus (9.0.23) 7 | aws-sdk-s3 (~> 1.116.0) 8 | chef-cleanroom (~> 1.0) 9 | chef-utils (>= 15.4) 10 | contracts (>= 0.16.0, < 0.17.0) 11 | ffi-yajl (~> 2.2) 12 | license_scout (~> 1.0) 13 | mixlib-shellout (>= 2.0, < 4.0) 14 | mixlib-versioning 15 | ohai (>= 16, < 19) 16 | pedump 17 | rexml (~> 3.2) 18 | ruby-progressbar (~> 1.7) 19 | thor (>= 0.18, < 2.0) 20 | 21 | GEM 22 | remote: https://rubygems.org/ 23 | specs: 24 | addressable (2.8.7) 25 | public_suffix (>= 2.0.2, < 7.0) 26 | awesome_print (1.9.2) 27 | aws-eventstream (1.3.0) 28 | aws-partitions (1.1017.0) 29 | aws-sdk-core (3.214.0) 30 | aws-eventstream (~> 1, >= 1.3.0) 31 | aws-partitions (~> 1, >= 1.992.0) 32 | aws-sigv4 (~> 1.9) 33 | jmespath (~> 1, >= 1.6.1) 34 | aws-sdk-kms (1.96.0) 35 | aws-sdk-core (~> 3, >= 3.210.0) 36 | aws-sigv4 (~> 1.5) 37 | aws-sdk-s3 (1.116.0) 38 | aws-sdk-core (~> 3, >= 3.127.0) 39 | aws-sdk-kms (~> 1) 40 | aws-sigv4 (~> 1.4) 41 | aws-sigv4 (1.10.1) 42 | aws-eventstream (~> 1, >= 1.0.2) 43 | byebug (11.1.3) 44 | chef-cleanroom (1.0.5) 45 | chef-config (18.5.0) 46 | addressable 47 | chef-utils (= 18.5.0) 48 | fuzzyurl 49 | mixlib-config (>= 2.2.12, < 4.0) 50 | mixlib-shellout (>= 2.0, < 4.0) 51 | tomlrb (~> 1.2) 52 | chef-utils (18.5.0) 53 | concurrent-ruby 54 | citrus (3.0.2) 55 | coderay (1.1.3) 56 | concurrent-ruby (1.3.4) 57 | contracts (0.16.1) 58 | ffi (1.17.0) 59 | ffi-yajl (2.6.0) 60 | libyajl2 (>= 1.2) 61 | fuzzyurl (0.9.0) 62 | iostruct (0.2.0) 63 | ipaddress (0.8.3) 64 | jmespath (1.6.2) 65 | json (2.9.0) 66 | libyajl2 (2.1.0) 67 | license_scout (1.3.15) 68 | ffi-yajl (~> 2.2) 69 | mixlib-shellout (>= 2.2, < 4.0) 70 | toml-rb (>= 1, < 3) 71 | method_source (1.1.0) 72 | mixlib-cli (2.1.8) 73 | mixlib-config (3.0.27) 74 | tomlrb 75 | mixlib-log (3.0.9) 76 | mixlib-shellout (3.3.4) 77 | chef-utils 78 | mixlib-versioning (1.2.12) 79 | multipart-post (2.4.1) 80 | net-scp (4.0.0) 81 | net-ssh (>= 2.6.5, < 8.0.0) 82 | net-ssh (7.3.0) 83 | ohai (18.1.18) 84 | chef-config (>= 14.12, < 19) 85 | chef-utils (>= 16.0, < 19) 86 | ffi (~> 1.9) 87 | ffi-yajl (~> 2.2) 88 | ipaddress 89 | mixlib-cli (>= 1.7.0) 90 | mixlib-config (>= 2.0, < 4.0) 91 | mixlib-log (>= 2.0.1, < 4.0) 92 | mixlib-shellout (~> 3.2, >= 3.2.5) 93 | plist (~> 3.1) 94 | train-core 95 | wmi-lite (~> 1.0) 96 | pedump (0.6.10) 97 | awesome_print 98 | iostruct (>= 0.0.4) 99 | multipart-post (>= 2.0.0) 100 | rainbow 101 | zhexdump (>= 0.0.2) 102 | plist (3.7.1) 103 | pry (0.14.2) 104 | coderay (~> 1.1) 105 | method_source (~> 1.0) 106 | pry-byebug (3.10.1) 107 | byebug (~> 11.0) 108 | pry (>= 0.13, < 0.15) 109 | public_suffix (6.0.1) 110 | rainbow (3.1.1) 111 | rexml (3.3.9) 112 | ruby-progressbar (1.13.0) 113 | thor (1.3.2) 114 | toml-rb (2.2.0) 115 | citrus (~> 3.0, > 3.0) 116 | tomlrb (1.3.0) 117 | train-core (3.12.7) 118 | addressable (~> 2.5) 119 | ffi (!= 1.13.0) 120 | json (>= 1.8, < 3.0) 121 | mixlib-shellout (>= 2.0, < 4.0) 122 | net-scp (>= 1.2, < 5.0) 123 | net-ssh (>= 2.9, < 8.0) 124 | wmi-lite (1.0.7) 125 | zhexdump (0.2.0) 126 | 127 | PLATFORMS 128 | ruby 129 | 130 | DEPENDENCIES 131 | omnibus! 132 | pry-byebug 133 | 134 | BUNDLED WITH 135 | 2.2.33 136 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := all 2 | 3 | .PHONY: all 4 | all: certs/ca-certificates.crt dependencies 5 | # export SSL_CERT_FILE=${PWD}/certs/ca-certificates.crt 6 | 7 | # build the metasploit-framework package 8 | ruby bin/omnibus build metasploit-framework 9 | 10 | .PHONY: dependencies 11 | dependencies: 12 | # Ensure consistent bundler versions 13 | gem install bundler -v 2.2.3 14 | 15 | # install omnibus' dependencies 16 | bundle install 17 | bundle binstubs --all 18 | 19 | gem install win32-process -v 0.9.0 20 | 21 | certs/ca-certificates.crt: 22 | mkdir -p certs 23 | curl -L -o certs/ca-certificates.crt https://curl.haxx.se/ca/cacert.pem 24 | 25 | .PHONY: clean 26 | clean: 27 | bin/omnibus clean metasploit-framework 28 | -------------------------------------------------------------------------------- /USAGE.md: -------------------------------------------------------------------------------- 1 | # Using the metasploit-framework Omnibus package 2 | 3 | Using the metasploit-framework omnibus package is simple. It is a native package that integrates well with your operating system, but does not depend on any packages outside of your base operating system. It also tries to avoid modifying or upgrading and system packages, so it should peacefully co-exist with the rest of your software. 4 | 5 | ## Quick Start 6 | 7 | To quickly install the latest version of the metasploit-omnibus package, this one-liner will add the nightly build repository, import the Rapid7 GPG key and install the package: 8 | 9 | ``` 10 | curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall 11 | ``` 12 | 13 | After installing the package, you can simply run 'msfconsole' to start the Metasploit Framework console. An initial configuration script will then run, helping you configure the initial database and setup your PATH if desired. The out-of-box setup should look something like this: 14 | 15 | ``` 16 | $ msfconsole 17 | 18 | ** Welcome to Metasploit Framework Initial Setup ** 19 | Please answer a few questions to get started. 20 | 21 | Would you like to add msfconsole and other programs to your default PATH? y 22 | You may need to start a new terminal or log in again for this to take effect. 23 | 24 | Would you like to use and setup a new database (recommended)? y 25 | Creating database at /Users/bcook/.msf4/db 26 | Starting Postgresql 27 | Creating database users 28 | Creating initial database schema 29 | 30 | ** Metasploit Framework Initial Setup Complete ** 31 | 32 | [*] Starting the Metasploit Framework console...-[*] The initial module cache will be built in the background, this can take 2-5 minutes... 33 | / 34 | 35 | Metasploit Park, System Security Interface 36 | Version 4.0.5, Alpha E 37 | Ready... 38 | > access security 39 | access: PERMISSION DENIED. 40 | > access security grid 41 | access: PERMISSION DENIED. 42 | > access main security grid 43 | access: PERMISSION DENIED....and... 44 | YOU DIDN'T SAY THE MAGIC WORD! 45 | YOU DIDN'T SAY THE MAGIC WORD! 46 | YOU DIDN'T SAY THE MAGIC WORD! 47 | YOU DIDN'T SAY THE MAGIC WORD! 48 | YOU DIDN'T SAY THE MAGIC WORD! 49 | YOU DIDN'T SAY THE MAGIC WORD! 50 | YOU DIDN'T SAY THE MAGIC WORD! 51 | 52 | 53 | =[ metasploit v4.11.0-dev [core:4.11.0.pre.dev api:1.0.0]] 54 | + -- --=[ 1454 exploits - 827 auxiliary - 229 post ] 55 | + -- --=[ 376 payloads - 37 encoders - 8 nops ] 56 | + -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ] 57 | 58 | msf > 59 | ``` 60 | 61 | ## Post Installation Information 62 | 63 | The main binaries are installed under /opt/metasploit-framework/bin. You can either add this to your PATH, or run directly, e.g. /opt/metasploit-framework/bin/msfconsole, or on Linux distributions, these will be linked directly to /usr/bin so you can run them straight away. 64 | 65 | If you want to use the database and turned down automated setup, a wrapper script 'msfdb' will configure postgresql to run as your local user, storing the database under _~/.msf4/db/_. To enable the database, run _msfdb init_. This will start the database, and all other metasploit commands will then automatically start if as necessary. 66 | 67 | ``` 68 | $ msfdb 69 | Manage a metasploit framework database 70 | 71 | msfdb init # initialize the database 72 | msfdb reinit # delete and reinitialize the database 73 | msfdb delete # delete database and stop using it 74 | msfdb status # check database status 75 | msfdb start # start the database 76 | msfdb stop # stop the database 77 | ``` 78 | 79 | _Note_ 80 | Running msfdb init will attempt to write a new database.yml file into your ~/.msf4 directory. You may want to remove or backup any pre-existing .msf4/database.yml file if you have already configured a database there. 81 | 82 | If you want to build your own installer package or modify it, see the instructions here: https://github.com/rapid7/metasploit-omnibus 83 | 84 | -------------------------------------------------------------------------------- /config/patches/gdbm/v1.8.3-Makefile.in.patch: -------------------------------------------------------------------------------- 1 | --- Makefile.in~ 2015-10-07 12:24:16.000000000 -0700 2 | +++ Makefile.in 2015-10-07 12:25:50.000000000 -0700 3 | @@ -130,22 +130,22 @@ 4 | $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \ 5 | $(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \ 6 | $(INSTALL_ROOT)$(infodir) 7 | - $(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la 8 | - $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \ 9 | + $(LIBTOOL) cp libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la 10 | + cp gdbm.h \ 11 | $(INSTALL_ROOT)$(includedir)/gdbm.h 12 | - $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \ 13 | + cp $(srcdir)/gdbm.3 \ 14 | $(INSTALL_ROOT)$(man3dir)/gdbm.3 15 | - $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \ 16 | + cp $(srcdir)/gdbm.info \ 17 | $(INSTALL_ROOT)$(infodir)/gdbm.info 18 | 19 | install-compat: 20 | $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \ 21 | $(INSTALL_ROOT)$(includedir) 22 | - $(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \ 23 | + $(LIBTOOL) cp libgdbm_compat.la \ 24 | $(INSTALL_ROOT)$(libdir)/libgdbm_compat.la 25 | - $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \ 26 | + cp $(srcdir)/dbm.h \ 27 | $(INSTALL_ROOT)$(includedir)/dbm.h 28 | - $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \ 29 | + cp $(srcdir)/ndbm.h \ 30 | $(INSTALL_ROOT)$(includedir)/ndbm.h 31 | 32 | #libgdbm.a: $(OBJS) gdbm.h 33 | -------------------------------------------------------------------------------- /config/patches/jemalloc/jemalloc-centos-fix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/jemalloc/internal/pac.h b/include/jemalloc/internal/pac.h 2 | index 01c4e6a..9122aa0 100644 3 | --- a/include/jemalloc/internal/pac.h 4 | +++ b/include/jemalloc/internal/pac.h 5 | @@ -74,7 +74,6 @@ struct pac_stats_s { 6 | atomic_zu_t abandoned_vm; 7 | }; 8 | 9 | -typedef struct pac_s pac_t; 10 | struct pac_s { 11 | /* 12 | * Must be the first member (we convert it to a PAC given only a 13 | diff --git a/include/jemalloc/internal/san_bump.h b/include/jemalloc/internal/san_bump.h 14 | index 8ec4a71..d5902ba 100644 15 | --- a/include/jemalloc/internal/san_bump.h 16 | +++ b/include/jemalloc/internal/san_bump.h 17 | @@ -9,7 +9,6 @@ 18 | 19 | extern bool opt_retain; 20 | 21 | -typedef struct ehooks_s ehooks_t; 22 | typedef struct pac_s pac_t; 23 | 24 | typedef struct san_bump_alloc_s san_bump_alloc_t; -------------------------------------------------------------------------------- /config/patches/libedit/freebsd-vi-fix.patch: -------------------------------------------------------------------------------- 1 | diff -ruN libedit-20120601-3.0/src/vi.c libedit-20120601-3.0.fixed/src/vi.c 2 | --- libedit-20120601-3.0/src/vi.c 2012-03-11 09:54:58.000000000 +0000 3 | +++ libedit-20120601-3.0.fixed/src/vi.c 2013-02-08 05:22:16.338954507 +0000 4 | @@ -918,17 +918,15 @@ 5 | * NB: posix implies that we should enter insert mode, however 6 | * this is against historical precedent... 7 | */ 8 | -#ifdef __weak_reference 9 | -__weakref_visible char *my_get_alias_text(const char *) 10 | - __weak_reference(get_alias_text); 11 | -#endif 12 | protected el_action_t 13 | /*ARGSUSED*/ 14 | vi_alias(EditLine *el, Int c __attribute__((__unused__))) 15 | { 16 | -#ifdef __weak_reference 17 | +#ifdef __weak_extern 18 | char alias_name[3]; 19 | char *alias_text; 20 | + extern __weakref_visible char *my_get_alias_text(const char *); 21 | + __weak_extern(get_alias_text); 22 | 23 | if (my_get_alias_text == 0) { 24 | return CC_ERROR; 25 | -------------------------------------------------------------------------------- /config/patches/libedit/openbsd-weak-alias-fix.patch: -------------------------------------------------------------------------------- 1 | diff -ur libedit-20120601-3.0.orig/src/strlcat.c libedit-20120601-3.0/src/strlcat.c 2 | --- libedit-20120601-3.0.orig/src/strlcat.c Wed May 13 17:47:58 2015 3 | +++ libedit-20120601-3.0/src/strlcat.c Wed May 13 17:48:14 2015 4 | @@ -29,7 +29,7 @@ 5 | 6 | #ifdef _LIBC 7 | # ifdef __weak_alias 8 | -__weak_alias(strlcat, _strlcat) 9 | +//__weak_alias(strlcat, _strlcat) 10 | # endif 11 | #endif 12 | 13 | diff -ur libedit-20120601-3.0.orig/src/strlcpy.c libedit-20120601-3.0/src/strlcpy.c 14 | --- libedit-20120601-3.0.orig/src/strlcpy.c Wed May 13 17:47:58 2015 15 | +++ libedit-20120601-3.0/src/strlcpy.c Wed May 13 17:48:14 2015 16 | @@ -29,7 +29,7 @@ 17 | 18 | #ifdef _LIBC 19 | # ifdef __weak_alias 20 | -__weak_alias(strlcpy, _strlcpy) 21 | +//__weak_alias(strlcpy, _strlcpy) 22 | # endif 23 | #endif 24 | 25 | diff -ur libedit-20120601-3.0.orig/src/unvis.c libedit-20120601-3.0/src/unvis.c 26 | --- libedit-20120601-3.0.orig/src/unvis.c Wed May 13 17:47:58 2015 27 | +++ libedit-20120601-3.0/src/unvis.c Wed May 13 17:48:14 2015 28 | @@ -50,7 +50,7 @@ 29 | #include 30 | 31 | #ifdef __weak_alias 32 | -__weak_alias(strnunvisx,_strnunvisx) 33 | +//__weak_alias(strnunvisx,_strnunvisx) 34 | #endif 35 | 36 | #if !HAVE_VIS 37 | diff -ur libedit-20120601-3.0.orig/src/vis.c libedit-20120601-3.0/src/vis.c 38 | --- libedit-20120601-3.0.orig/src/vis.c Wed May 13 17:47:58 2015 39 | +++ libedit-20120601-3.0/src/vis.c Wed May 13 17:48:14 2015 40 | @@ -69,7 +69,7 @@ 41 | #include 42 | 43 | #ifdef __weak_alias 44 | -__weak_alias(strvisx,_strvisx) 45 | +//__weak_alias(strvisx,_strvisx) 46 | #endif 47 | 48 | #if !HAVE_VIS || !HAVE_SVIS 49 | -------------------------------------------------------------------------------- /config/patches/libffi/libffi-3.2.1-disable-multi-os-directory.patch: -------------------------------------------------------------------------------- 1 | --- libffi-3.2.1-orig/configure.ac 2014-11-12 05:56:51.000000000 -0600 2 | +++ libffi-3.2.1/configure.ac 2015-10-29 15:53:41.695055040 -0500 3 | @@ -590,6 +590,10 @@ 4 | AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) 5 | fi) 6 | 7 | +AC_ARG_ENABLE(multi-os-directory, 8 | +[ --disable-multi-os-directory 9 | + disable use of gcc --print-multi-os-directory to change the library installation directory]) 10 | + 11 | # These variables are only ever used when we cross-build to X86_WIN32. 12 | # And we only support this with GCC, so... 13 | if test "x$GCC" = "xyes"; then 14 | @@ -601,11 +605,13 @@ 15 | toolexecdir="${libdir}"/gcc-lib/'$(target_alias)' 16 | toolexeclibdir="${libdir}" 17 | fi 18 | - multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` 19 | - case $multi_os_directory in 20 | - .) ;; # Avoid trailing /. 21 | - ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; 22 | - esac 23 | + if test x"$enable_multi_os_directory" != x"no"; then 24 | + multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` 25 | + case $multi_os_directory in 26 | + .) ;; # Avoid trailing /. 27 | + ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; 28 | + esac 29 | + fi 30 | AC_SUBST(toolexecdir) 31 | else 32 | toolexeclibdir="${libdir}" 33 | --- libffi-3.2.1-orig/configure 2014-11-12 11:59:57.000000000 +0000 34 | +++ libffi-3.2.1/configure 2015-10-30 19:50:51.082221000 +0000 35 | @@ -886,6 +886,7 @@ 36 | enable_structs 37 | enable_raw_api 38 | enable_purify_safety 39 | +enable_multi_os_directory 40 | ' 41 | ac_precious_vars='build_alias 42 | host_alias 43 | @@ -1538,6 +1539,8 @@ 44 | --disable-structs omit code for struct support 45 | --disable-raw-api make the raw api unavailable 46 | --enable-purify-safety purify-safe mode 47 | + --disable-multi-os-directory 48 | + disable use of gcc --print-multi-os-directory to change the library installation directory 49 | 50 | Optional Packages: 51 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 52 | @@ -18714,6 +18717,12 @@ 53 | fi 54 | 55 | 56 | +# Check whether --enable-multi-os-directory was given. 57 | +if test "${enable_multi_os_directory+set}" = set; then : 58 | + enableval=$enable_multi_os_directory; 59 | +fi 60 | + 61 | + 62 | # These variables are only ever used when we cross-build to X86_WIN32. 63 | # And we only support this with GCC, so... 64 | if test "x$GCC" = "xyes"; then 65 | @@ -18725,11 +18734,13 @@ 66 | toolexecdir="${libdir}"/gcc-lib/'$(target_alias)' 67 | toolexeclibdir="${libdir}" 68 | fi 69 | - multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` 70 | - case $multi_os_directory in 71 | - .) ;; # Avoid trailing /. 72 | - ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; 73 | - esac 74 | + if test x"$enable_multi_os_directory" != x"no"; then 75 | + multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` 76 | + case $multi_os_directory in 77 | + .) ;; # Avoid trailing /. 78 | + ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; 79 | + esac 80 | + fi 81 | 82 | else 83 | toolexeclibdir="${libdir}" 84 | -------------------------------------------------------------------------------- /config/patches/libiconv/libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch: -------------------------------------------------------------------------------- 1 | --- libiconv-1.14/srclib/stdio.in.h.orig 2014-07-02 01:49:41.484192961 +0000 2 | +++ libiconv-1.14/srclib/stdio.in.h 2014-07-02 01:51:10.433127793 +0000 3 | @@ -679,26 +679,6 @@ 4 | # endif 5 | #endif 6 | 7 | -#if @GNULIB_GETS@ 8 | -# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ 9 | -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 10 | -# undef gets 11 | -# define gets rpl_gets 12 | -# endif 13 | -_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); 14 | -_GL_CXXALIAS_RPL (gets, char *, (char *s)); 15 | -# else 16 | -_GL_CXXALIAS_SYS (gets, char *, (char *s)); 17 | -# undef gets 18 | -# endif 19 | -_GL_CXXALIASWARN (gets); 20 | -/* It is very rare that the developer ever has full control of stdin, 21 | - so any use of gets warrants an unconditional warning. Assume it is 22 | - always declared, since it is required by C89. */ 23 | -_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); 24 | -#endif 25 | - 26 | - 27 | #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ 28 | struct obstack; 29 | /* Grow an obstack with formatted output. Return the number of 30 | -------------------------------------------------------------------------------- /config/patches/libiconv/v1.14.ppc64le-ldemulation.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index e511b04..2d92a70 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -8123,9 +8123,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 6 | x86_64-*linux*) 7 | LD="${LD-ld} -m elf_x86_64" 8 | ;; 9 | - ppc*-*linux*|powerpc*-*linux*) 10 | + ppc64-*linux*|powerpc64-*linux*) 11 | LD="${LD-ld} -m elf64ppc" 12 | ;; 13 | + ppc64le-*linux*|powerpc64le-*linux*) 14 | + LD="${LD-ld} -m elf64lppc" 15 | + ;; 16 | s390*-*linux*|s390*-*tpf*) 17 | LD="${LD-ld} -m elf64_s390" 18 | ;; 19 | diff --git a/libcharset/configure b/libcharset/configure 20 | index 1064c38..c96e5f4 100755 21 | --- a/libcharset/configure 22 | +++ b/libcharset/configure 23 | @@ -5954,9 +5954,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 24 | x86_64-*linux*) 25 | LD="${LD-ld} -m elf_x86_64" 26 | ;; 27 | - ppc*-*linux*|powerpc*-*linux*) 28 | + ppc64-*linux*|powerpc64-*linux*) 29 | LD="${LD-ld} -m elf64ppc" 30 | ;; 31 | + ppc64le-*linux*|powerpc64le-*linux*) 32 | + LD="${LD-ld} -m elf64lppc" 33 | + ;; 34 | s390*-*linux*|s390*-*tpf*) 35 | LD="${LD-ld} -m elf64_s390" 36 | ;; 37 | diff --git a/libcharset/m4/libtool.m4 b/libcharset/m4/libtool.m4 38 | index dde344a..511a421 100644 39 | --- a/libcharset/m4/libtool.m4 40 | +++ b/libcharset/m4/libtool.m4 41 | @@ -1301,9 +1301,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 42 | x86_64-*linux*) 43 | LD="${LD-ld} -m elf_x86_64" 44 | ;; 45 | - ppc*-*linux*|powerpc*-*linux*) 46 | + ppc64-*linux*|powerpc64-*linux*) 47 | LD="${LD-ld} -m elf64ppc" 48 | ;; 49 | + ppc64le-*linux*|powerpc64le-*linux*) 50 | + LD="${LD-ld} -m elf64lppc" 51 | + ;; 52 | s390*-*linux*|s390*-*tpf*) 53 | LD="${LD-ld} -m elf64_s390" 54 | ;; 55 | diff --git a/m4/libtool.m4 b/m4/libtool.m4 56 | index dde344a..511a421 100644 57 | --- a/m4/libtool.m4 58 | +++ b/m4/libtool.m4 59 | @@ -1301,9 +1301,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 60 | x86_64-*linux*) 61 | LD="${LD-ld} -m elf_x86_64" 62 | ;; 63 | - ppc*-*linux*|powerpc*-*linux*) 64 | + ppc64-*linux*|powerpc64-*linux*) 65 | LD="${LD-ld} -m elf64ppc" 66 | ;; 67 | + ppc64le-*linux*|powerpc64le-*linux*) 68 | + LD="${LD-ld} -m elf64lppc" 69 | + ;; 70 | s390*-*linux*|s390*-*tpf*) 71 | LD="${LD-ld} -m elf64_s390" 72 | ;; 73 | diff --git a/preload/configure b/preload/configure 74 | index 4f4f01e..9fc293d 100755 75 | --- a/preload/configure 76 | +++ b/preload/configure 77 | @@ -5966,9 +5966,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 78 | x86_64-*linux*) 79 | LD="${LD-ld} -m elf_x86_64" 80 | ;; 81 | - ppc*-*linux*|powerpc*-*linux*) 82 | + ppc64-*linux*|powerpc64-*linux*) 83 | LD="${LD-ld} -m elf64ppc" 84 | ;; 85 | + ppc64le-*linux*|powerpc64le-*linux*) 86 | + LD="${LD-ld} -m elf64lppc" 87 | + ;; 88 | s390*-*linux*|s390*-*tpf*) 89 | LD="${LD-ld} -m elf64_s390" 90 | ;; 91 | -------------------------------------------------------------------------------- /config/patches/libxslt/libxslt-cve-2015-7995.patch: -------------------------------------------------------------------------------- 1 | --- a/libxslt/preproc.c 2 | +++ b/libxslt/preproc.c 3 | @@ -2249,7 +2249,8 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) { 4 | } else if (IS_XSLT_NAME(inst, "attribute")) { 5 | xmlNodePtr parent = inst->parent; 6 | 7 | - if ((parent == NULL) || (parent->ns == NULL) || 8 | + if ((parent == NULL) || 9 | + (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) || 10 | ((parent->ns != inst->ns) && 11 | (!xmlStrEqual(parent->ns->href, inst->ns->href))) || 12 | (!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) { 13 | -------------------------------------------------------------------------------- /config/patches/libxslt/libxslt-mingw32.patch: -------------------------------------------------------------------------------- 1 | --- a/libxslt/libxslt.h 2 | +++ b/libxslt/libxslt.h 3 | @@ -27,4 +27,10 @@ 4 | #endif 5 | #endif 6 | 7 | +#if defined(_MSC_VER) || defined(__MINGW32__) 8 | +#include 9 | +#include 10 | +#define mkdir(p,m) _mkdir(p) 11 | +#endif 12 | + 13 | #endif /* ! __XSLT_LIBXSLT_H__ */ 14 | --- a/libxslt/win32config.h 15 | +++ b/libxslt/win32config.h 16 | @@ -78,7 +78,6 @@ static int isnan (double d) { 17 | 18 | #include 19 | #if defined(_MSC_VER) || defined(__MINGW32__) 20 | -#define mkdir(p,m) _mkdir(p) 21 | #define snprintf _snprintf 22 | #if _MSC_VER < 1500 23 | #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) 24 | -------------------------------------------------------------------------------- /config/patches/libxslt/libxslt-solaris-configure.patch: -------------------------------------------------------------------------------- 1 | --- libxslt-1.1.28/configure.in 2016-01-19 13:45:52.000000000 -0800 2 | +++ libxslt-1.1.28/configure 2016-01-19 13:46:11.000000000 -0800 3 | @@ -12849,11 +12849,11 @@ 4 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to pass version script to the linker ($LD)" >&5 5 | $as_echo_n "checking how to pass version script to the linker ($LD)... " >&6; } 6 | VERSION_SCRIPT_FLAGS=none 7 | -if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then 8 | - VERSION_SCRIPT_FLAGS=-Wl,--version-script= 9 | -elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then 10 | - VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," 11 | -fi 12 | +#if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then 13 | +# VERSION_SCRIPT_FLAGS=-Wl,--version-script= 14 | +#elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then 15 | +# VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," 16 | +#fi 17 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_SCRIPT_FLAGS" >&5 18 | $as_echo "$VERSION_SCRIPT_FLAGS" >&6; } 19 | 20 | -------------------------------------------------------------------------------- /config/patches/libxslt/libxslt-windows-relocate-1.1.30.patch: -------------------------------------------------------------------------------- 1 | --- libxslt-1.1.30/libxslt/Makefile.in.orig 2017-10-25 14:23:01.000000000 +0100 2 | +++ libxslt-1.1.30/libxslt/Makefile.in 2017-10-25 14:29:06.000000000 +0100 3 | @@ -457,7 +457,8 @@ 4 | libxslt_la_LDFLAGS = \ 5 | $(WIN32_EXTRA_LDFLAGS) \ 6 | $(LIBXSLT_VERSION_SCRIPT) \ 7 | - -version-info $(LIBXSLT_VERSION_INFO) 8 | + -version-info $(LIBXSLT_VERSION_INFO) \ 9 | + -Wl,--image-base,0x6d780000 10 | 11 | man_MANS = libxslt.3 12 | EXTRA_DIST = $(man_MANS) trio.h triodef.h libxslt.syms 13 | -------------------------------------------------------------------------------- /config/patches/libxslt/libxslt-windows-relocate.patch: -------------------------------------------------------------------------------- 1 | --- libxslt-1.1.30/libxslt/Makefile.in.orig 2017-10-25 14:23:01.000000000 +0100 2 | +++ libxslt-1.1.30/libxslt/Makefile.in 2017-10-25 14:29:06.000000000 +0100 3 | @@ -457,7 +457,8 @@ 4 | libxslt_la_LDFLAGS = \ 5 | $(WIN32_EXTRA_LDFLAGS) \ 6 | $(LIBXSLT_VERSION_SCRIPT) \ 7 | - -version-info $(LIBXSLT_VERSION_INFO) 8 | + -version-info $(LIBXSLT_VERSION_INFO) \ 9 | + -Wl,--image-base,0x6d780000 10 | 11 | man_MANS = libxslt.3 12 | EXTRA_DIST = $(man_MANS) trio.h triodef.h libxslt.syms 13 | -------------------------------------------------------------------------------- /config/patches/libyaml/v0.1.6.windows-configure.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/yaml.h b/include/yaml.h 2 | index 5a04d36..70d839e 100644 3 | --- a/include/yaml.h 4 | +++ b/include/yaml.h 5 | @@ -29,7 +29,7 @@ extern "C" { 6 | #ifdef _WIN32 7 | # if defined(YAML_DECLARE_STATIC) 8 | # define YAML_DECLARE(type) type 9 | -# elif defined(YAML_DECLARE_EXPORT) 10 | +# elif defined(YAML_DECLARE_EXPORT) || defined(DLL_EXPORT) 11 | # define YAML_DECLARE(type) __declspec(dllexport) type 12 | # else 13 | # define YAML_DECLARE(type) __declspec(dllimport) type 14 | diff --git a/src/Makefile b/src/Makefile 15 | index b72224d..a413ce0 100644 16 | --- a/src/Makefile 17 | +++ b/src/Makefile 18 | @@ -219,7 +219,7 @@ top_srcdir = .. 19 | AM_CPPFLAGS = -I$(top_srcdir)/include 20 | lib_LTLIBRARIES = libyaml.la 21 | libyaml_la_SOURCES = yaml_private.h api.c reader.c scanner.c parser.c loader.c writer.c emitter.c dumper.c 22 | -libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) 23 | +libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) -no-undefined 24 | all: all-am 25 | 26 | .SUFFIXES: 27 | -------------------------------------------------------------------------------- /config/patches/ncurses/ncurses-5.9-gcc-5.patch: -------------------------------------------------------------------------------- 1 | https://bugs.gentoo.org/545114 2 | 3 | extracted from the upstream change (which had many unrelated commits in one) 4 | 5 | From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001 6 | From: "Thomas E. Dickey" 7 | Date: Sun, 7 Dec 2014 03:10:09 +0000 8 | Subject: [PATCH] ncurses 5.9 - patch 20141206 9 | 10 | + modify MKlib_gen.sh to work around change in development version of 11 | gcc introduced here: 12 | https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html 13 | https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html 14 | (reports by Marcus Shawcroft, Maohui Lei). 15 | 16 | diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh 17 | index d8cc3c9..b91398c 100755 18 | --- a/ncurses/base/MKlib_gen.sh 19 | +++ b/ncurses/base/MKlib_gen.sh 20 | @@ -474,11 +474,22 @@ sed -n -f $ED1 \ 21 | -e 's/gen_$//' \ 22 | -e 's/ / /g' >>$TMP 23 | 24 | +cat >$ED1 < $ED2 36 | +cat $ED2 >$TMP 37 | + 38 | $preprocessor $TMP 2>/dev/null \ 39 | -| sed \ 40 | - -e 's/ / /g' \ 41 | - -e 's/^ //' \ 42 | - -e 's/_Bool/NCURSES_BOOL/g' \ 43 | +| sed -f $ED1 \ 44 | | $AWK -f $AW2 \ 45 | | sed -f $ED3 \ 46 | | sed \ 47 | -------------------------------------------------------------------------------- /config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch: -------------------------------------------------------------------------------- 1 | --- configure.after.pkgin.patches 2012-12-17 01:06:16.964187316 +0000 2 | +++ configure 2012-12-17 01:07:17.046932230 +0000 3 | @@ -7864,7 +7864,7 @@ 4 | else 5 | echo "$as_me: failed program was:" >&5 6 | cat conftest.$ac_ext >&5 7 | -cf_result=yes 8 | +cf_result=no 9 | fi 10 | rm -f conftest.$ac_objext conftest.$ac_ext 11 | echo "$as_me:7863: result: $cf_result" >&5 12 | -------------------------------------------------------------------------------- /config/patches/ncurses/ncurses-clang.patch: -------------------------------------------------------------------------------- 1 | diff -ruNp ncurses-5.9.orig/c++/cursesf.h ncurses-5.9/c++/cursesf.h 2 | --- ncurses-5.9.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 3 | +++ ncurses-5.9/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 4 | @@ -681,7 +681,7 @@ public: 5 | const T* p_UserData = STATIC_CAST(T*)(0), 6 | bool with_frame=FALSE, 7 | bool autoDelete_Fields=FALSE) 8 | - : NCursesForm (Fields, with_frame, autoDelete_Fields) { 9 | + : NCursesForm (&Fields, with_frame, autoDelete_Fields) { 10 | if (form) 11 | set_user (const_cast(p_UserData)); 12 | }; 13 | @@ -694,7 +694,7 @@ public: 14 | const T* p_UserData = STATIC_CAST(T*)(0), 15 | bool with_frame=FALSE, 16 | bool autoDelete_Fields=FALSE) 17 | - : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, 18 | + : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, 19 | with_frame, autoDelete_Fields) { 20 | if (form) 21 | set_user (const_cast(p_UserData)); 22 | diff -ruNp ncurses-5.9.orig/c++/cursesm.h ncurses-5.9/c++/cursesm.h 23 | --- ncurses-5.9.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 24 | +++ ncurses-5.9/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 25 | @@ -639,7 +639,7 @@ public: 26 | const T* p_UserData = STATIC_CAST(T*)(0), 27 | bool with_frame=FALSE, 28 | bool autoDelete_Items=FALSE) 29 | - : NCursesMenu (Items, with_frame, autoDelete_Items) { 30 | + : NCursesMenu (&Items, with_frame, autoDelete_Items) { 31 | if (menu) 32 | set_user (const_cast(p_UserData)); 33 | }; 34 | @@ -651,7 +651,7 @@ public: 35 | int begin_x = 0, 36 | const T* p_UserData = STATIC_CAST(T*)(0), 37 | bool with_frame=FALSE) 38 | - : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { 39 | + : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { 40 | if (menu) 41 | set_user (const_cast(p_UserData)); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /config/patches/ncurses/patch-aa: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-aa,v 1.16 2011/02/28 11:02:46 adam Exp $ 2 | 3 | --- misc/run_tic.in.orig 2006-10-28 21:43:30.000000000 +0200 4 | +++ misc/run_tic.in 5 | @@ -122,7 +122,7 @@ TICDIR=`echo $TERMINFO | sed -e 's%/shar 6 | # would generate a lot of confusing error messages if we tried to overwrite it. 7 | # We explicitly remove its contents rather than the directory itself, in case 8 | # the directory is actually a symbolic link. 9 | -( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null ) 10 | +#( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null ) 11 | 12 | if test "$ext_funcs" = 1 ; then 13 | cat <&6 33 | 34 | ### Construct the list of include-directories to be generated 35 | 36 | -CPPFLAGS="$CPPFLAGS -I. -I../include" 37 | +CPPFLAGS="-I. -I../include $CPPFLAGS" 38 | if test "$srcdir" != "."; then 39 | CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" 40 | fi 41 | -------------------------------------------------------------------------------- /config/patches/ncurses/patch-ad: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-ad,v 1.11 2011/02/28 11:02:46 adam Exp $ 2 | 3 | --- c++/Makefile.in.orig 2010-11-27 21:45:27.000000000 +0000 4 | +++ c++/Makefile.in 5 | @@ -167,7 +167,7 @@ LIB_OBJS = \ 6 | 7 | ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) 8 | cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \ 9 | - -o $(LIBNAME) $(LIB_OBJS:$o=.lo) \ 10 | + -o $(LIBNAME) $(LIB_OBJS:.o=.lo) \ 11 | -rpath $(INSTALL_PREFIX)$(libdir) \ 12 | $(LIBTOOL_VERSION) $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST) 13 | 14 | -------------------------------------------------------------------------------- /config/patches/ncurses/patch-cxx_cursesf.h: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-cxx_cursesf.h,v 1.1 2011/02/28 11:02:46 adam Exp $ 2 | 3 | --- c++/cursesf.h.orig 2011-02-28 09:23:33.000000000 +0000 4 | +++ c++/cursesf.h 5 | @@ -677,7 +677,7 @@ protected: 6 | } 7 | 8 | public: 9 | - NCursesUserForm (NCursesFormField Fields[], 10 | + NCursesUserForm (NCursesFormField *Fields[], 11 | const T* p_UserData = STATIC_CAST(T*)(0), 12 | bool with_frame=FALSE, 13 | bool autoDelete_Fields=FALSE) 14 | @@ -686,7 +686,7 @@ public: 15 | set_user (const_cast(p_UserData)); 16 | }; 17 | 18 | - NCursesUserForm (NCursesFormField Fields[], 19 | + NCursesUserForm (NCursesFormField *Fields[], 20 | int nlines, 21 | int ncols, 22 | int begin_y = 0, 23 | -------------------------------------------------------------------------------- /config/patches/ncurses/patch-cxx_cursesm.h: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-cxx_cursesm.h,v 1.1 2011/02/28 11:02:46 adam Exp $ 2 | 3 | --- c++/cursesm.h.orig 2011-02-28 09:25:22.000000000 +0000 4 | +++ c++/cursesm.h 5 | @@ -635,7 +635,7 @@ protected: 6 | } 7 | 8 | public: 9 | - NCursesUserMenu (NCursesMenuItem Items[], 10 | + NCursesUserMenu (NCursesMenuItem *Items[], 11 | const T* p_UserData = STATIC_CAST(T*)(0), 12 | bool with_frame=FALSE, 13 | bool autoDelete_Items=FALSE) 14 | @@ -644,7 +644,7 @@ public: 15 | set_user (const_cast(p_UserData)); 16 | }; 17 | 18 | - NCursesUserMenu (NCursesMenuItem Items[], 19 | + NCursesUserMenu (NCursesMenuItem *Items[], 20 | int nlines, 21 | int ncols, 22 | int begin_y = 0, 23 | -------------------------------------------------------------------------------- /config/patches/ncurses/patch-ncurses_tinfo_lib__baudrate.c: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-ncurses_tinfo_lib__baudrate.c,v 1.1 2014/05/11 16:55:17 rodent Exp $ 2 | 3 | sys/ttydev.h doesn't exist in OpenBSD 5.5 4 | 5 | --- ncurses/tinfo/lib_baudrate.c.orig Sun Dec 19 01:50:50 2010 6 | +++ ncurses/tinfo/lib_baudrate.c 7 | @@ -39,7 +39,7 @@ 8 | 9 | #include 10 | #include /* ospeed */ 11 | -#if defined(__FreeBSD__) 12 | +#if defined(__FreeBSD__) || defined(__OpenBSD__) 13 | #include 14 | #endif 15 | 16 | @@ -49,7 +49,7 @@ 17 | * of the indices up to B115200 fit nicely in a 'short', allowing us to retain 18 | * ospeed's type for compatibility. 19 | */ 20 | -#if (defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__) 21 | +#if (defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || (defined(__OpenBSD__) && (OpenBSD < 201405)) 22 | #undef B0 23 | #undef B50 24 | #undef B75 25 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch: -------------------------------------------------------------------------------- 1 | --- openssl-1.0.1f/Makefile.org.orig 2014-01-08 10:58:40.000000000 -0800 2 | +++ openssl-1.0.1f/Makefile.org 2014-01-08 11:06:29.000000000 -0800 3 | @@ -167,7 +167,7 @@ 4 | 5 | TOP= . 6 | ONEDIRS=out tmp 7 | -EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS 8 | +EDIRS= times bugs util include certs ms shlib mt demos perl sf dep VMS 9 | WDIRS= windows 10 | LIBS= libcrypto.a libssl.a 11 | SHARED_CRYPTO=libcrypto$(SHLIB_EXT) 12 | @@ -538,7 +538,7 @@ 13 | dist_pem_h: 14 | (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) 15 | 16 | -install: all install_docs install_sw 17 | +install: all install_sw 18 | 19 | install_sw: 20 | @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ 21 | @@ -603,7 +603,6 @@ 22 | echo 'OpenSSL shared libraries have been installed in:'; \ 23 | echo ' $(INSTALLTOP)'; \ 24 | echo ''; \ 25 | - sed -e '1,/^$$/d' doc/openssl-shared.txt; \ 26 | fi; \ 27 | fi 28 | cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig 29 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.0.1j-windows-relocate-dll.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile.shared b/Makefile.shared 2 | index e8d222a..02ec85b 100644 3 | --- a/Makefile.shared 4 | +++ b/Makefile.shared 5 | @@ -283,13 +283,12 @@ link_a.cygwin: 6 | base=-Wl,--enable-auto-image-base; \ 7 | if expr $(PLATFORM) : 'mingw' > /dev/null; then \ 8 | case $(LIBNAME) in \ 9 | - crypto) SHLIB=libeay;; \ 10 | - ssl) SHLIB=ssleay;; \ 11 | + crypto) SHLIB=libeay; base=-Wl,--image-base,0x64000000;; \ 12 | + ssl) SHLIB=ssleay; base=-Wl,--image-base,0x65000000;; \ 13 | esac; \ 14 | SHLIB_SOVER=32; \ 15 | extras="$(LIBNAME).def"; \ 16 | $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ 17 | - base=; [ $(LIBNAME) = "crypto" -a -n "$(FIPSCANLIB)" ] && base=-Wl,--image-base,0x63000000; \ 18 | fi; \ 19 | dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ 20 | $(PERL) util/mkrc.pl $$dll_name | \ 21 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch: -------------------------------------------------------------------------------- 1 | --- openssl-1.0.1q/Configure.orig 2015-12-15 17:47:52.000000000 -0500 2 | +++ openssl-1.0.1q/Configure 2015-12-15 18:31:01.000000000 -0500 3 | @@ -537,7 +537,7 @@ 4 | "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", 5 | 6 | # MinGW 7 | -"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a", 8 | +"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", 9 | # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll 10 | # compiled with one compiler with application compiled with another 11 | # compiler. It's possible to engage Applink support in mingw64 build, 12 | @@ -545,7 +545,7 @@ 13 | # handling, one can't seriously consider its binaries for using with 14 | # non-mingw64 run-time environment. And as mingw64 is always consistent 15 | # with itself, Applink is never engaged and can as well be omitted. 16 | -"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", 17 | +"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", 18 | 19 | # UWIN 20 | "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", 21 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.0.2k-no-bang.patch: -------------------------------------------------------------------------------- 1 | --- a/util/domd 2 | +++ b/util/domd 3 | @@ -34,11 +34,11 @@ else 4 | ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new 5 | RC=$? 6 | fi 7 | -if ! cmp -s Makefile.save Makefile.new; then 8 | - mv Makefile.new Makefile 9 | -else 10 | +if cmp -s Makefile.save Makefile.new; then 11 | mv Makefile.save Makefile 12 | rm -f Makefile.new 13 | +else 14 | + mv Makefile.new Makefile 15 | fi 16 | # unfake the presence of Kerberos 17 | rm $TOP/krb5.h 18 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.0.2x-darwin-arm64.patch: -------------------------------------------------------------------------------- 1 | diff -ur openssl-1.0.2x/Configure openssl-1.0.2x.new/Configure 2 | --- openssl-1.0.2x/Configure 2020-12-08 13:23:12.000000000 +0000 3 | +++ openssl-1.0.2x.new/Configure 2021-01-12 08:24:27.000000000 +0000 4 | @@ -156,6 +156,7 @@ 5 | 6 | my $x86_elf_asm="$x86_asm:elf"; 7 | 8 | +my $arm64_asm="arm64cpuid.o:arm64-gcc.o arm64-mont.o arm64-mont5.o arm64-gf2m.o modexp512-arm64.o::aes-arm64.o vpaes-arm64.o bsaes-arm64.o aesni-arm64.o aesni-sha1-arm64.o::md5-arm64.o:sha1-arm64.o sha256-arm64.o sha512-arm64.o::rc4-arm64.o rc4-md5-arm64.o:::wp-arm64.o:cmll-arm64.o cmll_misc.o:ghash-arm64.o:"; 9 | my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o:ecp_nistz256.o ecp_nistz256-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o aesni-gcm-x86_64.o:"; 10 | my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; 11 | my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o::des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o::::::camellia.o cmll_misc.o cmll_cbc.o cmllt4-sparcv9.o:ghash-sparcv9.o::void"; 12 | @@ -649,6 +650,7 @@ 13 | "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 14 | "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 15 | "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 16 | +"darwin64-arm64-cc","cc:-arch arm64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$arm64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 17 | "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 18 | "debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 19 | "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 20 | diff -ur openssl-1.0.2x/config openssl-1.0.2x.new/config 21 | --- openssl-1.0.2x/config 2020-12-08 13:23:12.000000000 +0000 22 | +++ openssl-1.0.2x.new/config 2021-01-12 08:39:17.000000000 +0000 23 | @@ -274,6 +274,9 @@ 24 | 25 | Darwin:*) 26 | case "$MACHINE" in 27 | + arm*) 28 | + echo "arm-apple-darwin${VERSION}" 29 | + ;; 30 | Power*) 31 | echo "ppc-apple-darwin${VERSION}" 32 | ;; 33 | @@ -560,6 +563,21 @@ 34 | else 35 | OUT="darwin-ppc-cc" 36 | fi ;; 37 | + arm-apple-darwin*) 38 | + ISA64=`(sysctl -n hw.optional.arm64) 2>/dev/null` 39 | + if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then 40 | + echo "WARNING! If you wish to build M1 ARM 64-bit library, then you have to" 41 | + echo " invoke './Configure darwin64-arm64-cc' *manually*." 42 | + if [ "$TEST" = "false" -a -t 1 ]; then 43 | + echo " You have about 5 seconds to press Ctrl-C to abort." 44 | + (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 45 | + fi 46 | + fi 47 | + if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then 48 | + OUT="darwin64-arm64-cc" 49 | + else 50 | + OUT="darwin-arm64-cc" 51 | + fi ;; 52 | i?86-apple-darwin*) 53 | ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` 54 | if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then 55 | -------------------------------------------------------------------------------- /config/patches/openssl/openssl-1.1.0f-do-not-install-docs.patch: -------------------------------------------------------------------------------- 1 | --- openssl-1.1.0f/Configurations/unix-Makefile.tmpl.orig 2017-10-22 13:23:48.592533617 +0300 2 | +++ openssl-1.1.0f/Configurations/unix-Makefile.tmpl 2017-10-22 13:26:21.199065333 +0300 3 | @@ -260,7 +260,7 @@ 4 | @echo "Tests are not supported with your chosen Configure options" 5 | @ : {- output_on() if !$disabled{tests}; "" -} 6 | 7 | -install: install_sw install_ssldirs install_docs 8 | +install: install_sw install_ssldirs 9 | 10 | uninstall: uninstall_docs uninstall_sw 11 | 12 | -------------------------------------------------------------------------------- /config/patches/pkg-config/openbsd-charset.patch: -------------------------------------------------------------------------------- 1 | --- pkg-config-0.28.orig/glib/glib/libcharset/config.charset Wed May 13 18:21:29 2015 2 | +++ pkg-config-0.28/glib/glib/libcharset/config.charset Wed May 13 18:21:54 2015 3 | @@ -398,6 +398,16 @@ 4 | echo "BIG5 BIG5" 5 | echo "SJIS SHIFT_JIS" 6 | ;; 7 | + openbsd*) 8 | + echo "646 ASCII" 9 | + echo "ISO8859-1 ISO-8859-1" 10 | + echo "ISO8859-2 ISO-8859-2" 11 | + echo "ISO8859-4 ISO-8859-4" 12 | + echo "ISO8859-5 ISO-8859-5" 13 | + echo "ISO8859-7 ISO-8859-7" 14 | + echo "ISO8859-13 ISO-8859-13" 15 | + echo "ISO8859-15 ISO-8859-15" 16 | + ;; 17 | darwin[56]*) 18 | # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore 19 | # localcharset.c falls back to using the full locale name 20 | -------------------------------------------------------------------------------- /config/patches/ruby/patch-configure: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-configure,v 1.4 2012/10/12 14:51:31 taca Exp $ 2 | 3 | * Adding Interix and MirBSD support. 4 | * Ignore doxygen. 5 | 6 | --- configure.orig 2012-10-12 09:23:46.000000000 +0000 7 | +++ configure 8 | @@ -10654,6 +10654,9 @@ esac 9 | superux*) : 10 | ac_cv_func_setitimer=no 11 | ;; #( 12 | + interix*) LIBS="-lm $LIBS" 13 | + ac_cv_func_getpgrp_void=yes 14 | + ;; #( 15 | *) : 16 | LIBS="-lm $LIBS" ;; 17 | esac 18 | @@ -11980,6 +11983,9 @@ fi 19 | ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "#ifdef HAVE_TIME_H 20 | #include 21 | #endif 22 | +#ifdef HAVE_SYS_TIME_H 23 | +# include 24 | +#endif 25 | " 26 | if test "x$ac_cv_type_struct_timespec" = xyes; then : 27 | 28 | @@ -15790,7 +15796,7 @@ done 29 | MAINLIBS="-pthread $MAINLIBS" ;; #( 30 | *) : 31 | case "$target_os" in #( 32 | - openbsd*) : 33 | + openbsd*|mirbsd*) : 34 | LIBS="-pthread $LIBS" ;; #( 35 | *) : 36 | LIBS="-l$pthread_lib $LIBS" ;; 37 | @@ -16239,8 +16245,12 @@ esac ;; #( 38 | rb_cv_dlopen=yes ;; #( 39 | interix*) : 40 | : ${LDSHARED='$(CC) -shared'} 41 | + LDFLAGS="$LDFLAGS -Wl,-E" 42 | XLDFLAGS="$XLDFLAGS -Wl,-E" 43 | + # use special random-slot linkage in 0x[56]XXXXXXX 44 | LIBPATHFLAG=" -L%1\$-s" 45 | + DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))' 46 | + RPATHFLAG=' -Wl,-R%1$-s' 47 | rb_cv_dlopen=yes ;; #( 48 | freebsd*|dragonfly*) : 49 | 50 | @@ -16252,7 +16262,7 @@ esac ;; #( 51 | test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable" 52 | fi 53 | rb_cv_dlopen=yes ;; #( 54 | - openbsd*) : 55 | + openbsd*|mirbsd*) : 56 | : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'} 57 | if test "$rb_cv_binary_elf" = yes; then 58 | LDFLAGS="$LDFLAGS -Wl,-E" 59 | @@ -16781,7 +16791,7 @@ _ACEOF 60 | freebsd*|dragonfly*) : 61 | 62 | SOLIBS='$(LIBS)' 63 | - LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' 64 | + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)$(TEENY)' 65 | if test "$rb_cv_binary_elf" != "yes" ; then 66 | LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" 67 | LIBRUBY_ALIASES='' 68 | @@ -16798,7 +16808,7 @@ _ACEOF 69 | LIBRUBY_ALIASES="" 70 | fi 71 | ;; #( 72 | - openbsd*) : 73 | + openbsd*|mirbsd*) : 74 | 75 | SOLIBS='$(LIBS)' 76 | LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}` 77 | @@ -16859,7 +16869,12 @@ esac 78 | ;; #( 79 | interix*) : 80 | 81 | - LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)' 82 | + SOLIBS='$(LIBS)' 83 | + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)' 84 | + # link explicitly to 0x48000000 85 | + LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552' 86 | + LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)' 87 | + LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so' 88 | ;; #( 89 | *) : 90 | ;; 91 | @@ -16922,11 +16937,7 @@ if test "$install_doc" != no; then 92 | else 93 | RDOCTARGET="nodoc" 94 | fi 95 | - if test "$install_capi" != no -a -n "$DOXYGEN"; then 96 | - CAPITARGET="capi" 97 | - else 98 | - CAPITARGET="nodoc" 99 | - fi 100 | + CAPITARGET="nodoc" 101 | else 102 | RDOCTARGET="nodoc" 103 | CAPITARGET="nodoc" 104 | -------------------------------------------------------------------------------- /config/patches/ruby/remove_nano.patch: -------------------------------------------------------------------------------- 1 | --- ruby-2.7.2-orig/ext/win32ole/win32ole.c 2020-10-01 05:15:38.000000000 -0700 2 | +++ ruby-2.7.2/ext/win32ole/win32ole.c 2021-03-24 07:59:55.000000000 -0700 3 | @@ -3969,7 +3969,6 @@ 4 | { 5 | cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT; 6 | g_ole_initialized_init(); 7 | - check_nano_server(); 8 | 9 | com_vtbl.QueryInterface = QueryInterface; 10 | com_vtbl.AddRef = AddRef; 11 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-2.6.4-bug14834.patch: -------------------------------------------------------------------------------- 1 | --- a/ext/-test-/bug-14834/bug-14384.c 2 | +++ b/ext/-test-/bug-14834/bug-14384.c 3 | @@ -1,6 +1,10 @@ 4 | #include 5 | #include 6 | 7 | +#ifndef MAYBE_UNUSED 8 | +# define MAYBE_UNUSED(x) x 9 | +#endif 10 | + 11 | static NOINLINE(VALUE f(VALUE)); 12 | static NOINLINE(void g(VALUE, void*)); 13 | extern NOINLINE(void Init_bug_14384(void)); 14 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-2.6.7_c99.patch: -------------------------------------------------------------------------------- 1 | --- ruby-2.6.7-orig/hash.c 2021-04-05 04:48:34.000000000 -0700 2 | +++ ruby-2.6.7/hash.c 2021-04-16 13:50:06.000000000 -0700 3 | @@ -5658,7 +5658,8 @@ 4 | long keylen, elen; 5 | const char *keyptr, *eptr; 6 | RSTRING_GETMEM(key, keyptr, keylen); 7 | - for (long i=0; ibody, rb_fstring_lit(""), 7 | - fname, rb_realpath_internal(Qnil, fname, 1), NULL); 8 | + fname, fname, NULL); 9 | rb_ast_dispose(ast); 10 | } 11 | rb_exec_event_hook_script_compiled(ec, iseq, Qnil); 12 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-faster-load_27.patch: -------------------------------------------------------------------------------- 1 | --- ruby-2.7.0/load.c.orig 2020-02-26 12:19:04.963826602 -0800 2 | +++ ruby-2.7.0/load.c 2020-02-26 12:28:55.865876051 -0800 3 | @@ -578,7 +578,7 @@ 4 | rb_parser_set_context(parser, NULL, FALSE); 5 | ast = (rb_ast_t *)rb_parser_load_file(parser, fname); 6 | iseq = rb_iseq_new_top(&ast->body, rb_fstring_lit(""), 7 | - fname, rb_realpath_internal(Qnil, fname, 1), NULL); 8 | + fname, fname, NULL); 9 | rb_ast_dispose(ast); 10 | } 11 | rb_exec_event_hook_script_compiled(ec, iseq, Qnil); 12 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-mkmf.patch: -------------------------------------------------------------------------------- 1 | --- a/lib/mkmf.rb 2016-06-16 16:19:13.000000000 -0400 2 | +++ b/lib/mkmf.rb 2016-06-16 16:23:08.000000000 -0400 3 | @@ -365,6 +365,17 @@ 4 | end 5 | 6 | def libpath_env 7 | + # Patch for aix 8 | + # Ideally applications should not need LIBPATH/LD_LIBRARY_PATH set 9 | + # and should rely on the embedded paths in binaries/shared objects 10 | + # For chef say on AIX we already build using -blibpath and 11 | + # LD_RUN_PATH, so the extensions built using chef embedded ruby 12 | + # (using rbconfig) should have correct paths set. 13 | + # Setting LIBPATH overrides the behaviour of programs invoked from 14 | + # chef built ruby, for example xlc ends up picking up libiconv built 15 | + # within chef embedded ruby libs instead of the one from /usr/lib 16 | + return {} 17 | + 18 | # used only if native compiling 19 | if libpathenv = config_string("LIBPATHENV") 20 | pathenv = ENV[libpathenv] 21 | @@ -1799,7 +1810,7 @@ 22 | # 23 | if !CROSS_COMPILING 24 | case CONFIG['build_os'] 25 | - when 'mingw32' 26 | + when 'mingw32', 'mingw64' 27 | def mkintpath(path) 28 | # mingw uses make from msys and it needs special care 29 | # converts from C:\some\path to /C/some/path 30 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-no-stack-protector-strong.patch: -------------------------------------------------------------------------------- 1 | --- ruby-2.6.5/configure.old 2019-12-06 13:03:20.962288441 -0800 2 | +++ ruby-2.6.5/configure 2019-12-06 13:03:32.242919275 -0800 3 | @@ -8409,7 +8409,7 @@ 4 | esac 5 | if test -z "${stack_protector+set}"; then : 6 | 7 | - for opt in -fstack-protector-strong -fstack-protector 8 | + for opt in -fstack-protector 9 | do : 10 | 11 | 12 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-no-stack-protector.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure.dist b/configure 2 | index d83c15a..bd4813c 100755 3 | --- a/configure.dist 4 | +++ b/configure 5 | @@ -7491,7 +7491,7 @@ main () 6 | } 7 | _ACEOF 8 | if ac_fn_c_try_compile "$LINENO"; then : 9 | - stack_protector=yes 10 | + stack_protector=no 11 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 12 | $as_echo "yes" >&6; } 13 | else 14 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby-win32_warning_removal.patch: -------------------------------------------------------------------------------- 1 | --- a/ext/win32/lib/Win32API.rb 2 | +++ b/ext/win32/lib/Win32API.rb 3 | @@ -1,9 +1,6 @@ 4 | # -*- ruby -*- 5 | # frozen_string_literal: true 6 | 7 | -# for backward compatibility 8 | -warn "Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead", uplevel: 2 9 | - 10 | require 'fiddle/import' 11 | 12 | class Win32API 13 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby_aix_openssl.patch: -------------------------------------------------------------------------------- 1 | --- ruby-1.9.3-p547/ext/openssl/extconf.rb.orig 2014-07-15 17:50:30 -0500 2 | +++ ruby-1.9.3-p547/ext/openssl/extconf.rb 2014-07-15 17:50:39 -0500 3 | @@ -34,6 +34,7 @@ 4 | end 5 | 6 | Logging::message "=== Checking for system dependent stuff... ===\n" 7 | +have_library("z", "inflate") 8 | have_library("nsl", "t_open") 9 | have_library("socket", "socket") 10 | have_header("assert.h") 11 | -------------------------------------------------------------------------------- /config/patches/ruby/ruby_aix_ssl_EAGAIN.patch: -------------------------------------------------------------------------------- 1 | --- ruby-2.1.3/ext/openssl/lib/openssl/ssl.rb_orig 2014-10-24 13:09:44.000000000 -0500 2 | +++ ruby-2.1.3/ext/openssl/lib/openssl/ssl.rb 2014-10-24 13:11:01.000000000 -0500 3 | @@ -194,7 +194,15 @@ 4 | begin 5 | ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx) 6 | ssl.sync_close = true 7 | - ssl.accept if @start_immediately 8 | + if @start_immediately 9 | + # Retry on EAGAIN (may be due to underlying inprogress for TLS handshake or renegotiation requested.) 10 | + # Any other error is rescued further. 11 | + begin 12 | + ssl.accept 13 | + rescue Errno::EAGAIN 14 | + retry 15 | + end 16 | + end 17 | ssl 18 | rescue SSLError => ex 19 | sock.close 20 | -------------------------------------------------------------------------------- /config/patches/ruby/rvm-cflags.patch: -------------------------------------------------------------------------------- 1 | --- a/configure.in 2 | +++ b/configure.in 3 | @@ -267,11 +267,9 @@ 4 | cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g' 5 | test -z "warnflags" || 6 | cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g' 7 | -if test -z "${CFLAGS+set}"; then 8 | - cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"` 9 | - orig_cflags="$cflags" 10 | - cflags="$cflags "'${optflags} ${debugflags} ${warnflags}' 11 | -fi 12 | +cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"` 13 | +orig_cflags="$cflags" 14 | +cflags="$cflags "'${optflags} ${debugflags} ${warnflags}' 15 | if test -z "${CXXFLAGS+set}"; then 16 | cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"` 17 | orig_cxxflags="$cxxflags" 18 | @@ -511,7 +509,8 @@ 19 | ]) 20 | fi 21 | 22 | -test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\"" 23 | +test -z "${ac_env_CFLAGS_set}" && CFLAGS="$ARCH_FLAG" 24 | +test -n "${cflags:+set}" && eval CFLAGS="\"$cflags\${CFLAGS:+ $CFLAGS}\"" 25 | test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\"" 26 | 27 | dnl check for large file stuff 28 | -------------------------------------------------------------------------------- /config/patches/rubygems/rubygems-3.5.10.patch: -------------------------------------------------------------------------------- 1 | diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb 2 | index 48b7344aee..08728c209c 100644 3 | --- a/lib/rubygems/platform.rb 4 | +++ b/lib/rubygems/platform.rb 5 | @@ -1,7 +1,5 @@ 6 | # frozen_string_literal: true 7 | 8 | -require_relative "deprecate" 9 | - 10 | ## 11 | # Available list of platforms for targeting Gem installations. 12 | # 13 | @@ -24,11 +22,6 @@ def self.match(platform) 14 | match_platforms?(platform, Gem.platforms) 15 | end 16 | 17 | - class << self 18 | - extend Gem::Deprecate 19 | - rubygems_deprecate :match, "Gem::Platform.match_spec? or match_gem?" 20 | - end 21 | - 22 | def self.match_platforms?(platform, platforms) 23 | platform = Gem::Platform.new(platform) unless platform.is_a?(Gem::Platform) 24 | platforms.any? do |local_platform| 25 | -------------------------------------------------------------------------------- /config/patches/zlib/zlib-windows-relocate.patch: -------------------------------------------------------------------------------- 1 | --- zlib-1.2.8/win32/Makefile.gcc.orig 2016-02-11 13:46:54.000000000 -0500 2 | +++ zlib-1.2.8/win32/Makefile.gcc 2016-02-11 13:53:08.000000000 -0500 3 | @@ -57,6 +57,8 @@ 4 | RC = $(PREFIX)windres 5 | RCFLAGS = --define GCC_WINDRES 6 | 7 | +IMAGE_BASE = 0x63300000 8 | + 9 | STRIP = $(PREFIX)strip 10 | 11 | CP = cp -fp 12 | @@ -93,7 +95,7 @@ 13 | $(IMPLIB): $(SHAREDLIB) 14 | 15 | $(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o 16 | - $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \ 17 | + $(CC) -shared -Wl,--out-implib,$(IMPLIB),--image-base,$(IMAGE_BASE) $(LDFLAGS) \ 18 | -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o 19 | $(STRIP) $@ 20 | 21 | -------------------------------------------------------------------------------- /config/projects/metasploit-framework.rb: -------------------------------------------------------------------------------- 1 | name "metasploit-framework" 2 | maintainer "Rapid7 Release Engineering " 3 | homepage "https://rapid7.com" 4 | 5 | install_dir "#{default_root}/metasploit-framework" 6 | 7 | # Version is extracted from the latest Git tag found in the local Git repository 8 | build_version Omnibus::BuildVersion.semver + "-1rapid7" 9 | build_iteration 1 10 | 11 | if windows? 12 | dependency "metasploit-framework-wrappers-windows" 13 | else 14 | dependency "metasploit-framework-wrappers" 15 | end 16 | 17 | exclude "**/.git" 18 | exclude "**/bundler/git" 19 | 20 | if mac_os_x? 21 | require_portable_links true 22 | end 23 | 24 | project_location_dir = name 25 | package :msi do 26 | upgrade_code 'A3C83F57-6D8F-453A-9559-0D650A95EB21' 27 | wix_light_delay_validation true 28 | fast_msi true 29 | parameters ProjectLocationDir: project_location_dir 30 | end 31 | 32 | package :appx do 33 | skip_packager true 34 | end 35 | -------------------------------------------------------------------------------- /config/software/bundler.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2016 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "bundler" 18 | 19 | license "MIT" 20 | license_file "https://raw.githubusercontent.com/bundler/bundler/master/LICENSE.md" 21 | skip_transitive_dependency_licensing true 22 | 23 | dependency "cacerts" 24 | if windows? 25 | dependency "ruby-windows" 26 | dependency "rubygems" 27 | else 28 | dependency "rubygems" 29 | end 30 | 31 | default_version "2.5.10" 32 | 33 | build do 34 | env = with_standard_compiler_flags(with_embedded_path) 35 | env['SSL_CERT_FILE'] = "#{install_dir}/embedded/ssl/cert.pem" 36 | 37 | v_opts = "--version '#{version}'" unless version.nil? 38 | gem [ 39 | "install bundler", 40 | v_opts, 41 | "--force --no-document", 42 | ].compact.join(" "), env: env 43 | end 44 | -------------------------------------------------------------------------------- /config/software/cacerts.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "cacerts" 18 | 19 | license "MPL-2.0" 20 | license_file "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt" 21 | skip_transitive_dependency_licensing true 22 | 23 | default_version "2021-10-26" 24 | 25 | source url: "https://curl.se/ca/cacert-#{version}.pem" 26 | 27 | # versions_list: https://curl.se/docs/caextract.html 28 | version('2021-10-26') { source sha256: "ae31ecb3c6e9ff3154cb7a55f017090448f88482f0e94ac927c0c67a1f33b9cf" } 29 | version("2021-09-30") { source sha256: "f524fc21859b776e18df01a87880efa198112214e13494275dbcbd9bcb71d976" } 30 | version("2021-07-05") { source sha256: "a3b534269c6974631db35f952e8d7c7dbf3d81ab329a232df575c2661de1214a" } 31 | version("2021-05-25") { source sha256: "3a32ad57e7f5556e36ede625b854057ac51f996d59e0952c207040077cbe48a9" } 32 | version("2021-01-19") { source sha256: "e010c0c071a2c79a76aa3c289dc7e4ac4ed38492bfda06d766a80b707ebd2f29" } 33 | 34 | relative_path "cacerts-#{version}" 35 | 36 | build do 37 | mkdir "#{install_dir}/embedded/ssl/certs" 38 | 39 | copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/certs/cacert.pem" 40 | copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/cert.pem" if windows? 41 | 42 | # Windows does not support symlinks 43 | unless windows? 44 | link "certs/cacert.pem", "#{install_dir}/embedded/ssl/cert.pem", unchecked: true 45 | 46 | block { File.chmod(0644, "#{install_dir}/embedded/ssl/certs/cacert.pem") } 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /config/software/config_guess.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "config_guess" 18 | default_version "master" 19 | 20 | # Use our github mirror of the savannah repository 21 | source git: "https://github.com/chef/config-mirror.git" 22 | 23 | # http://savannah.gnu.org/projects/config 24 | license "GPL-3.0 (with exception)" 25 | license_file "config.guess" 26 | license_file "config.sub" 27 | skip_transitive_dependency_licensing true 28 | 29 | relative_path "config_guess-#{version}" 30 | 31 | build do 32 | mkdir "#{install_dir}/embedded/lib/config_guess" 33 | 34 | copy "#{project_dir}/config.guess", "#{install_dir}/embedded/lib/config_guess/config.guess" 35 | copy "#{project_dir}/config.sub", "#{install_dir}/embedded/lib/config_guess/config.sub" 36 | end 37 | -------------------------------------------------------------------------------- /config/software/gdbm.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "gdbm" 18 | default_version "1.8.3" 19 | 20 | dependency "config_guess" 21 | 22 | # Version 1.9 and above are GPLv3, do NOT add later versions in 23 | version("1.8.3") { source sha256: "cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9" } 24 | 25 | source url: "https://ftp.gnu.org/gnu/gdbm/gdbm-#{version}.tar.gz" 26 | 27 | relative_path "gdbm-#{version}" 28 | 29 | build do 30 | env = with_standard_compiler_flags(with_embedded_path) 31 | 32 | if version == "1.8.3" 33 | patch source: "v1.8.3-Makefile.in.patch", plevel: 0, env: env 34 | end 35 | 36 | update_config_guess 37 | 38 | if freebsd? 39 | command "./configure" \ 40 | " --enable-libgdbm-compat" \ 41 | " --with-pic" \ 42 | " --prefix=#{install_dir}/embedded", env: env 43 | else 44 | command "./configure" \ 45 | " --enable-libgdbm-compat" \ 46 | " --prefix=#{install_dir}/embedded", env: env 47 | end 48 | 49 | make "-j #{workers}", env: env 50 | make "install", env: env 51 | end 52 | -------------------------------------------------------------------------------- /config/software/jemalloc.rb: -------------------------------------------------------------------------------- 1 | name "jemalloc" 2 | 3 | default_version "5.3.0" 4 | 5 | license_file "COPYING" 6 | 7 | skip_transitive_dependency_licensing true 8 | 9 | version "5.3.0" do 10 | source sha256: "2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa" 11 | end 12 | 13 | source url: "https://github.com/jemalloc/jemalloc/releases/download/#{version}/jemalloc-#{version}.tar.bz2" 14 | 15 | relative_path "jemalloc-#{version}" 16 | 17 | env = with_standard_compiler_flags(with_embedded_path) 18 | 19 | build do 20 | if rhel? 21 | patch source: "jemalloc-centos-fix.patch", plevel: 1 22 | end 23 | 24 | configure_commands = [ 25 | "--prefix=#{install_dir}/embedded", 26 | "--with-jemalloc-prefix=" 27 | ] 28 | 29 | configure(*configure_commands, env: env) 30 | make "-j #{workers}", env: env 31 | make "-j #{workers} install", env: env 32 | end 33 | -------------------------------------------------------------------------------- /config/software/john.rb: -------------------------------------------------------------------------------- 1 | name "john" 2 | default_version "1.8.0-jumbo-1" 3 | 4 | version("1.8.0-jumbo-1") { source md5: "69f6a26037ad56676116ea2114f35a79" } 5 | 6 | source url: "http://www.openwall.com/john/j/john-1.8.0-jumbo-1.tar.gz" 7 | 8 | relative_path "john-#{version}/src" 9 | 10 | dependency "openssl" 11 | 12 | build do 13 | env = with_standard_compiler_flags(with_embedded_path) 14 | command "./configure --prefix=#{install_dir}/embedded --disable-openmp", env: env 15 | make env: env 16 | make "install", env: env 17 | mkdir "#{install_dir}/embedded/john" 18 | copy "#{project_dir}/../run/*", "#{install_dir}/embedded/john/" 19 | end 20 | -------------------------------------------------------------------------------- /config/software/libedit.rb: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libedit" 18 | default_version "20160903-3.1" 19 | 20 | license "BSD-3-Clause" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "ncurses" 25 | dependency "config_guess" 26 | 27 | version("20160903-3.1") { source sha256: "0ccbd2e7d46097f136fcb1aaa0d5bc24e23bb73f57d25bee5a852a683eaa7567" } 28 | version("20150325-3.1") { source md5: "43cdb5df3061d78b5e9d59109871b4f6" } 29 | version("20150325-3.1") { source md5: "43cdb5df3061d78b5e9d59109871b4f6" } 30 | version("20141030-3.1") { source md5: "5f18e63346d31b877cdf36b5c59b810b" } 31 | version("20130712-3.1") { source md5: "0891336c697362727a1fa7e60c5cb96c" } 32 | version("20120601-3.0") { source md5: "e50f6a7afb4de00c81650f7b1a0f5aea" } 33 | 34 | source url: "http://www.thrysoee.dk/editline/libedit-#{version}.tar.gz" 35 | 36 | if version == "20141030-3.1" 37 | # released tar file has name discrepency in folder name for this version 38 | relative_path "libedit-20141029-3.1" 39 | else 40 | relative_path "libedit-#{version}" 41 | end 42 | 43 | build do 44 | env = with_standard_compiler_flags(with_embedded_path) 45 | 46 | # The patch is from the FreeBSD ports tree and is for GCC compatibility. 47 | # http://svnweb.freebsd.org/ports/head/devel/libedit/files/patch-vi.c?annotate=300896 48 | if version.to_i < 20150325 && (freebsd? || openbsd?) 49 | patch source: "freebsd-vi-fix.patch", env: env 50 | end 51 | 52 | if openbsd? 53 | patch source: "openbsd-weak-alias-fix.patch", plevel: 1, env: env 54 | end 55 | 56 | update_config_guess 57 | 58 | command "./configure" \ 59 | " --prefix=#{install_dir}/embedded", env: env 60 | 61 | make "-j #{workers}", env: env 62 | make "-j #{workers} install", env: env 63 | end 64 | -------------------------------------------------------------------------------- /config/software/libffi.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libffi" 18 | default_version "3.4.2" 19 | 20 | license "MIT" 21 | license_file "LICENSE" 22 | skip_transitive_dependency_licensing true 23 | 24 | # version_list: url=https://github.com/libffi/libffi/releases filter=*.tar.gz 25 | 26 | version("3.4.2") { source sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" } 27 | version("3.3") { source sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" } 28 | 29 | source url: "https://github.com/libffi/libffi/releases/download/v#{version}/libffi-#{version}.tar.gz" 30 | 31 | relative_path "libffi-#{version}" 32 | 33 | build do 34 | env = with_standard_compiler_flags(with_embedded_path) 35 | 36 | env["INSTALL"] = "/opt/freeware/bin/install" if aix? 37 | 38 | # disable option checking as disable-docs is 3.3+ only 39 | configure_command = ["--disable-option-checking", 40 | "--disable-docs", 41 | ] 42 | 43 | if version == "3.3" && mac_os_x? && arm? 44 | patch source: "libffi-3.3-arm64.patch", plevel: 1, env: env 45 | end 46 | 47 | # AIX's old version of patch doesn't like the patch here 48 | unless aix? 49 | # disable multi-os-directory via configure flag (don't use /lib64) 50 | # Works on all platforms, and is compatible on 32bit platforms as well 51 | configure_command << "--disable-multi-os-directory" 52 | 53 | # add the --disable-multi-os-directory flag to 3.2.1 54 | if version == "3.2.1" 55 | patch source: "libffi-3.2.1-disable-multi-os-directory.patch", plevel: 1, env: env 56 | end 57 | end 58 | 59 | configure(*configure_command, env: env) 60 | 61 | make "-j #{workers}", env: env 62 | make "-j #{workers} install", env: env 63 | 64 | # libffi's default install location of header files is awful... 65 | mkdir "#{install_dir}/embedded/include" 66 | copy "#{install_dir}/embedded/lib/libffi-#{version}/include/*", "#{install_dir}/embedded/include/" 67 | 68 | end 69 | -------------------------------------------------------------------------------- /config/software/libiconv.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # CAUTION - although its not used, external libraries such as nokogiri may pick up an optional dep on 18 | # libiconv such that removal of libiconv will break those libraries on upgrade. With an better story around 19 | # external gem handling when chef-client is upgraded libconv could be dropped. 20 | name "libiconv" 21 | default_version "1.15" 22 | 23 | license "LGPL-2.1" 24 | license_file "COPYING.LIB" 25 | skip_transitive_dependency_licensing true 26 | 27 | dependency "config_guess" 28 | 29 | source url: "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{version}.tar.gz", 30 | sha256: "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178" 31 | 32 | relative_path "libiconv-#{version}" 33 | 34 | build do 35 | env = with_standard_compiler_flags(with_embedded_path) 36 | 37 | # freebsd 10 needs to be build PIC 38 | env["CFLAGS"] << " -fPIC" if freebsd? 39 | 40 | update_config_guess(target: "build-aux") 41 | update_config_guess(target: "libcharset/build-aux") 42 | 43 | configure(env: env) 44 | 45 | pmake = "-j #{workers}" 46 | make "#{pmake}", env: env 47 | make "#{pmake} install-lib" \ 48 | " libdir=#{install_dir}/embedded/lib" \ 49 | " includedir=#{install_dir}/embedded/include", env: env 50 | end 51 | -------------------------------------------------------------------------------- /config/software/liblzma.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "liblzma" 18 | default_version "5.2.3" 19 | 20 | license "Public-Domain" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | source url: "http://tukaani.org/xz/xz-#{version}.tar.gz" 25 | 26 | version "5.2.3" do 27 | source sha256: "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb" 28 | end 29 | 30 | relative_path "xz-#{version}" 31 | 32 | build do 33 | env = with_standard_compiler_flags(with_embedded_path) 34 | # liblzma properly uses CFLAGS for C compilation and CPPFLAGS for common 35 | # flags used across tools such as windres. Don't put anything in it 36 | # that can be misinterpreted by windres. 37 | env["CPPFLAGS"] = "-I#{install_dir}/embedded/include" if windows? 38 | 39 | config_command = [ 40 | "--disable-debug", 41 | "--disable-dependency-tracking", 42 | "--disable-doc", 43 | "--disable-scripts", 44 | ] 45 | config_command << "--disable-nls" if windows? 46 | 47 | configure(*config_command, env: env) 48 | 49 | make "install", env: env 50 | end 51 | -------------------------------------------------------------------------------- /config/software/libossp-uuid.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libossp-uuid" 18 | default_version "1.6.2" 19 | 20 | license "MIT" 21 | license_file "README" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "config_guess" 25 | 26 | version "1.6.2" do 27 | source md5: "5db0d43a9022a6ebbbc25337ae28942f" 28 | end 29 | 30 | # ftp on ftp.ossp.org is unavaiable so we must use another mirror site. 31 | source url: "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-#{version}.tar.gz" 32 | 33 | relative_path "uuid-#{version}" 34 | 35 | build do 36 | env = with_standard_compiler_flags(with_embedded_path) 37 | 38 | update_config_guess 39 | 40 | command "./configure" \ 41 | " --prefix=#{install_dir}/embedded", env: env 42 | 43 | make "-j #{workers}", env: env 44 | make "install", env: env 45 | end 46 | -------------------------------------------------------------------------------- /config/software/libpcap.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: Copyright (c) 2012 Opscode, Inc. 3 | # License:: Apache License, Version 2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | name "libpcap" 19 | default_version "1.6.2" 20 | 21 | source :url => "http://www.tcpdump.org/release/libpcap-#{version}.tar.gz", 22 | :md5 => "5f14191c1a684a75532c739c2c4059fa" 23 | 24 | relative_path "libpcap-#{version}" 25 | 26 | build do 27 | env = with_standard_compiler_flags(with_embedded_path) 28 | 29 | command "./configure" \ 30 | " --disable-bluetooth --disable-canusb --disable-can --disable-dbus" \ 31 | " --disable-universal" \ 32 | " --prefix=#{install_dir}/embedded", env: env 33 | 34 | make "-j #{workers}", env: env 35 | make "-j #{workers} install", env: env 36 | end 37 | -------------------------------------------------------------------------------- /config/software/libtool.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libtool" 18 | default_version "2.4" 19 | 20 | license "GPL-2.0" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "config_guess" 25 | 26 | # version_list: url=https://ftp.gnu.org/gnu/libtool/ filter=*.tar.gz 27 | 28 | version("2.4.6") { source sha256: "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" } 29 | version("2.4.2") { source sha256: "b38de44862a987293cd3d8dfae1c409d514b6c4e794ebc93648febf9afc38918" } 30 | version("2.4") { source sha256: "13df57ab63a94e196c5d6e95d64e53262834fe780d5e82c28f177f9f71ddf62e" } 31 | 32 | source url: "https://ftp.gnu.org/gnu/libtool/libtool-#{version}.tar.gz" 33 | 34 | relative_path "libtool-#{version}" 35 | 36 | build do 37 | env = with_standard_compiler_flags(with_embedded_path) 38 | 39 | update_config_guess 40 | update_config_guess(target: "libltdl/config") 41 | 42 | if aix? 43 | env["M4"] = "/opt/freeware/bin/m4" 44 | elsif solaris2? 45 | # We hit this bug on Solaris11 platforms bug#14291: libtool 2.4.2 fails to build due to macro_revision reversion 46 | # The problem occurs with LANG=en_US.UTF-8 but not with LANG=C 47 | env["LANG"] = "C" 48 | end 49 | 50 | command "./configure" \ 51 | " --prefix=#{install_dir}/embedded", env: env 52 | 53 | make env: env 54 | make "install", env: env 55 | end 56 | -------------------------------------------------------------------------------- /config/software/libuuid.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libuuid" 18 | default_version "2.21" 19 | 20 | license "LGPL-2.1" 21 | license_file "COPYING" 22 | 23 | dependency "config_guess" 24 | 25 | source url: "https://www.kernel.org/pub/linux/utils/util-linux/v#{version}/util-linux-#{version}.tar.gz" 26 | 27 | # We use the version in util-linux, and only build the libuuid subdirectory 28 | version "2.27.1" do 29 | source md5: "e9c73747eadf5201b2a198530add4f87", 30 | url: "https://www.kernel.org/pub/linux/utils/util-linux/v2.27/util-linux-2.27.1.tar.gz" 31 | end 32 | version "2.21" do 33 | source md5: "4222aa8c2a1b78889e959a4722f1881a" 34 | end 35 | 36 | relative_path "util-linux-#{version}" 37 | 38 | build do 39 | env = with_standard_compiler_flags(with_embedded_path) 40 | 41 | update_config_guess(target: "config") 42 | 43 | command "./configure --prefix=#{install_dir}/embedded", env: env 44 | 45 | make "-j #{workers}", env: env, cwd: "#{project_dir}/libuuid" 46 | make "-j #{workers} install", env: env, cwd: "#{project_dir}/libuuid" 47 | end 48 | -------------------------------------------------------------------------------- /config/software/libxml2.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: Chef Software Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libxml2" 18 | default_version "2.9.10" # 2.9.12 is not properly building as of 5.20.21 19 | 20 | license "MIT" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "zlib" 25 | dependency "liblzma" 26 | dependency "config_guess" 27 | 28 | # version_list: url=ftp://xmlsoft.org/libxml2/ filter=libxml2-*.tar.gz 29 | version("2.9.12") { source sha256: "c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92" } 30 | version("2.9.10") { source sha256: "aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f" } 31 | version("2.9.9") { source sha256: "94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871" } 32 | 33 | source url: "ftp://xmlsoft.org/libxml2/libxml2-#{version}.tar.gz" 34 | 35 | relative_path "libxml2-#{version}" 36 | 37 | build do 38 | env = with_standard_compiler_flags(with_embedded_path) 39 | 40 | configure_command = [ 41 | "--with-zlib=#{install_dir}/embedded", 42 | "--with-lzma=#{install_dir}/embedded", 43 | "--with-sax1", # required for nokogiri to compile 44 | "--without-iconv", 45 | "--without-python", 46 | "--without-icu", 47 | "--without-debug", 48 | "--without-mem-debug", 49 | "--without-run-debug", 50 | "--without-legacy", # we don't need legacy interfaces 51 | "--without-catalog", 52 | "--without-docbook", 53 | ] 54 | 55 | update_config_guess 56 | 57 | configure(*configure_command, env: env) 58 | 59 | make "-j #{workers}", env: env 60 | make "install", env: env 61 | end 62 | -------------------------------------------------------------------------------- /config/software/libxslt.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libxslt" 18 | default_version "1.1.34" 19 | 20 | license "MIT" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "libxml2" 25 | dependency "liblzma" 26 | dependency "config_guess" 27 | 28 | # versions_list: ftp://xmlsoft.org/libxml2/ filter=*.tar.gz 29 | version("1.1.34") { source sha256: "98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f" } 30 | version("1.1.30") { source sha256: "ba65236116de8326d83378b2bd929879fa185195bc530b9d1aba72107910b6b3" } 31 | 32 | source url: "ftp://xmlsoft.org/libxml2/libxslt-#{version}.tar.gz" 33 | 34 | relative_path "libxslt-#{version}" 35 | 36 | build do 37 | update_config_guess 38 | 39 | env = with_standard_compiler_flags(with_embedded_path) 40 | 41 | patch source: "libxslt-solaris-configure.patch", env: env if solaris2? || omnios? || smartos? 42 | 43 | if windows? 44 | patch source: "libxslt-windows-relocate.patch", env: env 45 | end 46 | 47 | # the libxslt configure script iterates directories specified in 48 | # --with-libxml-prefix looking for the libxml2 config script. That 49 | # iteration treats colons as a delimiter so we are using a cygwin 50 | # style path to accomodate 51 | configure_commands = [ 52 | "--with-libxml-prefix=#{install_dir.sub("C:", "/C")}/embedded", 53 | "--without-python", 54 | "--without-crypto", 55 | "--without-profiler", 56 | "--without-debugger", 57 | ] 58 | 59 | configure(*configure_commands, env: env) 60 | 61 | make "-j #{workers}", env: env 62 | make "install", env: env 63 | end 64 | -------------------------------------------------------------------------------- /config/software/libyaml-windows.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # libyaml 0.1.5 fixes a security vulnerability to 0.1.4. 19 | # Since the rubyinstaller.org doesn't release ruby when a dependency gets 20 | # patched, we are manually patching the dependency until we get a new 21 | # ruby release on windows. 22 | # See: https://github.com/oneclick/rubyinstaller/issues/210 23 | # This component should be removed when libyaml 0.1.5 ships with ruby builds 24 | # of rubyinstaller.org 25 | # 26 | name "libyaml-windows" 27 | default_version "0.1.6" 28 | 29 | dependency "ruby-windows" 30 | 31 | source url: "http://packages.openknapsack.org/libyaml/libyaml-0.1.6-x86-windows.tar.lzma", 32 | md5: "8bb5d8e43cf18ec48b4751bdd0111c84" 33 | 34 | build do 35 | env = with_standard_compiler_flags(with_embedded_path) 36 | 37 | tmpdir = File.join(Omnibus::Config.cache_dir, "libyaml-cache") 38 | 39 | # Ensure the directory exists 40 | mkdir tmpdir 41 | 42 | # First extract the tar file out of lzma archive. 43 | command "7z.exe x #{project_file} -o#{tmpdir} -r -y", env: env 44 | 45 | # Now extract the files out of tar archive. 46 | command "7z.exe x #{File.join(tmpdir, "libyaml-0.1.6-x86-windows.tar")} -o#{tmpdir} -r -y", env: env 47 | 48 | # Now copy over libyaml-0-2.dll to the build dir 49 | copy "#{tmpdir}/bin/libyaml-0-2.dll", "#{install_dir}/embedded/bin/libyaml-0-2.dll" 50 | end 51 | -------------------------------------------------------------------------------- /config/software/libyaml.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2015 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "libyaml" 18 | default_version "0.1.7" 19 | 20 | license "MIT" 21 | license_file "LICENSE" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "config_guess" 25 | 26 | version("0.1.7") { source sha256: "8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729" } 27 | version("0.1.6") { source md5: "5fe00cda18ca5daeb43762b80c38e06e" } 28 | 29 | source url: "http://pyyaml.org/download/libyaml/yaml-#{version}.tar.gz" 30 | 31 | relative_path "yaml-#{version}" 32 | 33 | build do 34 | env = with_standard_compiler_flags(with_embedded_path) 35 | 36 | update_config_guess(target: "config") 37 | 38 | configure "--enable-shared", env: env 39 | 40 | # Windows had worse automake/libtool version issues. 41 | # Just patch the output instead. 42 | if version >= "0.1.6" && windows? 43 | patch source: "v0.1.6.windows-configure.patch", plevel: 1, env: env 44 | end 45 | 46 | make "-j #{workers}", env: env 47 | make "-j #{workers} install", env: env 48 | end 49 | -------------------------------------------------------------------------------- /config/software/makedepend.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "makedepend" 18 | default_version "1.0.5" 19 | 20 | license "MIT" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | source url: "https://www.x.org/releases/individual/util/makedepend-1.0.5.tar.gz", 25 | md5: "efb2d7c7e22840947863efaedc175747" 26 | 27 | relative_path "makedepend-1.0.5" 28 | 29 | dependency "xproto" 30 | dependency "util-macros" 31 | dependency "pkg-config-lite" 32 | 33 | build do 34 | env = with_standard_compiler_flags(with_embedded_path) 35 | 36 | command "./configure --prefix=#{install_dir}/embedded", env: env 37 | 38 | make "-j #{workers}", env: env 39 | make "-j #{workers} install", env: env 40 | end 41 | -------------------------------------------------------------------------------- /config/software/metasploit-framework-wrappers-windows.rb: -------------------------------------------------------------------------------- 1 | name "metasploit-framework-wrappers-windows" 2 | 3 | default_version "1.0.0" 4 | 5 | dependency "metasploit-framework" 6 | 7 | build do 8 | mkdir "#{install_dir}/bin" 9 | 10 | erb source: 'msfdb.bat.erb', 11 | dest: "#{install_dir}/bin/msfdb.bat", 12 | mode: 0755, 13 | vars: { install_dir: install_dir } 14 | 15 | erb source: 'msfremove.ps1.erb', 16 | dest: "#{install_dir}/bin/msfremove.ps1", 17 | mode: 0755, 18 | vars: { install_dir: install_dir } 19 | 20 | erb source: 'msfremove.bat.erb', 21 | dest: "#{install_dir}/bin/msfremove.bat", 22 | mode: 0755, 23 | vars: { install_dir: install_dir } 24 | 25 | erb source: 'msfupdate.ps1.erb', 26 | dest: "#{install_dir}/bin/msfupdate.ps1", 27 | mode: 0755, 28 | vars: { install_dir: install_dir } 29 | 30 | erb source: 'msfupdate.bat.erb', 31 | dest: "#{install_dir}/bin/msfupdate.bat", 32 | mode: 0755, 33 | vars: { install_dir: install_dir } 34 | 35 | metasploit_bins = [ 36 | 'msfbinscan', 37 | 'msfconsole', 38 | 'msfd', 39 | 'msfelfscan', 40 | 'msfmachscan', 41 | 'msfpescan', 42 | 'msfrop', 43 | 'msfrpc', 44 | 'msfrpcd', 45 | 'msfvenom' 46 | ] 47 | 48 | metasploit_bins.each { |bin| 49 | erb source: 'msfwrapper.bat.erb', 50 | dest: "#{install_dir}/bin/#{bin}.bat", 51 | mode: 0755, 52 | vars: { install_dir: install_dir } 53 | } 54 | end 55 | -------------------------------------------------------------------------------- /config/software/metasploit-framework-wrappers.rb: -------------------------------------------------------------------------------- 1 | name "metasploit-framework-wrappers" 2 | 3 | default_version "1.0.0" 4 | 5 | dependency "metasploit-framework" 6 | 7 | build do 8 | mkdir "#{install_dir}/bin" 9 | 10 | erb source: 'msfdb.erb', 11 | dest: "#{install_dir}/bin/msfdb", 12 | mode: 0755, 13 | vars: { install_dir: install_dir } 14 | 15 | erb source: 'msfupdate.erb', 16 | dest: "#{install_dir}/bin/msfupdate", 17 | mode: 0755, 18 | vars: { install_dir: install_dir } 19 | 20 | erb source: 'msfremove.erb', 21 | dest: "#{install_dir}/bin/msfremove", 22 | mode: 0755, 23 | vars: { install_dir: install_dir } 24 | 25 | command "chmod +x #{install_dir}/bin/*" 26 | 27 | metasploit_bins = [ 28 | 'msfbinscan', 29 | 'msfconsole', 30 | 'msfd', 31 | 'msfelfscan', 32 | 'msfmachscan', 33 | 'msfpescan', 34 | 'msfrop', 35 | 'msfrpc', 36 | 'msfrpcd', 37 | 'msfvenom' 38 | ] 39 | 40 | metasploit_bins.each { |bin| 41 | erb source: 'msfwrapper.erb', 42 | dest: "#{install_dir}/bin/#{bin}", 43 | mode: 0755, 44 | vars: { install_dir: install_dir } 45 | } 46 | end 47 | -------------------------------------------------------------------------------- /config/software/ncurses.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2019, Chef Software Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "ncurses" 18 | default_version "6.2" 19 | 20 | license "MIT" 21 | license_file "http://invisible-island.net/ncurses/ncurses-license.html" 22 | license_file "http://invisible-island.net/ncurses/ncurses.faq.html" 23 | skip_transitive_dependency_licensing true 24 | 25 | dependency "config_guess" 26 | 27 | # versions_list: https://ftp.gnu.org/gnu/ncurses/ filter=*.tar.gz 28 | version("6.2") { source sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" } 29 | version("6.1") { source sha256: "aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17" } 30 | version("5.9") { source sha256: "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b" } 31 | 32 | source url: "https://ftp.gnu.org/gnu/ncurses/ncurses-#{version}.tar.gz" 33 | 34 | relative_path "ncurses-#{version}" 35 | 36 | ######################################################################## 37 | # 38 | # wide-character support: 39 | # Ruby 1.9 optimistically builds against libncursesw for UTF-8 40 | # support. In order to prevent Ruby from linking against a 41 | # package-installed version of ncursesw, we build wide-character 42 | # support into ncurses with the "--enable-widec" configure parameter. 43 | # To support other applications and libraries that still try to link 44 | # against libncurses, we also have to create non-wide libraries. 45 | # 46 | # The methods below are adapted from: 47 | # http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html 48 | # 49 | ######################################################################## 50 | 51 | build do 52 | env = with_standard_compiler_flags(with_embedded_path) 53 | env.delete("CPPFLAGS") 54 | 55 | if smartos? 56 | # SmartOS is Illumos Kernel, plus NetBSD userland with a GNU toolchain. 57 | # These patches are taken from NetBSD pkgsrc and provide GCC 4.7.0 58 | # compatibility: 59 | # http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/ncurses/patches/ 60 | patch source: "patch-aa", plevel: 0, env: env 61 | patch source: "patch-ab", plevel: 0, env: env 62 | patch source: "patch-ac", plevel: 0, env: env 63 | patch source: "patch-ad", plevel: 0, env: env 64 | patch source: "patch-cxx_cursesf.h", plevel: 0, env: env 65 | patch source: "patch-cxx_cursesm.h", plevel: 0, env: env 66 | 67 | # Chef patches - 68 | # The configure script from the pristine tarball detects xopen_source_extended incorrectly. 69 | # Manually working around a false positive. 70 | patch source: "ncurses-5.9-solaris-xopen_source_extended-detection.patch", plevel: 0, env: env 71 | end 72 | 73 | update_config_guess 74 | 75 | # AIX's old version of patch doesn't like the patches here 76 | unless aix? 77 | if version == "5.9" 78 | # Patch to add support for GCC 5, doesn't break previous versions 79 | patch source: "ncurses-5.9-gcc-5.patch", plevel: 1, env: env 80 | end 81 | end 82 | 83 | if mac_os_x? || 84 | # Clang became the default compiler in FreeBSD 10+ 85 | (freebsd? && ohai["os_version"].to_i >= 1000024) 86 | # References: 87 | # https://github.com/Homebrew/homebrew-dupes/issues/43 88 | # http://invisible-island.net/ncurses/NEWS.html#t20110409 89 | # 90 | # Patches ncurses for clang compiler. Changes have been accepted into 91 | # upstream, but occurred shortly after the 5.9 release. We should be able 92 | # to remove this after upgrading to any release created after June 2012 93 | patch source: "ncurses-clang.patch", env: env 94 | end 95 | 96 | if openbsd? 97 | patch source: "patch-ncurses_tinfo_lib__baudrate.c", plevel: 0, env: env 98 | end 99 | 100 | configure_command = [ 101 | "./configure", 102 | "--prefix=#{install_dir}/embedded", 103 | "--enable-overwrite", 104 | "--with-shared", 105 | "--with-termlib", 106 | "--without-ada", 107 | "--without-cxx-binding", 108 | "--without-debug", 109 | "--without-manpages", 110 | ] 111 | 112 | if aix? 113 | # AIX kinda needs 5.9-20140621 or later 114 | # because of a naming snafu in shared library naming. 115 | # see http://invisible-island.net/ncurses/NEWS.html#t20140621 116 | 117 | # let libtool deal with library silliness 118 | configure_command << "--with-libtool=\"#{install_dir}/embedded/bin/libtool\"" 119 | 120 | # stick with just the shared libs on AIX 121 | configure_command << "--without-normal" 122 | 123 | # ncurses's ./configure incorrectly 124 | # "figures out" ARFLAGS if you try 125 | # to set them yourself 126 | env.delete("ARFLAGS") 127 | 128 | # use gnu install from the coreutils IBM rpm package 129 | env["INSTALL"] = "/opt/freeware/bin/install" 130 | end 131 | 132 | command configure_command.join(" "), env: env 133 | 134 | # unfortunately, libtool may try to link to libtinfo 135 | # before it has been assembled; so we have to build in serial 136 | make "libs", env: env if aix? 137 | 138 | make "-j #{workers}", env: env 139 | make "-j #{workers} install", env: env 140 | 141 | # Build non-wide-character libraries 142 | make "distclean", env: env 143 | configure_command << "--enable-widec" 144 | 145 | command configure_command.join(" "), env: env 146 | make "libs", env: env if aix? 147 | make "-j #{workers}", env: env 148 | 149 | # Installing the non-wide libraries will also install the non-wide 150 | # binaries, which doesn't happen to be a problem since we don't 151 | # utilize the ncurses binaries in private-chef (or oss chef) 152 | make "-j #{workers} install", env: env 153 | 154 | # Ensure embedded ncurses wins in the LD search path 155 | if smartos? 156 | link "#{install_dir}/embedded/lib/libcurses.so", "#{install_dir}/embedded/lib/libcurses.so.1" 157 | end 158 | end 159 | -------------------------------------------------------------------------------- /config/software/nmap.rb: -------------------------------------------------------------------------------- 1 | name "nmap" 2 | default_version "7.12" 3 | 4 | version("7.12") { source sha256: "63df082a87c95a189865d37304357405160fc6333addcf5b84204c95e0539b04" } 5 | 6 | source url: "https://nmap.org/dist/nmap-7.12.tar.bz2" 7 | 8 | relative_path "nmap-#{version}" 9 | 10 | dependency "openssl" 11 | 12 | build do 13 | env = with_standard_compiler_flags(with_embedded_path) 14 | command "./configure --prefix=#{install_dir}/embedded", env: env 15 | make env: env 16 | make "install", env: env 17 | end 18 | -------------------------------------------------------------------------------- /config/software/nokogiri.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2012-2017, Chef Software Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | name "nokogiri" 17 | 18 | license "MIT" 19 | license_file "https://raw.githubusercontent.com/sparklemotion/nokogiri/master/LICENSE.md" 20 | # We install only nokogiri from rubygems here. 21 | skip_transitive_dependency_licensing true 22 | 23 | dependency "ruby" 24 | 25 | using_prebuilt_ruby = windows? && (project.overrides[:ruby].nil? || project.overrides[:ruby][:version] == "ruby-windows") 26 | unless using_prebuilt_ruby 27 | dependency "libxml2" 28 | dependency "libxslt" 29 | dependency "liblzma" 30 | dependency "zlib" 31 | end 32 | 33 | dependency "rubygems" 34 | 35 | # 36 | # NOTE: As of nokogiri 1.6.4 it will superficially 'work' to remove most 37 | # of the nonsense in this file and simply gem install nokogiri on most 38 | # platforms. This is because nokogiri has improved its packaging so that 39 | # all of the dynamic libraries are 'statically' compiled into nokogiri.so 40 | # with -lz -llzma -lxslt -lxml2, etc. What will happen in that case is 41 | # that the nokogiri build system will pull zlib, lzma, etc out of the 42 | # system and link it inside of nokogiri.so and ship it as one big 43 | # dynamic library. This will essentially defeat one aspect of our 44 | # health_check system so that we will be shipping an embedded zlib inside 45 | # of nokogiri.so that we do not track and will have a high likelihood that 46 | # if there are security errata that we ship exploitable code without 47 | # knowing it. For all other purposes, the built executable will work, 48 | # however, so it is likely that someone will 'discover' that 'everything 49 | # works' and remove all the junk in this file. That will, however, have 50 | # unintended side effects. We do not have a mechanism to inspect the 51 | # nokogiri.so and determine that it is shipping with an embedded zlib that 52 | # does not match the one that we ship in /opt/chef/embedded/lib, so there 53 | # will be nothing that alerts or fails on this. 54 | # 55 | # TL;DR: do not remove --use-system-libraries even if everything appears to 56 | # be green after you do. 57 | # 58 | build do 59 | env = with_standard_compiler_flags(with_embedded_path) 60 | 61 | gem_command = [ "install nokogiri" ] 62 | gem_command << "--version '#{version}'" unless version.nil? 63 | 64 | # windows uses the 'fat' precompiled binaries' 65 | unless using_prebuilt_ruby 66 | # Tell nokogiri to use the system libraries instead of compiling its own 67 | env["NOKOGIRI_USE_SYSTEM_LIBRARIES"] = "true" 68 | 69 | gem_command += [ 70 | "--", 71 | "--use-system-libraries", 72 | "--with-xml2-lib=#{install_dir}/embedded/lib", 73 | "--with-xml2-include=#{install_dir}/embedded/include/libxml2", 74 | "--with-xslt-lib=#{install_dir}/embedded/lib", 75 | "--with-xslt-include=#{install_dir}/embedded/include/libxslt", 76 | "--without-iconv", 77 | "--with-zlib-dir=#{install_dir}/embedded", 78 | ] 79 | end 80 | 81 | gem gem_command.join(" "), env: env 82 | 83 | delete "#{install_dir}/embedded/lib/ruby/gems/2.1.0/gems/mini_portile2-2.0.0/test" 84 | end 85 | -------------------------------------------------------------------------------- /config/software/openssl-windows.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # openssl 1.0.0m fixes a security vulnerability: 19 | # https://www.openssl.org/news/secadv_20140605.txt 20 | # Since the rubyinstaller.org doesn't release ruby when a dependency gets 21 | # patched, we are manually patching the dependency until we get a new 22 | # ruby release on windows. 23 | # This component should be removed when we upgrade to the next version of 24 | # rubyinstaller > 1.9.3-p545 and 2.0.0-p451 25 | # 26 | # openssl 1.0.0n fixes more security vulnerabilities... 27 | # https://www.openssl.org/news/secadv_20140806.txt 28 | 29 | name "openssl-windows" 30 | default_version "1.0.0r" 31 | 32 | dependency "ruby-windows" 33 | 34 | source url: "http://dl.bintray.com/oneclick/OpenKnapsack/x86/openssl-#{version}-x86-windows.tar.lzma" 35 | 36 | version('1.0.0n') { source md5: "9506530353f3b984680ec27b7270874a" } 37 | version('1.0.0q') { source md5: "577dbe528415c6f178a9431fd0554df4" } 38 | version('1.0.0r') { source md5: "25402ddce541aa54eb5e114721926e72" } 39 | 40 | build do 41 | env = with_standard_compiler_flags(with_embedded_path) 42 | 43 | # Make sure the OpenSSL version is suitable for our path: 44 | # OpenSSL version is something like 45 | # OpenSSL 1.0.0k 5 Feb 2013 46 | ruby "-e \"require 'openssl'; puts 'OpenSSL patch version check expecting <= #{version}'; exit(1) if OpenSSL::OPENSSL_VERSION.split(' ')[1] >= '#{version}'\"" 47 | 48 | tmpdir = File.join(Omnibus::Config.cache_dir, "openssl-cache") 49 | 50 | # Ensure the directory exists 51 | mkdir tmpdir 52 | 53 | # First extract the tar file out of lzma archive. 54 | command "7z.exe x #{project_file} -o#{tmpdir} -r -y", env: env 55 | 56 | # Now extract the files out of tar archive. 57 | command "7z.exe x #{File.join(tmpdir, "openssl-#{version}-x86-windows.tar")} -o#{tmpdir} -r -y", env: env 58 | 59 | # Copy over the required dlls into embedded/bin 60 | copy "#{tmpdir}/bin/libeay32.dll", "#{install_dir}/embedded/bin/" 61 | copy "#{tmpdir}/bin/ssleay32.dll", "#{install_dir}/embedded/bin/" 62 | end 63 | -------------------------------------------------------------------------------- /config/software/pcaprub.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "pcaprub" 18 | default_version "0.13.3" 19 | 20 | if windows? 21 | dependency "ruby-windows" 22 | dependency "ruby-windows-devkit" 23 | dependency "winpcap-devpack" 24 | else 25 | dependency "ruby" 26 | dependency "libpcap" 27 | end 28 | 29 | dependency "cacerts" 30 | dependency "rubygems" 31 | 32 | build do 33 | # Skip pcaprub support for now as it causes compilation issues 34 | next if windows? 35 | 36 | env = with_standard_compiler_flags(with_embedded_path) 37 | env['SSL_CERT_FILE'] = "#{install_dir}/embedded/ssl/cert.pem" 38 | # Ignore: 39 | # pcaprub.c: In function 'rbpcap_each_data': 40 | # pcaprub.c:987:17: error: implicit declaration of function 'pcap_getevent'; did you mean 'pcap_geterr'? [-Wimplicit-function-declaration] 41 | # 987 | fno = (HANDLE)pcap_getevent(rbp->pd); 42 | # | ^~~~~~~~~~~~~ 43 | # | pcap_geterr 44 | # pcaprub.c:987:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 45 | # 987 | fno = (HANDLE)pcap_getevent(rbp->pd); 46 | # | ^ 47 | # pcaprub.c: In function 'rbpcap_each_packet': 48 | # pcaprub.c:1029:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 49 | # 1029 | fno = (HANDLE)pcap_getevent(rbp->pd); 50 | cflags = "-Wno-int-to-pointer-cast -Wno-implicit-function-declaration" 51 | 52 | # Use version of pcaprub relative to the current directory if it exists 53 | local_pcaprub_checkout = File.expand_path(File.join(Dir.pwd, "..", "pcaprub")) 54 | command "echo checking for path: #{local_pcaprub_checkout}", env: env 55 | if File.exist?(local_pcaprub_checkout) 56 | gem "install --local #{local_pcaprub_checkout}/pkg/pcaprub-#{version}.gem", env: env 57 | command "echo after new pcaprub code", env: env 58 | else 59 | command "echo before old pcaprub code", env: env 60 | gem "install pcaprub" \ 61 | " --version '#{version}' --no-document -- --with-cflags=\'#{cflags}\'", env: env 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /config/software/pkg-config-lite.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "pkg-config-lite" 18 | default_version "0.28-1" 19 | 20 | license "GPL-2.0" 21 | license_file "COPYING" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "config_guess" 25 | 26 | version "0.28-1" do 27 | source md5: "61f05feb6bab0a6bbfab4b6e3b2f44b6" 28 | end 29 | 30 | source url: "http://downloads.sourceforge.net/project/pkgconfiglite/#{version}/pkg-config-lite-#{version}.tar.gz" 31 | 32 | relative_path "pkg-config-lite-#{version}" 33 | 34 | build do 35 | env = with_standard_compiler_flags(with_embedded_path) 36 | 37 | update_config_guess 38 | 39 | command "./configure" \ 40 | " --prefix=#{install_dir}/embedded" \ 41 | " --disable-host-tool" \ 42 | " --with-pc-path=#{install_dir}/embedded/bin/pkgconfig", env: env 43 | 44 | make "-j #{workers}", env: env 45 | make "-j #{workers} install", env: env 46 | end 47 | -------------------------------------------------------------------------------- /config/software/pkg-config.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "pkg-config" 18 | default_version "0.28" 19 | 20 | dependency "libiconv" 21 | dependency "config_guess" 22 | 23 | version "0.29" do 24 | source md5: "77f27dce7ef88d0634d0d6f90e03a77f" 25 | end 26 | 27 | version "0.28" do 28 | source md5: "aa3c86e67551adc3ac865160e34a2a0d" 29 | end 30 | 31 | source url: "https://pkgconfig.freedesktop.org/releases/pkg-config-#{version}.tar.gz" 32 | 33 | relative_path "pkg-config-#{version}" 34 | 35 | build do 36 | env = with_standard_compiler_flags(with_embedded_path) 37 | 38 | update_config_guess 39 | 40 | # pkg-config (at least up to 0.28) includes an older version of 41 | # libcharset/lib/config.charset that doesn't know about openbsd 42 | if openbsd? 43 | patch source: "openbsd-charset.patch", plevel: 1, env: env 44 | end 45 | 46 | command "./configure" \ 47 | " --prefix=#{install_dir}/embedded" \ 48 | " --disable-debug" \ 49 | " --disable-host-tool" \ 50 | " --with-internal-glib" \ 51 | " --with-pc-path=#{install_dir}/embedded/bin/pkgconfig", env: env 52 | 53 | # #203: pkg-configs internal glib does not provide a way to pass ldflags. 54 | # Only allows GLIB_CFLAGS and GLIB_LIBS. 55 | # These do not serve our purpose, so we must explicitly 56 | # ./configure in the glib dir, with the Omnibus ldflags. 57 | command "./configure" \ 58 | " --prefix=#{install_dir}/embedded" \ 59 | " --with-libiconv=gnu", env: env, cwd: "#{project_dir}/glib" 60 | 61 | make "-j #{workers}", env: env 62 | make "-j #{workers} install", env: env 63 | 64 | # ensure charset.alias gets installed on openbsd else pkg-config will 65 | # exit with byte conversion errors. 66 | if openbsd? 67 | copy "#{project_dir}/glib/glib/libcharset/charset.alias", "#{install_dir}/embedded/lib/charset.alias" 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /config/software/postgresql-prev.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "postgresql-prev" 18 | default_version "9.4.5" 19 | 20 | license "PostgreSQL" 21 | license_file "COPYRIGHT" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "zlib" 25 | dependency "openssl" 26 | dependency "libedit" 27 | dependency "libuuid" unless mac_os_x? 28 | dependency "ncurses" 29 | dependency "config_guess" 30 | 31 | version "9.4.5" do 32 | source sha256: "b87c50c66b6ea42a9712b5f6284794fabad0616e6ae420cf0f10523be6d94a39" 33 | end 34 | 35 | source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2" 36 | 37 | relative_path "postgresql-#{version}" 38 | 39 | build do 40 | env = with_standard_compiler_flags(with_embedded_path) 41 | 42 | update_config_guess(target: "config") 43 | 44 | command "./configure" \ 45 | " --prefix=#{install_dir}/embedded/postgresql-prev" \ 46 | " --with-libedit-preferred" \ 47 | " --with-openssl" \ 48 | " --with-uuid=e2fs" \ 49 | " --with-includes=#{install_dir}/embedded/postgresql-prev/include" \ 50 | " --with-libraries=#{install_dir}/embedded/postgresql-prev/lib", env: env 51 | 52 | make "world -j #{workers}", env: env 53 | make "install-world", env: env 54 | end 55 | -------------------------------------------------------------------------------- /config/software/postgresql-windows-prev.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "postgresql-windows-prev" 18 | default_version "9.4.5" 19 | 20 | version "9.4.5" do 21 | source sha256: "6d2163611b6b159246896898dd1ee23cf29972c9a0449a8aac9c126cfc88a87f" 22 | end 23 | 24 | relative_path "pgsql" 25 | 26 | source url: "http://get.enterprisedb.com/postgresql/postgresql-#{version}-1-windows-binaries.zip" 27 | 28 | build do 29 | 30 | mkdir "#{install_dir}/embedded/postgresql-prev/bin" 31 | copy "#{project_dir}/bin/*", "#{install_dir}/embedded/postgresql-prev/bin" 32 | mkdir "#{install_dir}/embedded/postgresql-prev/lib" 33 | copy "#{project_dir}/lib/*", "#{install_dir}/embedded/postgresql-prev/lib" 34 | mkdir "#{install_dir}/embedded/postgresql-prev/share" 35 | copy "#{project_dir}/share/*", "#{install_dir}/embedded/postgresql-prev/share" 36 | 37 | end 38 | -------------------------------------------------------------------------------- /config/software/postgresql-windows.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "postgresql-windows" 18 | default_version "13.6" 19 | 20 | relative_path "pgsql" 21 | 22 | if windows_arch_i386? 23 | version "9.6.11" do 24 | source sha256: "b687faaefba5b709220b1cc360de7c4f1c5bd7f4231b07364a6eb214a90ca841" 25 | end 26 | 27 | version "9.6.7" do 28 | source sha256: "68870e3f686295cce60b50cea92421fa168274790f97c4eb7bf0879c6cb28cd8" 29 | end 30 | 31 | version "9.6.2" do 32 | source sha256: "a4c1f9c4e4938abee245926bbc950a5d01fc3776187044aec2fb1698120f447a" 33 | end 34 | 35 | version "9.6.1" do 36 | source sha256: "16a5b97579587bf6c6ab98788b0c95e55398e87a75b990089522d4837b2da0f4" 37 | end 38 | 39 | version "9.4.6" do 40 | source sha256: "c14025963bf80fac9331f45b314cc508e255048189378e2674f4aaa6fe34e2a7" 41 | end 42 | 43 | version "9.4.5" do 44 | source sha256: "6d2163611b6b159246896898dd1ee23cf29972c9a0449a8aac9c126cfc88a87f" 45 | end 46 | 47 | source url: "http://get.enterprisedb.com/postgresql/postgresql-#{version}-1-windows-binaries.zip" 48 | else 49 | version "13.6" do 50 | source sha256: "44ba5f480c45afa554bf70688c025a7298a96b5541a1c302e6223988768e83a8" 51 | end 52 | 53 | version "9.6.20" do 54 | source sha256: "a76e41e3101e09a2e772a26f0b93b405a97482b42b0695893465f3533c76d326" 55 | end 56 | 57 | version "9.6.11" do 58 | source sha256: "39df7a8212df8ce86ebae7f728cac7327a5e9ab821e351ac623ce33de6ed2b1a" 59 | end 60 | 61 | version "9.6.7" do 62 | source sha256: "026592acf6f25dfa74ded9c870a4da537e349ca5b328354437e6a48f262ea3fb" 63 | end 64 | 65 | source url: "http://get.enterprisedb.com/postgresql/postgresql-#{version}-1-windows-x64-binaries.zip" 66 | end 67 | 68 | build do 69 | 70 | copy "#{project_dir}/bin/*", "#{install_dir}/embedded/bin" 71 | copy "#{project_dir}/lib/*", "#{install_dir}/embedded/lib" 72 | copy "#{project_dir}/include/*", "#{install_dir}/embedded/include" 73 | copy "#{project_dir}/share/*", "#{install_dir}/embedded/share" 74 | 75 | end 76 | -------------------------------------------------------------------------------- /config/software/postgresql.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "postgresql" 18 | default_version "13.6" 19 | 20 | license "PostgreSQL" 21 | license_file "COPYRIGHT" 22 | skip_transitive_dependency_licensing true 23 | 24 | dependency "zlib" 25 | dependency "openssl" 26 | dependency "libedit" 27 | dependency "libuuid" unless mac_os_x? 28 | dependency "ncurses" 29 | dependency "config_guess" 30 | 31 | version("13.6") { source sha256: "bafc7fa3d9d4da8fe71b84c63ba8bdfe8092935c30c0aa85c24b2c08508f67fc" } 32 | 33 | version "9.6.20" do 34 | source sha256: "3d08cba409d45ab62d42b24431a0d55e7537bcd1db2d979f5f2eefe34d487bb6" 35 | end 36 | 37 | version "9.6.7" do 38 | source sha256: "2ebe3df3c1d1eab78023bdc3ffa55a154aa84300416b075ef996598d78a624c6" 39 | end 40 | 41 | version "9.6.3" do 42 | source sha256: "1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6" 43 | end 44 | 45 | version "9.6.2" do 46 | source sha256: "0187b5184be1c09034e74e44761505e52357248451b0c854dddec6c231fe50c9" 47 | end 48 | 49 | version "9.6.1" do 50 | source sha256: "e5101e0a49141fc12a7018c6dad594694d3a3325f5ab71e93e0e51bd94e51fcd" 51 | end 52 | 53 | source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2" 54 | 55 | relative_path "postgresql-#{version}" 56 | 57 | build do 58 | env = with_standard_compiler_flags(with_embedded_path) 59 | # https://stackoverflow.com/questions/68379786/building-postgres-from-source-throws-utils-errcodes-h-file-not-found-when-ca 60 | env['MAKELEVEL'] = '0' 61 | 62 | update_config_guess(target: "config") 63 | 64 | command "./configure" \ 65 | " --prefix=#{install_dir}/embedded" \ 66 | " --with-libedit-preferred" \ 67 | " --with-openssl" \ 68 | " --with-uuid=e2fs" \ 69 | " --with-includes=#{install_dir}/embedded/include" \ 70 | " --with-libraries=#{install_dir}/embedded/lib", env: env 71 | 72 | make "world -j #{workers}", env: env 73 | make "install-world", env: env 74 | end 75 | -------------------------------------------------------------------------------- /config/software/ruby-windows-devkit.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "ruby-windows-devkit" 18 | 19 | license "BSD-3-Clause" 20 | license_file "https://raw.githubusercontent.com/oneclick/rubyinstaller/master/LICENSE.txt" 21 | skip_transitive_dependency_licensing true 22 | 23 | dependency "ruby-windows-msys2" 24 | 25 | build do 26 | env = with_standard_compiler_flags(with_embedded_path) 27 | 28 | embedded_dir = "#{install_dir}/embedded" 29 | 30 | # Ruby Installer for windows: 31 | # 1 - MSYS2 base installation 32 | # 2 - MSYS2 system update (optional) 33 | # 3 - MSYS2 and MINGW development toolchain 34 | command "#{embedded_dir}/bin/ridk.cmd install 2 3", env: env, cwd: embedded_dir 35 | end 36 | -------------------------------------------------------------------------------- /config/software/ruby-windows-msys2.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "ruby-windows-msys2" 18 | default_version "20250221" 19 | 20 | license "BSD-3-Clause" 21 | license_file "https://raw.githubusercontent.com/Alexpux/MSYS2-packages/master/LICENSE" 22 | skip_transitive_dependency_licensing true 23 | 24 | if windows_arch_i386? 25 | version "20180531" do 26 | source url: "http://repo.msys2.org/distrib/i686/msys2-base-i686-#{version}.tar.gz", 27 | md5: "08bbc0437919d64da28801ec54e3d943" 28 | relative_path "msys32" 29 | end 30 | else 31 | version "20180531" do 32 | source url: "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar.gz", 33 | md5: "f7ff799d6bb4dcc68c810a6f20d12002" 34 | relative_path "msys64" 35 | end 36 | version "20200903" do 37 | # file has to be decompressed from local cache using xz before build executes 38 | source url: "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar", 39 | sha256: "4507c02cf6c6e4f3de236a89b33e386a396b28ca1c57ad499740d1a7679685d8" 40 | relative_path "msys64" 41 | end 42 | version "20210604" do 43 | # file has to be decompressed from local cache using xz before build executes 44 | source url: "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar", 45 | sha256: "8738e8f0d3e096a8bf581f9ceb674afdcc2fe3202dd1d69f39d9b8d7e3a5e099" 46 | relative_path "msys64" 47 | end 48 | version "20220118" do 49 | # file has to be decompressed from local cache using xz before build executes 50 | source url: "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar", 51 | sha256: "f4f428797a285d29225aebd535d83a4f530fdc3870d8b0a8afa784532472e19d" 52 | relative_path "msys64" 53 | end 54 | version "20220603" do 55 | # file has to be decompressed from local cache using xz before build executes 56 | source url: "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar", 57 | sha256: "39e476b45b7ca39567afd341146af68ed53b89b09c90d285988367ec5c5ecc11" 58 | relative_path "msys64" 59 | end 60 | version "20250221" do 61 | # file has to be decompressed from local cache using xz before build executes 62 | source url: "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-#{version}.tar", 63 | sha256: "cf7bd3ecb4f79eaa58ac794dba3cca15581465b9d92cec59ae4bd99fde74c8a0" 64 | relative_path "msys64" 65 | end 66 | end 67 | 68 | build do 69 | env = with_standard_compiler_flags(with_embedded_path) 70 | 71 | msys_dir = "#{install_dir}/embedded/#{relative_path}" 72 | 73 | sync "#{project_dir}/", "#{msys_dir}" 74 | 75 | command "#{msys_dir}/msys2_shell.cmd -c", env: env 76 | command "#{msys_dir}/usr/bin/bash.exe -lc 'pacman --noconfirm -Syuu'", env: env 77 | command "#{msys_dir}/usr/bin/bash.exe -lc 'pacman --noconfirm -Syuu'", env: env 78 | command "#{msys_dir}/usr/bin/bash.exe -lc 'pacman --noconfirm -Syuu'", env: env 79 | command "#{msys_dir}/usr/bin/bash.exe -lc 'pacman --noconfirm -Syuu'", env: env 80 | end 81 | -------------------------------------------------------------------------------- /config/software/ruby-windows.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "ruby-windows" 18 | default_version "3.2.8-1" 19 | 20 | if windows_arch_i386? 21 | relative_path "rubyinstaller-#{version}-x86" 22 | 23 | version "2.4.3-2" do 24 | source sha256: "ffd023d0aea50c3a9d7a4719c322aa46c4de54fdef55756264663ca74a7c13ea" 25 | end 26 | version "2.5.3-1" do 27 | source sha256: "dc24e05c2c1490c74c6a7256c015cb786fb5f1898f2d8c92cbe4ca8fa271f24a" 28 | end 29 | 30 | source url: "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-#{version}/rubyinstaller-#{version}-x86.7z" 31 | else 32 | relative_path "rubyinstaller-#{version}-x64" 33 | 34 | version "2.4.3-2" do 35 | source sha256: "3c9ace4e96a1bc7bca2c260bf35230e17662857e20a9637bade901cf55622661" 36 | end 37 | version "2.5.3-1" do 38 | source sha256: "eabd682a6fb886a22168f568b9c508318f045dc2e130b2668e39c4a81d340ec9" 39 | end 40 | version "2.6.1-1" do 41 | source sha256: "3f637d73092d3004fb1cee2d7047949aad3880042879d8de55bf661a399f06fc" 42 | end 43 | version "2.6.5-1" do 44 | source sha256: "9b1866e59fe1e7336c4e3231823ff24e121878ed1bac8194ad3fe5e9f2f9ef69" 45 | end 46 | version "2.6.6-1" do 47 | source sha256: "fe5ca2e3ceffa1a98051a85b4028a2bb57332ad4dbb439e377c5775e463096e3" 48 | end 49 | version "2.7.2-1" do 50 | source sha256: "925cc01d453951d1d0c077c44cec90849afc8d23e45946e19ecd3aaabc0c0ab3" 51 | end 52 | 53 | version "3.0.2-1" do 54 | source sha256: "92894c0488ec7eab02b2ffc61a8945c4bf98d69561e170927ec30d60bee57898" 55 | end 56 | 57 | version "3.1.4-1" do 58 | source sha256: "6701088607ea4b587a31af76d75cb3fe9f7bcd75fc175cffcca22369ebb6331d" 59 | end 60 | 61 | version "3.1.5-1" do 62 | source sha256: "f31eece5b5c64563829117d41c09ed87572c595e5d64a525d49c1dd9c50dccca" 63 | end 64 | 65 | version "3.2.5-1" do 66 | source sha256: "3e17f7e60834cfac4b2aae13677c19d3222b52bee328c3c22629246c00cd543c" 67 | end 68 | 69 | version "3.2.8-1" do 70 | source sha256: "e37172bc960a22b1fda9603bea617625b5a1af48d009844818e85eaa00684962" 71 | end 72 | 73 | source url: "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-#{version}/rubyinstaller-#{version}-x64.7z" 74 | end 75 | 76 | build do 77 | sync "#{project_dir}/", "#{install_dir}/embedded" 78 | end 79 | 80 | -------------------------------------------------------------------------------- /config/software/rubygems.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2016 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "rubygems" 18 | 19 | license "MIT" 20 | license_file "https://raw.githubusercontent.com/rubygems/rubygems/master/LICENSE.txt" 21 | skip_transitive_dependency_licensing true 22 | 23 | if windows? 24 | dependency "ruby-windows" 25 | dependency "ruby-windows-devkit" 26 | dependency "ruby-windows-msys2" 27 | else 28 | dependency "ruby" 29 | end 30 | 31 | default_version "3.5.10" 32 | 33 | if version && !source 34 | # NOTE: 2.1.11 is the last version of rubygems before the 2.2.x change to native gem install location 35 | # 36 | # https://github.com/rubygems/rubygems/issues/874 37 | # 38 | # This is a breaking change for omnibus clients. Chef-11 needs to be pinned to 2.1.11 for eternity. 39 | # We have switched from tarballs to just `gem update --system`, but for backcompat 40 | # we pin the previously known tarballs. 41 | known_tarballs = { 42 | "3.1.4" => "d117187a8f016cbe8f52011ae02e858b", 43 | "3.2.22" => "b128d5493da2ec7a1da49a7189c04b35", 44 | "3.3.26" => "ba171c52fd9beda6dac7194413601795", 45 | "3.5.10" => "70f46c096b4e11c42b0190cc3e3375e2" 46 | } 47 | known_tarballs.each do |vsn, md5| 48 | version vsn do 49 | source md5: md5, url: "http://production.cf.rubygems.org/rubygems/rubygems-#{vsn}.tgz" 50 | relative_path "rubygems-#{vsn}" 51 | end 52 | end 53 | end 54 | 55 | # If we still don't have a source (if it's a tarball) grab from ruby ... 56 | if version && !source 57 | # If the version is a gem version, we"ll just be using rubygems. 58 | # If it's a branch or SHA (i.e. v1.2.3) we use github. 59 | begin 60 | Gem::Version.new(version) 61 | rescue ArgumentError 62 | source git: "https://github.com/rubygems/rubygems.git" 63 | end 64 | end 65 | 66 | # git repo is always expanded to "rubygems" 67 | if source && source.include?(:git) 68 | relative_path "rubygems" 69 | end 70 | 71 | build do 72 | env = with_standard_compiler_flags(with_embedded_path) 73 | 74 | # Fix warning on msfconsle bootup that will be fixed when framework's bundler version is updated 75 | # NOTE: Gem::Platform.match is deprecated; use Gem::Platform.match_spec? or match_gem? instead. It will be removed in Rubygems 4 76 | # Gem::Platform.match called from /Users/adfoster/.rvm/gems/ruby-3.3.0/gems/bundler-2.1.4/lib/bundler/index.rb:198. 77 | if version.satisfies?('>= 3.5.10') 78 | patch source: "rubygems-3.5.10.patch", plevel: 1, env: env 79 | end 80 | 81 | if source 82 | # Building from source: 83 | ruby "setup.rb --no-document", env: env 84 | else 85 | # Installing direct from rubygems: 86 | # If there is no version, this will get latest. 87 | gem "update --no-document --system #{version}", env: env 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /config/software/util-macros.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "util-macros" 18 | default_version "1.19.0" 19 | 20 | version "1.19.0" do 21 | source md5: "40e1caa49a71a26e0aa68ddd00203717" 22 | end 23 | 24 | version "1.18.0" do 25 | source md5: "fd0ba21b3179703c071bbb4c3e5fb0f4" 26 | end 27 | 28 | source url: "https://www.x.org/releases/individual/util/util-macros-#{version}.tar.gz" 29 | 30 | license "MIT" 31 | license_file "COPYING" 32 | skip_transitive_dependency_licensing true 33 | 34 | relative_path "util-macros-#{version}" 35 | 36 | build do 37 | env = with_standard_compiler_flags(with_embedded_path) 38 | 39 | command "./configure" \ 40 | " --prefix=#{install_dir}/embedded", env: env 41 | 42 | make "-j #{workers}", env: env 43 | make "-j #{workers} install", env: env 44 | end 45 | -------------------------------------------------------------------------------- /config/software/winpcap-devpack.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "winpcap-devpack" 18 | default_version "4.1.2" 19 | 20 | version "4.1.2" do 21 | source md5: "bae2236af062b0900ad1416b2c4878b9" 22 | end 23 | 24 | dependency "ruby-windows" 25 | dependency "ruby-windows-devkit" 26 | 27 | relative_path "WpdPack" 28 | 29 | source url: "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip" 30 | 31 | build do 32 | ruby_api_version = "3.2.0" 33 | 34 | mkdir "#{install_dir}/embedded/lib" 35 | if windows_arch_i386? 36 | copy "#{project_dir}/Lib/*", "#{install_dir}/embedded/lib" 37 | else 38 | copy "#{project_dir}/Lib/x64/*", "#{install_dir}/embedded/lib" 39 | end 40 | mkdir "#{install_dir}/embedded/include/ruby-#{ruby_api_version}" 41 | copy "#{project_dir}/Include/*", "#{install_dir}/embedded/include/ruby-#{ruby_api_version}" 42 | 43 | end 44 | -------------------------------------------------------------------------------- /config/software/xproto.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "xproto" 18 | default_version "7.0.28" 19 | 20 | version "7.0.28" do 21 | source md5: "0b42843b99aee3e4f6a9cc7710143f86" 22 | end 23 | 24 | version "7.0.25" do 25 | source md5: "a47db46cb117805bd6947aa5928a7436" 26 | end 27 | 28 | source url: "https://www.x.org/releases/individual/proto/xproto-#{version}.tar.gz" 29 | 30 | license "MIT" 31 | license_file "COPYING" 32 | skip_transitive_dependency_licensing true 33 | 34 | relative_path "xproto-#{version}" 35 | 36 | build do 37 | env = with_standard_compiler_flags(with_embedded_path) 38 | 39 | command "./configure" \ 40 | " --prefix=#{install_dir}/embedded", env: env 41 | 42 | make "-j #{workers}", env: env 43 | make "-j #{workers} install", env: env 44 | end 45 | -------------------------------------------------------------------------------- /config/software/zlib.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012-2015 Chef Software, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name "zlib" 18 | default_version "1.2.11" 19 | 20 | version "1.2.11" do 21 | source md5: "1c9f62f0778697a09d36121ead88e08e" 22 | end 23 | version "1.2.8" do 24 | source md5: "44d667c142d7cda120332623eab69f40" 25 | end 26 | version "1.2.6" do 27 | source md5: "618e944d7c7cd6521551e30b32322f4a" 28 | end 29 | 30 | source url: "http://downloads.sourceforge.net/project/libpng/zlib/#{version}/zlib-#{version}.tar.gz" 31 | 32 | license "Zlib" 33 | license_file "README" 34 | skip_transitive_dependency_licensing true 35 | 36 | relative_path "zlib-#{version}" 37 | 38 | build do 39 | if windows? 40 | env = with_standard_compiler_flags(with_embedded_path) 41 | 42 | patch source: "zlib-windows-relocate.patch", env: env 43 | 44 | # We can't use the top-level Makefile. Instead, the developers have made 45 | # an organic, artisanal, hand-crafted Makefile.gcc for us which takes a few 46 | # variables. 47 | env["BINARY_PATH"] = "/bin" 48 | env["LIBRARY_PATH"] = "/lib" 49 | env["INCLUDE_PATH"] = "/include" 50 | env["DESTDIR"] = "#{install_dir}/embedded" 51 | 52 | make_args = [ 53 | "-fwin32/Makefile.gcc", 54 | "SHARED_MODE=1", 55 | "CFLAGS=\"#{env['CFLAGS']} -Wall\"", 56 | "ASFLAGS=\"#{env['CFLAGS']} -Wall\"", 57 | "LDFLAGS=\"#{env['LDFLAGS']}\"", 58 | # The win32 makefile for zlib does not handle parallel make correctly. 59 | # In particular, see its rule for IMPLIB and SHAREDLIB. The ld step in 60 | # SHAREDLIB will generate both the dll and the dll.a files. The step to 61 | # strip the dll occurs next but since the dll.a file is already present, 62 | # make will attempt to link example_d.exe and minigzip_d.exe in parallel 63 | # with the strip step - causing gcc to freak out when a source file is 64 | # rewritten part way through the linking stage. 65 | #"-j #{workers}", 66 | ] 67 | 68 | make(*make_args, env: env) 69 | make("install", *make_args, env: env) 70 | else 71 | # We omit the omnibus path here because it breaks mac_os_x builds by picking 72 | # up the embedded libtool instead of the system libtool which the zlib 73 | # configure script cannot handle. 74 | # TODO: Do other OSes need this? Is this strictly a mac thing? 75 | env = with_standard_compiler_flags 76 | if freebsd? 77 | # FreeBSD 10+ gets cranky if zlib is not compiled in a 78 | # position-independent way. 79 | env["CFLAGS"] << " -fPIC" 80 | end 81 | 82 | configure env: env 83 | 84 | make "-j #{workers}", env: env 85 | make "-j #{workers} install", env: env 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfdb.bat.erb: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | setlocal enabledelayedexpansion 4 | 5 | set SCRIPTDIR=%~dp0 6 | set EMBEDDED=%SCRIPTDIR%..\embedded 7 | set BIN=%EMBEDDED%\bin 8 | set FRAMEWORK=%EMBEDDED%\framework 9 | 10 | set GEM_HOME= 11 | set GEM_PATH= 12 | set GEM_ROOT= 13 | set RUBY_ENGINE= 14 | set RUBY_ROOT= 15 | set PATH=%BIN%;%PATH% 16 | 17 | ruby %FRAMEWORK%\msfdb %* 18 | 19 | exit /b %ERRORLEVEL% 20 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfremove.bat.erb: -------------------------------------------------------------------------------- 1 | @echo off 2 | set SCRIPTDIR=%~dp0 3 | powershell -ExecutionPolicy ByPass -File %SCRIPTDIR%\msfremove.ps1 4 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfremove.ps1.erb: -------------------------------------------------------------------------------- 1 | $filterSpec = "Metasploit-framework" 2 | 3 | $hives = @("HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall") 4 | $hives |% { 5 | $keys = gci $_ -Recurse 6 | $subkeys = $keys |% { 7 | $displayName = [string]$_.GetValue("DisplayName") 8 | $uninstallString = ([string]$_.GetValue("UninstallString")).ToLower().Replace("/i", "").Replace("msiexec.exe", "") 9 | 10 | if ($displayName.StartsWith($filterSpec)) { 11 | msfdb stop 12 | Write-Host "Uninstalling product: $displayName" 13 | Write-Host "$uninstallString" 14 | start-process "msiexec.exe" -arg "/X $uninstallString /qn" -Wait 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfupdate.bat.erb: -------------------------------------------------------------------------------- 1 | @echo off 2 | set SCRIPTDIR=%~dp0 3 | powershell -ExecutionPolicy ByPass -File %SCRIPTDIR%\msfupdate.ps1 4 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfupdate.ps1.erb: -------------------------------------------------------------------------------- 1 | $source = "http://windows.metasploit.com/metasploitframework-latest.msi" 2 | $destination = "$env:userprofile\Downloads\metasploitframework-latest.msi" 3 | 4 | Write-Output "Downloading latest Metasploit Framework" 5 | Import-Module BitsTransfer 6 | Start-BitsTransfer -Source $source -Destination $destination 7 | 8 | Write-Output "Updating Metasploit Framework" 9 | $arguments = 10 | @( 11 | "/I `"$env:userprofile\Downloads\metasploitframework-latest.msi`"", 12 | "/QB", 13 | "/L*V `"$ENV:TEMP\msfupdate.log`"" 14 | ) 15 | 16 | $p = Start-Process -FilePath "msiexec" -ArgumentList $arguments -Wait -PassThru 17 | if($p.ExitCode -ne 0) 18 | { 19 | Write-Output "Metasploit update failed, error code: $($p.ExitCode)" 20 | Exit $p.ExitCode 21 | } else { 22 | Write-Output "Update Complete" 23 | } 24 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers-windows/msfwrapper.bat.erb: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | setlocal enabledelayedexpansion 4 | 5 | for /F %%i in ("%0") do set CMD=%%~ni 6 | set SCRIPTDIR=%~dp0 7 | set EMBEDDED=%SCRIPTDIR%..\embedded 8 | set BIN=%EMBEDDED%\bin 9 | set FRAMEWORK=%EMBEDDED%\framework 10 | 11 | set GEM_HOME= 12 | set GEM_PATH= 13 | set GEM_ROOT= 14 | set RUBY_ENGINE= 15 | set RUBY_ROOT= 16 | set PATH=%BIN%;%PATH% 17 | 18 | if exist %FRAMEWORK%\%CMD% ( 19 | ruby %FRAMEWORK%\%CMD% %* 20 | ) else ( 21 | ruby %BIN%\%CMD% %* 22 | ) 23 | 24 | exit /b %ERRORLEVEL% 25 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers/msfdb.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | INSTALL_DIR="<%= install_dir %>" 4 | PATH="$INSTALL_DIR/embedded/bin:$PATH" 5 | export PATH 6 | 7 | unset GEM_HOME 8 | unset GEM_PATH 9 | unset GEM_ROOT 10 | unset RUBY_ENGINE 11 | unset RUBY_ROOT 12 | 13 | if [ -e /etc/os-release -a $(id -u) -eq 0 ]; then 14 | if grep -q kali /etc/os-release; then 15 | echo "Metasploit running on Kali Linux as root, using system database" 16 | if [ ! -e /usr/share/metasploit-framework/config ]; then 17 | mkdir -p /usr/share/metasploit-framework/config 18 | fi 19 | exec $INSTALL_DIR/embedded/framework/msfdb-kali "$@" 20 | fi 21 | fi 22 | 23 | (cd $INSTALL_DIR/embedded/framework && ruby msfdb "$@") 24 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers/msfremove.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | INSTALL_DIR="<%= install_dir %>" 4 | COUNT=0 5 | 6 | check_platform() 7 | { 8 | if [ "`uname -s`" = "Darwin" ]; then 9 | return 0 10 | else 11 | return 1 12 | fi 13 | } 14 | 15 | check_root() 16 | { 17 | if [ "`id -u`" -eq 0 ]; then 18 | return 0 19 | else 20 | return 1 21 | fi 22 | } 23 | 24 | check_install_dir() 25 | { 26 | if [ -n "$INSTALL_DIR" ]; then 27 | return 0 28 | else 29 | return 1 30 | fi 31 | } 32 | 33 | rm_pkg() 34 | { 35 | rm -rf "$INSTALL_DIR"/* && 36 | pkgutil --forget "$1" > /dev/null && 37 | : $((COUNT=COUNT+1)) 38 | } 39 | 40 | prompt_rm() 41 | { 42 | while true; do 43 | printf "Remove package %s? " "$1" 44 | read REPLY 45 | 46 | case "$REPLY" in 47 | [Yy]*) 48 | echo "Removing package $1" 49 | rm_pkg "$1" 50 | break 51 | ;; 52 | [Nn]*) 53 | echo "Skipping package $1" 54 | break 55 | ;; 56 | *) 57 | echo "Ah ah ah! You didn't say the magic word!" 58 | esac 59 | done 60 | } 61 | 62 | list_pkgs() 63 | { 64 | for PKG in `pkgutil --pkgs='.*metasploit.*'`; do 65 | prompt_rm "$PKG" 66 | done 67 | } 68 | 69 | if ! check_platform; then 70 | echo "Sorry, only OS X is supported at this time!" 71 | exit 1 72 | fi 73 | 74 | if ! check_root; then 75 | echo "got root?" 76 | exit 1 77 | fi 78 | 79 | if ! check_install_dir; then 80 | echo "\$INSTALL_DIR is unset!" 81 | exit 1 82 | fi 83 | 84 | list_pkgs 85 | echo "$COUNT package(s) removed" 86 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework-wrappers/msfwrapper.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cmd=`basename $0` 3 | 4 | CWD=`pwd` 5 | SCRIPTDIR=<%= install_dir %>/bin 6 | cd $SCRIPTDIR 7 | EMBEDDED=$SCRIPTDIR/../embedded 8 | BIN=$EMBEDDED/bin 9 | FRAMEWORK=$EMBEDDED/framework 10 | 11 | LOCALCONF=~/.msf4 12 | DB=$LOCALCONF/db 13 | DBCONF=$LOCALCONF/database.yml 14 | cd "$CWD" 15 | 16 | add_path() { 17 | PROFILE=~/.profile 18 | if [ -e ~/.bash_profile ]; then 19 | PROFILE=~/.bash_profile 20 | fi 21 | echo "PATH=\$PATH:$SCRIPTDIR" >> $PROFILE 22 | echo "export PATH=\$PATH:$SCRIPTDIR" >> $PROFILE 23 | echo "You may need to start a new terminal or log in again for this to take effect." 24 | } 25 | 26 | check_db() { 27 | if [ ! -e $LOCALCONF/database.yml ]; then 28 | while read -p "Would you like to use and setup a new database (recommended)? " yn; do 29 | case $yn in 30 | [Yy]* ) $SCRIPTDIR/msfdb init; break;; 31 | [Nn]* ) break;; 32 | * ) echo "Please answer yes or no.";; 33 | esac 34 | done 35 | fi 36 | } 37 | 38 | check_path() { 39 | if ! hash $cmd 2>/dev/null; then 40 | while read -p "Would you like to add $cmd and other programs to your default PATH? " yn; do 41 | case $yn in 42 | [Yy]* ) add_path; break;; 43 | [Nn]* ) break;; 44 | * ) echo "Please answer yes or no.";; 45 | esac 46 | done 47 | fi 48 | } 49 | 50 | start_db() { 51 | if [ -e $DB -a -e $DBCONF ]; then 52 | if ! $BIN/pg_ctl -D $DB status > /dev/null; then 53 | $SCRIPTDIR/msfdb init 54 | sleep 2 55 | fi 56 | fi 57 | } 58 | 59 | init() { 60 | if [ ! -e $LOCALCONF/initial_setup_complete ]; then 61 | mkdir -p $LOCALCONF 62 | echo 63 | echo " ** Welcome to Metasploit Framework Initial Setup **" 64 | echo " Please answer a few questions to get started." 65 | echo 66 | check_path 67 | echo 68 | check_db 69 | echo 70 | echo " ** Metasploit Framework Initial Setup Complete **" 71 | echo 72 | touch $LOCALCONF/initial_setup_complete 73 | fi 74 | 75 | start_db 76 | } 77 | 78 | # If we are on an updated Kali system, try to use the system database 79 | db_args="" 80 | if [ -e /usr/share/metasploit-framework/config/database.yml \ 81 | -a ! -e $LOCALCONF/database.yml ]; then 82 | db_args="-y /usr/share/metasploit-framework/config/database.yml" 83 | else # Skip initialization if we're root 84 | if [ "`id -u`" -gt 0 ]; then 85 | init 86 | fi 87 | fi 88 | 89 | unset GEM_HOME 90 | unset GEM_PATH 91 | unset GEM_ROOT 92 | unset RUBY_ENGINE 93 | unset RUBY_ROOT 94 | PATH=$BIN:$SCRIPTDIR:$PATH 95 | if [ -e "$FRAMEWORK/$cmd" ]; then 96 | 97 | if [ $cmd = "msfconsole" ]; then 98 | if [ -n "`find $FRAMEWORK/$cmd -mmin +20160`" ]; then 99 | (>&2 echo "This copy of metasploit-framework is more than two weeks old.") 100 | (>&2 echo " Consider running 'msfupdate' to update to the latest version.") 101 | fi 102 | # Uncomment to enable libedit support 103 | # cmd="$cmd -L" 104 | cmd="$cmd $db_args" 105 | fi 106 | 107 | exec $BIN/ruby $FRAMEWORK/$cmd "$@" 108 | else 109 | if [ "$FROM_CONSOLE_PATH" = true ]; then 110 | (cd $FRAMEWORK && $BIN/ruby $BIN/$cmd "$@") 111 | else 112 | exec $BIN/ruby $BIN/$cmd "$@" 113 | fi 114 | fi 115 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework/msfdb-kali.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | METASPLOIT_BASEDIR=/usr/share/metasploit-framework 4 | 5 | DB_CONF=$METASPLOIT_BASEDIR/config/database.yml 6 | DB_NAME=msf 7 | DB_USER=msf 8 | DB_PORT=5432 9 | PG_SERVICE=postgresql 10 | 11 | pw_gen() { 12 | openssl rand -base64 32 13 | } 14 | 15 | pg_cmd() { 16 | su - postgres -c "$*" 17 | } 18 | 19 | start_db() { 20 | if ! service $PG_SERVICE status >/dev/null; then 21 | service $PG_SERVICE start 22 | fi 23 | } 24 | 25 | stop_db() { 26 | if service $PG_SERVICE status >/dev/null; then 27 | service $PG_SERVICE stop 28 | fi 29 | } 30 | 31 | db_exists() { 32 | if pg_cmd "psql -lqt" | cut -d \| -f 1 | grep -qw $1; then 33 | return 0 34 | fi 35 | return 1 36 | } 37 | 38 | user_exists() { 39 | if echo "SELECT usename FROM pg_user;" | pg_cmd "psql -qt postgres" | grep -qw $1; then 40 | return 0 41 | fi 42 | return 1 43 | } 44 | 45 | init_db() { 46 | start_db 47 | if [ -e $DB_CONF ]; then 48 | echo "A database appears to be already configured, skipping initialization" 49 | return 50 | fi 51 | DB_PASS=$(pw_gen) 52 | if user_exists $DB_USER; then 53 | echo "Resetting password of database user '$DB_USER'" 54 | printf "ALTER ROLE $DB_USER WITH PASSWORD '$DB_PASS';\n" | pg_cmd psql postgres >/dev/null 55 | else 56 | echo "Creating database user '$DB_USER'" 57 | printf "%s\n%s\n" "$DB_PASS" "$DB_PASS" | pg_cmd createuser -S -D -R -P $DB_USER >/dev/null 58 | fi 59 | echo "Creating databases '$DB_NAME' and '${DB_NAME}_test'" 60 | if ! db_exists $DB_NAME; then 61 | pg_cmd createdb $DB_NAME -O $DB_USER -T template0 -E UTF-8 62 | fi 63 | if ! db_exists ${DB_NAME}_test; then 64 | pg_cmd createdb ${DB_NAME}_test -O $DB_USER -T template0 -E UTF-8 65 | fi 66 | echo "Creating configuration file in $DB_CONF" 67 | cat > $DB_CONF <<-EOF 68 | development: 69 | adapter: postgresql 70 | database: $DB_NAME 71 | username: $DB_USER 72 | password: $DB_PASS 73 | host: localhost 74 | port: $DB_PORT 75 | pool: 5 76 | timeout: 5 77 | 78 | production: 79 | adapter: postgresql 80 | database: $DB_NAME 81 | username: $DB_USER 82 | password: $DB_PASS 83 | host: localhost 84 | port: $DB_PORT 85 | pool: 5 86 | timeout: 5 87 | 88 | test: 89 | adapter: postgresql 90 | database: ${DB_NAME}_test 91 | username: $DB_USER 92 | password: $DB_PASS 93 | host: localhost 94 | port: $DB_PORT 95 | pool: 5 96 | timeout: 5 97 | EOF 98 | echo "Creating initial database schema" 99 | cd $METASPLOIT_BASEDIR 100 | bundle exec rake db:migrate >/dev/null 101 | } 102 | 103 | delete_db() { 104 | start_db 105 | if db_exists $DB_NAME; then 106 | pg_cmd dropdb $DB_NAME 107 | fi 108 | if db_exists ${DB_NAME}_test; then 109 | pg_cmd dropdb ${DB_NAME}_test 110 | fi 111 | if user_exists $DB_USER; then 112 | pg_cmd dropuser $DB_USER 113 | fi 114 | rm -f $DB_CONF 115 | } 116 | 117 | reinit_db() { 118 | delete_db 119 | init_db 120 | } 121 | 122 | usage() { 123 | PROG=`basename $0` 124 | echo 125 | echo "Manage a metasploit framework database" 126 | echo 127 | echo " $PROG init # initialize the database" 128 | echo " $PROG reinit # delete and reinitialize the database" 129 | echo " $PROG delete # delete database and stop using it" 130 | echo " $PROG start # start the database" 131 | echo " $PROG stop # stop the database" 132 | echo 133 | exit 134 | } 135 | 136 | if [ "$#" -ne 1 ]; then 137 | usage 138 | fi 139 | 140 | if [ $(id -u) -ne 0 ]; then 141 | echo "ERROR: $0: must be run as root" 142 | exit 1 143 | fi 144 | 145 | case $1 in 146 | init) init_db ;; 147 | reinit) reinit_db ;; 148 | delete) delete_db ;; 149 | start) start_db ;; 150 | stop) stop_db ;; 151 | *) echo "Error: unrecognized action '${1}'"; usage ;; 152 | esac 153 | 154 | -------------------------------------------------------------------------------- /config/templates/metasploit-framework/version.yml.erb: -------------------------------------------------------------------------------- 1 | --- 2 | major: <%= major %> 3 | minor: <%= minor %> 4 | patch: <%= patch %> 5 | date: '<%= date %>' 6 | build_framework_rev: '<%= git_hash %>' 7 | -------------------------------------------------------------------------------- /cortex.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | info: 3 | title: Metasploit Omnibus 4 | description: Packaging metasploit-framework with omnibus 5 | x-cortex-git: 6 | github: 7 | alias: r7org 8 | repository: rapid7/metasploit-omnibus 9 | x-cortex-tag: metasploit-omnibus 10 | x-cortex-type: service 11 | x-cortex-domain-parents: 12 | - tag: metasploit 13 | x-cortex-groups: 14 | - exposure:external-ship 15 | openapi: 3.0.1 16 | servers: 17 | - url: "/" 18 | -------------------------------------------------------------------------------- /docker/centos6-x64/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | 3 | !yum.repos.d 4 | -------------------------------------------------------------------------------- /docker/centos6-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-centos6-x64-omnibus . 3 | FROM centos:centos6 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | VOLUME /pkg 7 | 8 | # # Copy newer apt sources that are valid/use https 9 | COPY yum.repos.d /etc/yum.repos.d 10 | 11 | RUN rpm -ivh https://dl.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm 12 | RUN yum upgrade -y && yum clean all 13 | 14 | # TODO: This was skipped as a test and should most likely be added back in: 15 | # RUN yum install -y centos-release-SCL && yum clean all 16 | # 17 | # Reason: 18 | # => ERROR [ 5/26] RUN yum install -y centos-release-SCL && yum clean all 5.9s 19 | # ------ 20 | # > [ 5/26] RUN yum install -y centos-release-SCL && yum clean all: 21 | # 0.986 Loaded plugins: fastestmirror, ovl 22 | # 1.242 Setting up Install Process 23 | # 1.242 Determining fastest mirrors 24 | # 2.372 * epel: ftp-stud.hs-esslingen.de 25 | # 5.668 No package centos-release-SCL available. 26 | # 5.745 Error: Nothing to do 27 | # ------ 28 | # Dockerfile:16 29 | # -------------------- 30 | # 14 | # 31 | # 15 | 32 | # 16 | >>> RUN yum install -y centos-release-SCL && yum clean all 33 | # 17 | RUN rpm --import http://mirrors.neterra.net/repoforge/RPM-GPG-KEY.dag.txt 34 | # 18 | RUN curl -O http://mirrors.neterra.net/repoforge/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm && \ 35 | # -------------------- 36 | # ERROR: failed to solve: process "/bin/sh -c yum install -y centos-release-SCL && yum clean all" did not complete successfully: exit code: 1 37 | 38 | RUN rpm --import http://mirrors.neterra.net/repoforge/RPM-GPG-KEY.dag.txt 39 | RUN curl -O http://mirrors.neterra.net/repoforge/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm && \ 40 | rpm -i rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm && \ 41 | rm rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 42 | 43 | RUN yum --enablerepo=rpmforge-extras install -y \ 44 | autoconf \ 45 | bison \ 46 | flex \ 47 | gcc \ 48 | gcc-c++ \ 49 | kernel-devel \ 50 | make \ 51 | m4 \ 52 | patch \ 53 | openssl-devel \ 54 | expat-devel \ 55 | perl-ExtUtils-MakeMaker \ 56 | curl-devel \ 57 | tar \ 58 | unzip \ 59 | libxml2-devel \ 60 | libxslt-devel \ 61 | ncurses-devel \ 62 | zlib-devel \ 63 | rsync \ 64 | rpm-build \ 65 | fakeroot \ 66 | git \ 67 | ccache \ 68 | createrepo \ 69 | expect \ 70 | sudo \ 71 | && yum clean all 72 | 73 | RUN curl -L https://www.opscode.com/chef/install.sh | bash 74 | RUN git config --global user.email "packager@myco" && \ 75 | git config --global user.name "Omnibus Packager" 76 | 77 | ENV JENKINS_HOME /var/jenkins_home 78 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 79 | 80 | RUN mkdir -p /var/cache/omnibus 81 | RUN mkdir -p /opt/metasploit-framework 82 | RUN chown jenkins /var/cache/omnibus 83 | RUN chown jenkins /opt/metasploit-framework 84 | 85 | RUN echo "#!/usr/bin/expect -f" > /usr/bin/signrpm && \ 86 | echo "spawn rpm --addsign {*}\$argv" >> /usr/bin/signrpm && \ 87 | echo "expect -exact \"Enter pass phrase: \"" >> /usr/bin/signrpm && \ 88 | echo "send -- \"\r\"" >> /usr/bin/signrpm && \ 89 | echo "expect eof" >> /usr/bin/signrpm 90 | RUN chmod 755 /usr/bin/signrpm 91 | 92 | RUN cp ~/.gitconfig "$JENKINS_HOME" 93 | RUN echo "%_signature gpg" > "$JENKINS_HOME/.rpmmacros" && \ 94 | echo "%_gpg_name 35AF4DDB" >> "$JENKINS_HOME/.rpmmacros" && \ 95 | echo "%__gpg_check_password_cmd /bin/true" >> "$JENKINS_HOME/.rpmmacros" && \ 96 | echo "%__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor --use-agent --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" >> "$JENKINS_HOME/.rpmmacros" 97 | RUN chown -R jenkins "$JENKINS_HOME" 98 | RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers 99 | 100 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 101 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 102 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable' 103 | 104 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 105 | RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'" 106 | RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 107 | 108 | # pre-load the omnibus dependencies 109 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 110 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 111 | -------------------------------------------------------------------------------- /docker/centos6-x64/yum.repos.d/CentOS-Base.repo: -------------------------------------------------------------------------------- 1 | [base] 2 | name=CentOS-$releasever - Base 3 | baseurl=https://vault.centos.org/6.10/os/$basearch/ 4 | gpgcheck=1 5 | gpgkey=https://vault.centos.org/6.10/os/$basearch//RPM-GPG-KEY-CentOS-6 6 | -------------------------------------------------------------------------------- /docker/centos6-x64/yum.repos.d/CentOS-SCLo-scl.repo: -------------------------------------------------------------------------------- 1 | # CentOS-SCLo-sclo.repo 2 | # 3 | # Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more 4 | # information 5 | 6 | [centos-sclo-sclo] 7 | name=CentOS-6 - SCLo sclo 8 | baseurl=https://vault.centos.org/6.10/sclo/$basearch/sclo/ 9 | gpgcheck=1 10 | enabled=1 11 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo 12 | 13 | [centos-sclo-sclo-testing] 14 | name=CentOS-6 - SCLo sclo Testing 15 | baseurl=https://vault.centos.org/6.10/sclo/$basearch/sclo/ 16 | gpgcheck=0 17 | enabled=0 18 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo 19 | 20 | [centos-sclo-sclo-source] 21 | name=CentOS-6 - SCLo sclo Sources 22 | baseurl=https://vault.centos.org/6.10/sclo/$basearch/sclo/ 23 | gpgcheck=1 24 | enabled=0 25 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo 26 | 27 | [centos-sclo-sclo-debuginfo] 28 | name=CentOS-6 - SCLo sclo Debuginfo 29 | baseurl=https://vault.centos.org/6.10/sclo/$basearch/ 30 | gpgcheck=1 31 | enabled=0 32 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo 33 | -------------------------------------------------------------------------------- /docker/centos6-x64/yum.repos.d/CentOS-fasttrack.repo: -------------------------------------------------------------------------------- 1 | [fasttrack] 2 | name=CentOS-6 - fasttrack 3 | baseurl=https://vault.centos.org/6.10/$basearch/ 4 | gpgcheck=1 5 | enabled=0 6 | gpgkey=https://vault.centos.org/6.10/$basearch/RPM-GPG-KEY-CentOS-6 7 | -------------------------------------------------------------------------------- /docker/debian-aarch64/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | 3 | !apt 4 | -------------------------------------------------------------------------------- /docker/debian-aarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker build -t rapid7/msf-debian-aarch64-omnibus . 2 | FROM rapid7/msf-debian-aarch64-omnibus:2020_03 3 | MAINTAINER Rapid7 Release Engineering 4 | 5 | RUN ["docker-build-start"] 6 | 7 | # Copy newer apt sources that are valid/use https 8 | COPY apt /etc/apt 9 | 10 | # Update certs as the current ones have expired 11 | RUN mkdir -p /tmp/updated_certs && \ 12 | cd /tmp/updated_certs && \ 13 | curl --location --insecure --output cacert-2023-08-22.pem https://curl.se/ca/cacert-2023-08-22.pem && \ 14 | echo '23c2469e2a568362a62eecf1b49ed90a15621e6fa30e29947ded3436422de9b9 cacert-2023-08-22.pem' > cacert-2023-08-22.pem.sha256 && \ 15 | sha256sum -c cacert-2023-08-22.pem.sha256 && \ 16 | mv cacert-2023-08-22.pem /etc/ssl/certs/ca-certificates.crt && \ 17 | rm -rf /tmp/updated_certs 18 | 19 | # Import newer debian signing keys, as the current version available in the docker image is outdated and apt-get fails 20 | RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 F8D2585B8783D481 21 | 22 | RUN apt-get update && apt-get install -y \ 23 | git \ 24 | curl \ 25 | autoconf \ 26 | binutils-doc \ 27 | bison \ 28 | flex \ 29 | gettext \ 30 | build-essential \ 31 | ruby \ 32 | rsync \ 33 | ccache \ 34 | devscripts \ 35 | fakeroot \ 36 | unzip \ 37 | procps \ 38 | gnupg \ 39 | build-essential \ 40 | m4 && \ 41 | apt-get clean && \ 42 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 43 | 44 | RUN git config --global user.email "packager@example.com" && \ 45 | git config --global user.name "Omnibus Packager" 46 | 47 | RUN command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 48 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 49 | curl -L -sSL https://get.rvm.io | bash -s stable 50 | RUN /bin/bash -l -c "rvm requirements" 51 | RUN /bin/bash -l -c "rvm install 3.0.6" 52 | RUN /bin/bash -l -c "gem install bundler -v 2.2.3 --no-document" 53 | 54 | # pre-load the omnibus dependencies 55 | RUN /bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 56 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus' 57 | 58 | ENV JENKINS_HOME /home/jenkins 59 | RUN id jenkins || useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 60 | RUN cp ~/.gitconfig "$JENKINS_HOME" 61 | RUN chown -R jenkins "$JENKINS_HOME" 62 | RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers 63 | 64 | RUN mkdir -p /var/cache/omnibus 65 | RUN mkdir -p /opt/metasploit-framework 66 | RUN chown jenkins /var/cache/omnibus 67 | RUN chown jenkins /opt/metasploit-framework 68 | RUN chown -R jenkins /var/lib/gems/ 69 | 70 | RUN ["docker-build-end"] 71 | -------------------------------------------------------------------------------- /docker/debian-aarch64/apt/sources.list: -------------------------------------------------------------------------------- 1 | deb http://deb.debian.org/debian bullseye main contrib non-free 2 | deb-src http://deb.debian.org/debian bullseye main contrib non-free 3 | 4 | deb http://deb.debian.org/debian bullseye-updates main contrib non-free 5 | deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free 6 | 7 | deb http://deb.debian.org/debian bullseye-backports main contrib non-free 8 | deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free 9 | -------------------------------------------------------------------------------- /docker/debian-armv7/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | 3 | !apt 4 | -------------------------------------------------------------------------------- /docker/debian-armv7/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker build -t rapid7/msf-debian-armv7-omnibus . 2 | FROM resin/armv7hf-debian-qemu 3 | MAINTAINER Rapid7 Release Engineering 4 | 5 | RUN ["cross-build-start"] 6 | 7 | # Copy newer apt sources that are valid 8 | COPY apt /etc/apt 9 | 10 | RUN apt-get update && apt-get install -y \ 11 | git \ 12 | curl \ 13 | autoconf \ 14 | binutils-doc \ 15 | bison \ 16 | flex \ 17 | gettext \ 18 | build-essential \ 19 | ruby \ 20 | rsync \ 21 | ccache \ 22 | devscripts \ 23 | fakeroot \ 24 | unzip \ 25 | procps \ 26 | gnupg \ 27 | build-essential \ 28 | m4 && \ 29 | apt-get clean && \ 30 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 31 | 32 | RUN git config --global user.email "packager@example.com" && \ 33 | git config --global user.name "Omnibus Packager" 34 | 35 | RUN command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 36 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 37 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable 38 | RUN /bin/bash -l -c "rvm requirements" 39 | RUN /bin/bash -l -c "rvm install 3.0.6" 40 | RUN /bin/bash -l -c "gem install bundler -v 2.2.4 --no-document" 41 | 42 | # pre-load the omnibus dependencies 43 | RUN git clone https://github.com/rapid7/metasploit-omnibus.git 44 | RUN cd metasploit-omnibus && /bin/bash -l -c "bundle install && bundle binstubs --all" 45 | RUN rm -fr metasploit-omnibus 46 | 47 | ENV JENKINS_HOME /home/jenkins 48 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 49 | RUN cp ~/.gitconfig "$JENKINS_HOME" 50 | RUN chown -R jenkins "$JENKINS_HOME" 51 | 52 | RUN mkdir -p /var/cache/omnibus 53 | RUN mkdir -p /opt/metasploit-framework 54 | RUN chown jenkins /var/cache/omnibus 55 | RUN chown jenkins /opt/metasploit-framework 56 | 57 | RUN ["cross-build-end"] 58 | -------------------------------------------------------------------------------- /docker/debian-armv7/apt/sources.list: -------------------------------------------------------------------------------- 1 | deb http://archive.debian.org/debian/ jessie main 2 | deb-src http://archive.debian.org/debian/ jessie main 3 | 4 | deb http://archive.debian.org/debian-security jessie/updates main 5 | deb-src http://archive.debian.org/debian/ jessie main 6 | -------------------------------------------------------------------------------- /docker/fedora30-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-fedora30-x64-omnibus . 3 | FROM fedora:30 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | VOLUME /pkg 7 | 8 | RUN yum upgrade -y && yum clean all 9 | 10 | RUN yum install -y \ 11 | autoconf \ 12 | bison \ 13 | flex \ 14 | gcc \ 15 | gcc-c++ \ 16 | kernel-devel \ 17 | make \ 18 | m4 \ 19 | patch \ 20 | openssl-devel \ 21 | expat-devel \ 22 | perl-ExtUtils-MakeMaker \ 23 | curl-devel \ 24 | tar \ 25 | unzip \ 26 | libxml2-devel \ 27 | libxslt-devel \ 28 | ncurses-devel \ 29 | zlib-devel \ 30 | rsync \ 31 | rpm-build \ 32 | rpm-sign \ 33 | fakeroot \ 34 | git \ 35 | gpg \ 36 | procps \ 37 | which \ 38 | ccache \ 39 | createrepo \ 40 | expect \ 41 | sudo \ 42 | && yum clean all 43 | 44 | RUN curl -L https://www.opscode.com/chef/install.sh | bash 45 | RUN git config --global user.email "packager@myco" && \ 46 | git config --global user.name "Omnibus Packager" 47 | 48 | ENV JENKINS_HOME /var/jenkins_home 49 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 50 | 51 | RUN mkdir -p /var/cache/omnibus 52 | RUN mkdir -p /opt/metasploit-framework 53 | RUN chown jenkins /var/cache/omnibus 54 | RUN chown jenkins /opt/metasploit-framework 55 | 56 | RUN echo "#!/usr/bin/expect -f" > /usr/bin/signrpm && \ 57 | echo "spawn rpm --addsign {*}\$argv" >> /usr/bin/signrpm && \ 58 | echo "expect -exact \"Enter pass phrase: \"" >> /usr/bin/signrpm && \ 59 | echo "send -- \"\r\"" >> /usr/bin/signrpm && \ 60 | echo "expect eof" >> /usr/bin/signrpm 61 | RUN chmod 755 /usr/bin/signrpm 62 | 63 | RUN cp ~/.gitconfig "$JENKINS_HOME" 64 | RUN echo "%_signature gpg" > "$JENKINS_HOME/.rpmmacros" && \ 65 | echo "%_gpg_name 35AF4DDB" >> "$JENKINS_HOME/.rpmmacros" && \ 66 | echo "%__gpg_check_password_cmd /bin/true" >> "$JENKINS_HOME/.rpmmacros" && \ 67 | echo "%__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor --use-agent --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" >> "$JENKINS_HOME/.rpmmacros" 68 | RUN chown -R jenkins "$JENKINS_HOME" 69 | RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers 70 | 71 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 72 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 73 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable' 74 | 75 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 76 | RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'" 77 | RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 78 | # pre-load the omnibus dependencies 79 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 80 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 81 | -------------------------------------------------------------------------------- /docker/kali109-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-kali109-x64-omnibus . 3 | FROM rapid7/build:kali109_64 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | # package/ruby: needs gcc and host gcc >= 4.9, available only in Sana - https://www.kali.org/blog/kali-moto-eol/ 7 | RUN echo "deb http://old.kali.org/kali sana main non-free contrib" > /etc/apt/sources.list 8 | 9 | RUN rm -fr /var/lib/apt/lists && \ 10 | apt-get update && \ 11 | apt-get install -y --force-yes kali-archive-keyring && \ 12 | apt-get update && \ 13 | apt-get install -y --force-yes \ 14 | curl \ 15 | binutils-doc \ 16 | flex \ 17 | ruby ruby-dev \ 18 | ccache \ 19 | fakeroot \ 20 | libreadline-dev \ 21 | libcurl4-openssl-dev \ 22 | libexpat1-dev \ 23 | libicu-dev \ 24 | gawk \ 25 | pkg-config \ 26 | sqlite3 \ 27 | reprepro && \ 28 | apt-get clean && \ 29 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 30 | 31 | RUN git config --global user.email "packager@example.com" && \ 32 | git config --global user.name "Omnibus Packager" 33 | 34 | ENV JENKINS_HOME /home/jenkins 35 | RUN mkdir -p "$JENKINS_HOME" && \ 36 | cp ~/.gitconfig "$JENKINS_HOME" && \ 37 | chown -R jenkins "$JENKINS_HOME" && \ 38 | mkdir -p /var/cache/omnibus && \ 39 | mkdir -p /opt/metasploit-framework && \ 40 | chown jenkins /var/cache/omnibus && \ 41 | chown jenkins /opt/metasploit-framework 42 | RUN echo "jenkins ALL=NOPASSWD: ALL" > /etc/sudoers.d/jenkins 43 | RUN chmod 440 /etc/sudoers.d/jenkins 44 | RUN apt-get remove -y libpq-dev libpq5 45 | 46 | # Update certs as the current ones have expired 47 | RUN mkdir -p /tmp/updated_certs && \ 48 | cd /tmp/updated_certs && \ 49 | curl --location --insecure --output cacert-2023-08-22.pem https://curl.se/ca/cacert-2023-08-22.pem && \ 50 | echo '23c2469e2a568362a62eecf1b49ed90a15621e6fa30e29947ded3436422de9b9 cacert-2023-08-22.pem' > cacert-2023-08-22.pem.sha256 && \ 51 | sha256sum -c cacert-2023-08-22.pem.sha256 && \ 52 | mv cacert-2023-08-22.pem /etc/ssl/certs/ca-certificates.crt && \ 53 | rm -rf /tmp/updated_certs 54 | 55 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 56 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 57 | curl --insecure --output /tmp/rvm-installer -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer && \ 58 | echo "fea24461e98d41528d6e28684aa4c216dbe903869bc3fcdb3493b6518fae2e7e /tmp/rvm-installer" | sha256sum -c && \ 59 | command cat /tmp/rvm-installer | bash -s stable && \ 60 | rm /tmp/rvm-installer' 61 | 62 | RUN curl -O ftp://ftp.tcl.tk/pub/tcl/tcl8_6/tcl8.6.9-src.tar.gz && \ 63 | tar zxf tcl8.6.9-src.tar.gz && \ 64 | cd tcl8.6.9/unix && \ 65 | ./configure && make && make install && \ 66 | cd ../../ && rm -rf tcl8.6.9* 67 | 68 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 69 | RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'" 70 | RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 71 | 72 | # pre-load the omnibus dependencies 73 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 74 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 75 | -------------------------------------------------------------------------------- /docker/ubuntu1204-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-ubuntu1204-x64-omnibus . 3 | FROM ubuntu:12.04.5 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | RUN sed -i 's/archive\.ubuntu/old-releases\.ubuntu/g' /etc/apt/sources.list 7 | 8 | RUN rm -fr /var/lib/apt/lists && \ 9 | apt-get update && \ 10 | apt-get install -y \ 11 | curl \ 12 | binutils-doc \ 13 | flex \ 14 | git \ 15 | ruby ruby-dev \ 16 | ccache \ 17 | fakeroot \ 18 | libreadline-dev \ 19 | libcurl4-openssl-dev \ 20 | libexpat1-dev \ 21 | libicu-dev \ 22 | reprepro \ 23 | sudo && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | RUN git config --global user.email "packager@example.com" && \ 28 | git config --global user.name "Omnibus Packager" 29 | 30 | ENV JENKINS_HOME /home/jenkins 31 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 32 | 33 | RUN mkdir -p "$JENKINS_HOME" && \ 34 | cp ~/.gitconfig "$JENKINS_HOME" && \ 35 | chown -R jenkins "$JENKINS_HOME" && \ 36 | mkdir -p /var/cache/omnibus && \ 37 | mkdir -p /opt/metasploit-framework && \ 38 | chown jenkins /var/cache/omnibus && \ 39 | chown jenkins /opt/metasploit-framework 40 | RUN mkdir -p /etc/sudoers.d 41 | RUN echo "jenkins ALL=NOPASSWD: ALL" > /etc/sudoers.d/jenkins 42 | RUN chmod 440 /etc/sudoers.d/jenkins 43 | 44 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 45 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 46 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable ' 47 | 48 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 49 | RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'" 50 | RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 51 | 52 | # pre-load the omnibus dependencies 53 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 54 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 55 | -------------------------------------------------------------------------------- /docker/ubuntu1204-x86/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-ubuntu1204-x86-omnibus . 3 | FROM i386/ubuntu:12.04 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | RUN sed -i 's/archive\.ubuntu/old-releases\.ubuntu/g' /etc/apt/sources.list 7 | 8 | RUN rm -fr /var/lib/apt/lists && \ 9 | apt-get update && \ 10 | apt-get install -y \ 11 | curl \ 12 | binutils-doc \ 13 | flex \ 14 | git \ 15 | ruby ruby-dev \ 16 | ccache \ 17 | fakeroot \ 18 | libreadline-dev \ 19 | libcurl4-openssl-dev \ 20 | libexpat1-dev \ 21 | libicu-dev \ 22 | reprepro \ 23 | sudo && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | RUN git config --global user.email "packager@example.com" && \ 28 | git config --global user.name "Omnibus Packager" 29 | 30 | ENV JENKINS_HOME /home/jenkins 31 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 32 | 33 | RUN mkdir -p "$JENKINS_HOME" && \ 34 | cp ~/.gitconfig "$JENKINS_HOME" && \ 35 | chown -R jenkins "$JENKINS_HOME" && \ 36 | mkdir -p /var/cache/omnibus && \ 37 | mkdir -p /opt/metasploit-framework && \ 38 | chown jenkins /var/cache/omnibus && \ 39 | chown jenkins /opt/metasploit-framework 40 | RUN mkdir -p /etc/sudoers.d 41 | RUN echo "jenkins ALL=NOPASSWD: ALL" > /etc/sudoers.d/jenkins 42 | RUN chmod 440 /etc/sudoers.d/jenkins 43 | 44 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 45 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 46 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable ' 47 | 48 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 49 | RUN su jenkins -c "linux32 /bin/bash -l -c 'rvm install 3.0.6'" 50 | RUN su jenkins -c "linux32 /bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 51 | 52 | # pre-load the omnibus dependencies 53 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 54 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 55 | -------------------------------------------------------------------------------- /docker/ubuntu1804-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | # To build the dev environment. 2 | # docker build -t rapid7/msf-ubuntu1204-x64-omnibus . 3 | FROM ubuntu:18.04 4 | MAINTAINER Rapid7 Release Engineering 5 | 6 | RUN rm -fr /var/lib/apt/lists && \ 7 | apt-get update && \ 8 | apt-get install -y \ 9 | curl \ 10 | binutils-doc \ 11 | flex \ 12 | git \ 13 | ruby ruby-dev \ 14 | ccache \ 15 | fakeroot \ 16 | libreadline-dev \ 17 | libcurl4-openssl-dev \ 18 | libexpat1-dev \ 19 | libicu-dev \ 20 | reprepro \ 21 | sudo && \ 22 | apt-get clean && \ 23 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | RUN git config --global user.email "packager@example.com" && \ 26 | git config --global user.name "Omnibus Packager" 27 | 28 | ENV JENKINS_HOME /home/jenkins 29 | RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins 30 | 31 | RUN mkdir -p "$JENKINS_HOME" && \ 32 | cp ~/.gitconfig "$JENKINS_HOME" && \ 33 | chown -R jenkins "$JENKINS_HOME" && \ 34 | mkdir -p /var/cache/omnibus && \ 35 | mkdir -p /opt/metasploit-framework && \ 36 | chown jenkins /var/cache/omnibus && \ 37 | chown jenkins /opt/metasploit-framework 38 | RUN mkdir -p /etc/sudoers.d 39 | RUN echo "jenkins ALL=NOPASSWD: ALL" > /etc/sudoers.d/jenkins 40 | RUN chmod 440 /etc/sudoers.d/jenkins 41 | 42 | RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 43 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 44 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable' 45 | 46 | RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'" 47 | RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'" 48 | RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 49 | 50 | # pre-load the omnibus dependencies 51 | RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 52 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 53 | -------------------------------------------------------------------------------- /omnibus.rb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is used to configure the metasploit project. It contains 3 | # some minimal configuration examples for working with Omnibus. For a full list 4 | # of configurable options, please see the documentation for +omnibus/config.rb+. 5 | # 6 | 7 | # Build internally 8 | # ------------------------------ 9 | # By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and 10 | # cache components. If you would to build everything internally, you can 11 | # uncomment the following options. This will prevent the need for root 12 | # permissions in most cases. 13 | # 14 | # Uncomment this line to change the default base directory to "local" 15 | # ------------------------------------------------------------------- 16 | # base_dir './local' 17 | 18 | # 19 | # Alternatively you can tune the individual values 20 | # ------------------------------------------------ 21 | cache_dir './local/cache' 22 | git_cache_dir './local/cache/git_cache' 23 | source_dir './local/src' 24 | build_dir './local/build' 25 | # package_dir './local/omnibus/pkg' 26 | # package_tmp './local/omnibus/pkg-tmp' 27 | 28 | # Disable git caching 29 | # ------------------------------ 30 | use_git_caching false 31 | 32 | # Enable S3 asset caching 33 | # ------------------------------ 34 | # use_s3_caching true 35 | # s3_access_key ENV['AWS_ACCESS_KEY_ID'] 36 | # s3_secret_key ENV['AWS_SECRET_ACCESS_KEY'] 37 | # s3_bucket ENV['AWS_S3_BUCKET'] 38 | 39 | # Customize compiler bits 40 | # ------------------------------ 41 | # solaris_compiler 'gcc' 42 | # build_retries 5 43 | # fetcher_read_timeout 120 44 | 45 | # Load additional software 46 | # ------------------------------ 47 | # software_gems ['omnibus-software', 'my-company-software'] 48 | # local_software_dirs ['/path/to/local/software'] 49 | 50 | # The default arch is :x64 on 64-bit build machines 51 | windows_arch :x64 52 | -------------------------------------------------------------------------------- /package-scripts/metasploit-framework/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Perform necessary metasploit setup steps 4 | # after package is installed. 5 | # 6 | 7 | BINS="msfbinscan msfconsole msfd msfdb msfelfscan msfmachscan msfpescan msfrop msfrpc msfrpcd msfupdate msfvenom" 8 | 9 | if [ -x /usr/sbin/update-alternatives -o -x /usr/bin/update-alternatives ] ; then 10 | for BIN in $BINS; do 11 | update-alternatives --install /usr/bin/$BIN $BIN /opt/metasploit-framework/bin/$BIN 100 12 | done 13 | echo "Run msfconsole to get started" 14 | else 15 | echo "Run /opt/metasploit-framework/bin/msfconsole to get started" 16 | fi 17 | 18 | exit 0 19 | -------------------------------------------------------------------------------- /package-scripts/metasploit-framework/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Perform necessary metasploit removal steps 4 | # after package is uninstalled. 5 | # 6 | 7 | exit 0 8 | -------------------------------------------------------------------------------- /package-scripts/metasploit-framework/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Perform necessary metasploit setup steps 4 | # before package is installed. 5 | # 6 | 7 | -------------------------------------------------------------------------------- /package-scripts/metasploit-framework/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Perform necessary metasploit setup steps 4 | # prior to installing package. 5 | # 6 | 7 | BINS="msfbinscan msfconsole msfd msfdb msfelfscan msfmachscan msfpescan msfrop msfrpc msfrpcd msfupdate msfvenom" 8 | 9 | if [ -x /usr/sbin/update-alternatives ] ; then 10 | for BIN in $BINS; do 11 | update-alternatives --remove $BIN /opt/metasploit-framework/bin/$BIN 12 | done 13 | fi 14 | 15 | exit 0 16 | -------------------------------------------------------------------------------- /packer/configure_ami.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" != 0 ]; then 4 | echo "WARNING: Script should be run as root." 5 | sleep 3 6 | fi 7 | 8 | export BUILD_DIR=`pwd` 9 | export DOCKER_FLAGS="" 10 | 11 | set -ex 12 | 13 | apt-get update 14 | 15 | apt-get install -y wget bsdmainutils 16 | 17 | # docker-ce latest 18 | apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common 19 | curl -fsSL https://get.docker.com -o get-docker.sh 20 | sh get-docker.sh 21 | usermod -aG docker ubuntu 22 | curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose 23 | chmod +x /usr/bin/docker-compose 24 | 25 | rm -fr /var/lib/apt/lists && \ 26 | apt-get update && \ 27 | apt-get install -y \ 28 | curl \ 29 | binutils-doc \ 30 | flex \ 31 | git \ 32 | ruby ruby-dev \ 33 | ccache \ 34 | fakeroot \ 35 | libreadline-dev \ 36 | libcurl4-openssl-dev \ 37 | libexpat1-dev \ 38 | libicu-dev \ 39 | reprepro \ 40 | sudo && \ 41 | apt-get clean && \ 42 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 43 | 44 | git config --global user.email "packager@example.com" && \ 45 | git config --global user.name "Omnibus Packager" 46 | 47 | export BUILD_USER="ubuntu" 48 | export USER_HOME="/home/$BUILD_USER" 49 | cp ~/.gitconfig "$USER_HOME" && \ 50 | chown -R $BUILD_USER:$BUILD_USER $USER_HOME && \ 51 | chown -R $BUILD_USER "$USER_HOME" && \ 52 | mkdir -p /var/cache/omnibus && \ 53 | mkdir -p /opt/metasploit-framework && \ 54 | chown $BUILD_USER /var/cache/omnibus && \ 55 | chown $BUILD_USER /opt/metasploit-framework 56 | 57 | su $BUILD_USER -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ 58 | command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ 59 | curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable' 60 | 61 | su $BUILD_USER -c "/bin/bash -l -c 'rvm requirements'" 62 | su $BUILD_USER -c "/bin/bash -l -c 'rvm install 3.0.6'" 63 | su $BUILD_USER -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'" 64 | su $BUILD_USER -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \ 65 | cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'" 66 | 67 | # Remove Aptitude daily cron jobs 68 | systemctl disable apt-daily.service 69 | systemctl disable apt-daily.timer 70 | systemctl disable apt-daily-upgrade.timer 71 | systemctl disable apt-daily-upgrade.service 72 | 73 | # Wipe /etc/rc.local 74 | echo '#!/bin/sh' > /etc/rc.local 75 | chmod u+x /etc/rc.local 76 | 77 | # Cleanup build files, logs and histories 78 | rm -rf /var/log/auth.log* /var/log/syslog # Cleanup system logs 79 | rm -rf ~/.bash_history # Cleanup root's history 80 | rm -rf ~ubuntu/* ~ubuntu/.bash_history # Cleanup ubuntu's home and history 81 | unset HISTFILE # Prevent this session's history from being written 82 | 83 | docker system prune -f 84 | docker ps -a 85 | docker images -a 86 | 87 | echo Done && exit 88 | 89 | -------------------------------------------------------------------------------- /packer/ubuntu-amd64-ami.json: -------------------------------------------------------------------------------- 1 | { 2 | "variables": { 3 | "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", 4 | "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}", 5 | "region": "us-west-1" 6 | }, 7 | "builders": [ 8 | { 9 | "access_key": "{{user `aws_access_key`}}", 10 | "ami_name": "metasploit-omnibus-amd64-{{timestamp}}", 11 | "instance_type": "t2.micro", 12 | "region": "{{user `region`}}", 13 | "secret_key": "{{user `aws_secret_key`}}", 14 | "launch_block_device_mappings": [ { 15 | "device_name": "/dev/sda1", 16 | "volume_size": 20, 17 | "volume_type": "gp2", 18 | "delete_on_termination": true 19 | } ], 20 | "source_ami_filter": { 21 | "filters": { 22 | "virtualization-type": "hvm", 23 | "name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*", 24 | "root-device-type": "ebs" 25 | }, 26 | "owners": ["099720109477"], 27 | "most_recent": true 28 | }, 29 | "ssh_username": "ubuntu", 30 | "type": "amazon-ebs" 31 | } 32 | ], 33 | "provisioners": [ 34 | { 35 | "execute_command": "{{.Vars}} sudo -E -S bash '{{.Path}}'", 36 | "type": "shell", 37 | "script": "./configure_ami.sh", 38 | "expect_disconnect": "true" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /packer/ubuntu-arm64-ami.json: -------------------------------------------------------------------------------- 1 | { 2 | "variables": { 3 | "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", 4 | "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}", 5 | "region": "us-west-1" 6 | }, 7 | "builders": [ 8 | { 9 | "access_key": "{{user `aws_access_key`}}", 10 | "ami_name": "metasploit-omnibus-aarch64-{{timestamp}}", 11 | "instance_type": "t4g.medium", 12 | "region": "{{user `region`}}", 13 | "secret_key": "{{user `aws_secret_key`}}", 14 | "launch_block_device_mappings": [ { 15 | "device_name": "/dev/sda1", 16 | "volume_size": 20, 17 | "volume_type": "gp2", 18 | "delete_on_termination": true 19 | } ], 20 | "source_ami_filter": { 21 | "filters": { 22 | "virtualization-type": "hvm", 23 | "name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-*", 24 | "root-device-type": "ebs" 25 | }, 26 | "owners": ["099720109477"], 27 | "most_recent": true 28 | }, 29 | "ssh_username": "ubuntu", 30 | "type": "amazon-ebs" 31 | } 32 | ], 33 | "provisioners": [ 34 | { 35 | "execute_command": "{{.Vars}} sudo -E -S bash '{{.Path}}'", 36 | "type": "shell", 37 | "script": "./configure_ami.sh", 38 | "expect_disconnect": "true" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /pkg/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/LICENSE.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1397 2 | {\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \vieww17900\viewh17820\viewkind0 5 | \deftab720 6 | \pard\pardeftab720\partightenfactor0 7 | 8 | \f0\fs18 \cf0 Copyright (C) 2006-2015, Rapid7, Inc.\ 9 | All rights reserved.\ 10 | \ 11 | Redistribution and use in source and binary forms, with\ 12 | or without modification, are permitted provided that\ 13 | the following conditions are met:\ 14 | \ 15 | * Redistributions of source code must retain the\ 16 | above copyright notice this list of conditions\ 17 | and the following disclaimer.\ 18 | \ 19 | * Redistributions in binary form must reproduce the\ 20 | above copyright notice, this list of conditions\ 21 | and the following disclaimer in the documentation\ 22 | and/or other materials provided with the\ 23 | distribution.\ 24 | \ 25 | * Neither the name of Rapid7, Inc. nor the names of\ 26 | its contributors may be used to endorse or\ 27 | promote products derived from this software\ 28 | without specific prior written permission.\ 29 | \ 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\ 31 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,\ 32 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\ 33 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\ 34 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\ 35 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\ 36 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\ 37 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\ 38 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\ 39 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\ 40 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\ 41 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\ 42 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\ 43 | POSSIBILITY OF SUCH DAMAGE.\ 44 | \ 45 | ========================================================\ 46 | \ 47 | The Metasploit Framework is provided under the 3-clause\ 48 | BSD license above.\ 49 | \ 50 | The copyright on this package is held by Rapid7, Inc.\ 51 | \ 52 | This license does not apply to several components within\ 53 | the Metasploit Framework source tree. For more details\ 54 | see the LICENSE file at\ 55 | https://github.com/rapid7/metasploit-framework/blob/master/LICENSE 56 | \fs16 \ 57 | } -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/banner_background.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/msi/assets/banner_background.bmp -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/dialog_background.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/msi/assets/dialog_background.bmp -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/project.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/msi/assets/project.ico -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/project_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/msi/assets/project_16x16.ico -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/assets/project_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/msi/assets/project_32x32.ico -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/localization-en-us.wxl.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1033 4 | <%= friendly_name %> 5 | <%= maintainer.encode(:xml => :text) %> 6 | {\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard 7 | 8 | {\WixUI_Font_Title_White}End-User License Agreement 9 | {\WixUI_Font_Normal_White}Please read the following license agreement carefully 10 | 11 | {\WixUI_Font_Title_White}Destination Folder 12 | {\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another. 13 | 14 | {\WixUI_Font_Title_White}Installing [ProductName] 15 | 16 | {\WixUI_Font_Title_White}Ready to install [ProductName] 17 | 18 | <%= friendly_name %> 19 | 20 | This package requires minimum OS version: Windows 7/Windows Server 2008 R2 or greater. 21 | A newer version of [ProductName] is already installed. 22 | Extracting files, please wait... 23 | 24 | -------------------------------------------------------------------------------- /resources/metasploit-framework/msi/parameters.wxi.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | " ?> 4 | " ?> 5 | " ?> 6 | <% parameters.each do |key, value| -%> 7 | ="<%= value %>" ?> 8 | <% end -%> 9 | 10 | -------------------------------------------------------------------------------- /resources/metasploit-framework/pkg/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/metasploit-omnibus/2c7e8b4b345e932d5a64f5fd05cf801d4ce6361a/resources/metasploit-framework/pkg/background.png -------------------------------------------------------------------------------- /resources/metasploit-framework/pkg/distribution.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= friendly_name %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | <%= component_pkg %> 21 | 22 | 23 | -------------------------------------------------------------------------------- /resources/metasploit-framework/pkg/license.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Metasploit is primarily distributed under the 3-clause BSD license.

4 |

See the current LICENSE file for details.

5 |
6 | 7 | -------------------------------------------------------------------------------- /resources/metasploit-framework/pkg/welcome.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |

This will install Metasploit Framework and its dependencies on your Mac.

4 | 5 |

The framework itself will be installed under /opt/metasploit-framework/framework. 6 | Convenience wrappers for the commands are installed under /opt/metasploit-framework/bin, 7 | which can be added to your PATH environment variable.

8 | 9 |

If you want to use a database with the framework, you can use the 'msfdb' 10 | command to configure, start and stop it. Run '/opt/metasploit-framework/bin/msfdb' for 11 | more information.

12 | 13 |

If you are interested in Metasploit Framework development, see the 14 | Github Project and the 15 | Development Wiki. 16 |

17 | 18 |

Thank you for using Metasploit! Have a fantastic day!

19 |
20 | 21 | --------------------------------------------------------------------------------