aboutsummaryrefslogtreecommitdiffstats
path: root/net/foreman-proxy
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2014-09-28 01:23:35 +0800
committerMartin Matuska <mm@FreeBSD.org>2014-09-28 01:23:35 +0800
commitcaf96f1f375e455a7844d956ea3bf2694a39195a (patch)
tree582c93b278e6d1b7beafd89b275ae488b3d6d7ad /net/foreman-proxy
parentc80a182aef95050259c4626117c60d9a960f1421 (diff)
downloadfreebsd-ports-gnome-caf96f1f375e455a7844d956ea3bf2694a39195a.tar.gz
freebsd-ports-gnome-caf96f1f375e455a7844d956ea3bf2694a39195a.tar.zst
freebsd-ports-gnome-caf96f1f375e455a7844d956ea3bf2694a39195a.zip
Update foreman-proxy to 1.6.0
Diffstat (limited to 'net/foreman-proxy')
-rw-r--r--net/foreman-proxy/Makefile47
-rw-r--r--net/foreman-proxy/distinfo4
-rw-r--r--net/foreman-proxy/files/patch-bin-smart-proxy10
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-chef.yml.example8
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-dhcp.yml.example20
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-dns.yml.example17
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-puppet.yml.example39
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-puppetca.yml.example12
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-realm.yml.example11
-rw-r--r--net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example9
-rw-r--r--net/foreman-proxy/files/patch-config-settings.yml.example102
-rw-r--r--net/foreman-proxy/files/patch-extra-migrate_settings.rb11
-rw-r--r--net/foreman-proxy/files/patch-lib-proxy-http_downloads.rb14
-rw-r--r--net/foreman-proxy/files/patch-lib-proxy-tftp.rb14
-rw-r--r--net/foreman-proxy/pkg-plist189
15 files changed, 312 insertions, 195 deletions
diff --git a/net/foreman-proxy/Makefile b/net/foreman-proxy/Makefile
index b07dccb0f0df..1c88e3e544a2 100644
--- a/net/foreman-proxy/Makefile
+++ b/net/foreman-proxy/Makefile
@@ -2,17 +2,20 @@
# $FreeBSD$
PORTNAME= foreman-proxy
-PORTVERSION= 1.5.1
+PORTVERSION= 1.6.0
CATEGORIES= net
MASTER_SITES= GH
MAINTAINER= mm@FreeBSD.org
-COMMENT= Foreman Smart Proxy
+COMMENT= Foreman Proxy Agent
LICENSE= GPLv3
-RUN_DEPENDS= rubygem-sinatra>=1.4.3:${PORTSDIR}/www/rubygem-sinatra \
- rubygem-json>=1.8.1:${PORTSDIR}/devel/rubygem-json
+RUN_DEPENDS= rubygem-bundler_ext>=0.4:${PORTSDIR}/sysutils/rubygem-bundler_ext \
+ rubygem-json>=1.8.1:${PORTSDIR}/devel/rubygem-json \
+ rubygem-rack>=1.1:${PORTSDIR}/www/rubygem-rack \
+ rubygem-sinatra>=1.4.3:${PORTSDIR}/www/rubygem-sinatra \
+ ${LOCALBASE}/bin/wget:${PORTSDIR}/ftp/wget
OPTIONS_DEFINE= BMC PUPPET
BMC_DESC= Depend on rubyipmi for BMC support
@@ -21,7 +24,7 @@ PUPPET_DESC= Depend on Puppet
USE_GITHUB= yes
GH_ACCOUNT= theforeman
GH_PROJECT= smart-proxy
-GH_COMMIT= 2924287
+GH_COMMIT= 0330140
USE_RUBY= yes
USE_RAKE= yes
USE_RC_SUBR= foreman-proxy
@@ -53,7 +56,8 @@ RUN_DEPENDS+= rubygem-rubyipmi>=0.7:${PORTSDIR}/sysutils/rubygem-rubyipmi
.endif
.if ${PORT_OPTIONS:MPUPPET}
-RUN_DEPENDS+= puppet:${PORTSDIR}/sysutils/puppet
+RUN_DEPENDS+= puppet:${PORTSDIR}/sysutils/puppet \
+ rubygem-ruby-augeas>=0.5:${PORTSDIR}/textproc/rubygem-augeas
.endif
.include <bsd.port.pre.mk>
@@ -61,27 +65,38 @@ RUN_DEPENDS+= puppet:${PORTSDIR}/sysutils/puppet
post-patch:
@${REINPLACE_CMD} \
-e "s|/usr/bin/env ruby|${RUBY}|g" \
- -e "s|#{File.dirname(__FILE__)}/..|${DATADIR}|g" \
- ${WRKSRC}/bin/smart-proxy
+ -e "s|/usr/bin/ruby|${RUBY}|g" \
+ -e "s|%%PREFIX%%|${PREFIX}|g" \
+ -e "s|%%DATADIR%%|${DATADIR}|g" \
+ ${WRKSRC}/bin/smart-proxy \
+ ${WRKSRC}/extra/migrate_settings.rb \
+ ${WRKSRC}/extra/query.rb
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
- ${WRKSRC}/config/settings.yml.example
+ ${WRKSRC}/config/settings.d/*.yml.example \
+ ${WRKSRC}/lib/proxy/http_downloads.rb
do-install:
- @${MKDIR} ${STAGEDIR}${PREFIX}/etc/foreman-proxy
- @${MKDIR} ${STAGEDIR}${DATADIR}
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.d
+ @${MKDIR} ${STAGEDIR}${DATADIR}/extra
@${LN} -s ${PREFIX}/etc/foreman-proxy ${STAGEDIR}${DATADIR}/config
@${INSTALL_SCRIPT} ${WRKSRC}/bin/smart-proxy \
${STAGEDIR}${PREFIX}/sbin/smart-proxy
-.for file in Rakefile config.ru lib public views
+.for file in CHANGELOG Contributors Gemfile LICENSE README Rakefile \
+ VERSION bundler.d config.ru lib modules public views
@${CP} -r ${WRKSRC}/${file} ${STAGEDIR}${DATADIR}
.endfor
+ @${LN} -s Gemfile ${STAGEDIR}${DATADIR}/Gemfile.in
+.for script in migrate_settings.rb query.rb
+ ${INSTALL_SCRIPT} ${WRKSRC}/extra/${script} \
+ ${STAGEDIR}${DATADIR}/extra/${script}
+.endfor
${INSTALL} ${COPY} -m 644 ${WRKSRC}/config/settings.yml.example \
${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.yml.sample
-.if !exists(${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.yml)
- @${INSTALL} ${COPY} -m 644 ${WRKSRC}/config/settings.yml.example \
- ${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.yml
-.endif
+.for cfg in bmc chef dhcp dns puppet puppetca realm tftp
+ ${INSTALL} ${COPY} -m 644 ${WRKSRC}/config/settings.d/${cfg}.yml.example \
+ ${STAGEDIR}${PREFIX}/etc/foreman-proxy/settings.d/${cfg}.yml.sample
+.endfor
post-install:
@${MKDIR} -m 0700 ${STAGEDIR}${FOREMAN_PROXY_LOGDIR} \
diff --git a/net/foreman-proxy/distinfo b/net/foreman-proxy/distinfo
index 305ad7ea742f..890fc991029b 100644
--- a/net/foreman-proxy/distinfo
+++ b/net/foreman-proxy/distinfo
@@ -1,2 +1,2 @@
-SHA256 (foreman-proxy-1.5.1.tar.gz) = d3b5012b4db87c957b1707fdb8c26d539b3d8ff82601b6b688f02d2fd8b5c3ac
-SIZE (foreman-proxy-1.5.1.tar.gz) = 90017
+SHA256 (foreman-proxy-1.6.0.tar.gz) = 0f3fc7da8794afe9c5d86807e064fd1dd8864ef5c16ff893411794cb62dc437f
+SIZE (foreman-proxy-1.6.0.tar.gz) = 106572
diff --git a/net/foreman-proxy/files/patch-bin-smart-proxy b/net/foreman-proxy/files/patch-bin-smart-proxy
new file mode 100644
index 000000000000..d0f879569bad
--- /dev/null
+++ b/net/foreman-proxy/files/patch-bin-smart-proxy
@@ -0,0 +1,10 @@
+--- bin/smart-proxy.orig 2014-09-27 09:46:43.550292207 +0200
++++ bin/smart-proxy 2014-09-27 09:46:48.536355156 +0200
+@@ -1,6 +1,6 @@
+ #!/usr/bin/env ruby
+
+-$LOAD_PATH.unshift *Dir[File.expand_path("../../lib", __FILE__), File.expand_path("../../modules", __FILE__)]
++$LOAD_PATH.unshift *Dir["%%DATADIR%%/lib", "%%DATADIR%%/modules"]
+
+ require 'smart_proxy'
+ Proxy::Launcher.launch
diff --git a/net/foreman-proxy/files/patch-config-settings.d-chef.yml.example b/net/foreman-proxy/files/patch-config-settings.d-chef.yml.example
new file mode 100644
index 000000000000..36cb129b4480
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-chef.yml.example
@@ -0,0 +1,8 @@
+--- config/settings.d/chef.yml.example.orig 2014-09-27 09:04:18.593468858 +0200
++++ config/settings.d/chef.yml.example 2014-09-27 09:04:57.195544853 +0200
+@@ -5,4 +5,4 @@
+ # smart-proxy client node needs to have some admin right on chef-server
+ # in order to retrive all nodes public keys
+ # :chef_smartproxy_clientname: 'host.example.net'
+-# :chef_smartproxy_privatekey: '/etc/chef/client.pem'
++# :chef_smartproxy_privatekey: '%%LOCALBASE%%/etc/chef/client.pem'
diff --git a/net/foreman-proxy/files/patch-config-settings.d-dhcp.yml.example b/net/foreman-proxy/files/patch-config-settings.d-dhcp.yml.example
new file mode 100644
index 000000000000..d6a5c3c952eb
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-dhcp.yml.example
@@ -0,0 +1,20 @@
+--- config/settings.d/dhcp.yml.example.orig 2014-09-27 09:03:57.507470266 +0200
++++ config/settings.d/dhcp.yml.example 2014-09-27 09:06:15.715460654 +0200
+@@ -8,14 +8,8 @@
+ # dhcp_subnets is an ISC & Native MS implementation setting. It restricts the subnets queried to a
+ # subset, so as to reduce the query time.
+ #:dhcp_subnets: [192.168.205.0/255.255.255.128, 192.168.205.128/255.255.255.128]
+-# Settings for Ubuntu ISC
+-#:dhcp_config: /etc/dhcp3/dhcpd.conf
+-#:dhcp_leases: /var/lib/dhcp3/dhcpd.leases
+-# Settings for Redhat ISC
+-# Redhat 5
+-#:dhcp_config: /etc/dhcpd.conf
+-# Redhat 6
+-#:dhcp_config: /etc/dhcp/dhcpd.conf
+-#:dhcp_leases: /var/lib/dhcpd/dhcpd.leases
++# Settings for FreeBSD ISC
++#:dhcp_config: %%LOCALBASE%%/etc/dhcpd.conf
++#:dhcp_leases: /var/db/dhcpd.leases
+ #:dhcp_key_name: secret_key_name
+ #:dhcp_key_secret: secret_key
diff --git a/net/foreman-proxy/files/patch-config-settings.d-dns.yml.example b/net/foreman-proxy/files/patch-config-settings.d-dns.yml.example
new file mode 100644
index 000000000000..3a8d0f8ae6eb
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-dns.yml.example
@@ -0,0 +1,17 @@
+--- config/settings.d/dns.yml.example.orig 2014-09-27 09:03:53.820489863 +0200
++++ config/settings.d/dns.yml.example 2014-09-27 09:06:50.266460447 +0200
+@@ -6,12 +6,12 @@
+ # virsh
+ # dnscmd
+ #:dns_provider: nsupdate
+-#:dns_key: /etc/rndc.key
++#:dns_key: %%LOCALBASE%%/etc/namedb/rndc.key
+ # use this setting if you are managing a dns server which is not localhost though this proxy
+ #:dns_server: dns.domain.com
+ # use this setting if you want to override default TTL setting (86400)
+ #:dns_ttl: 86400
+ # use dns_tsig_* for GSS-TSIG updates using Kerberos. Required for Windows MS DNS with
+ # Secure Dynamic Updates, or BIND as used in FreeIPA. Set dns_provider to nsupdate_gss.
+-#:dns_tsig_keytab: /usr/share/foreman-proxy/dns.keytab
++#:dns_tsig_keytab: %%PREFIX%%/share/foreman-proxy/dns.keytab
+ #:dns_tsig_principal: DNS/host.example.com@EXAMPLE.COM
diff --git a/net/foreman-proxy/files/patch-config-settings.d-puppet.yml.example b/net/foreman-proxy/files/patch-config-settings.d-puppet.yml.example
new file mode 100644
index 000000000000..b4d36256201d
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-puppet.yml.example
@@ -0,0 +1,39 @@
+--- config/settings.d/puppet.yml.example.orig 2014-09-27 09:04:06.613473296 +0200
++++ config/settings.d/puppet.yml.example 2014-09-27 09:13:36.804706968 +0200
+@@ -10,19 +10,19 @@
+
+ # Customrun command details
+ # Set :customrun_cmd to the full path of the script you want to run, instead of /bin/false
+-:customrun_cmd: /bin/false
++:customrun_cmd: /usr/bin/false
+ # Set :customrun_args to any args you want to pass to your custom script. The hostname of the
+ # system to run against will be appended after the custom commands.
+ :customrun_args: -ay -f -s
+
+-:puppet_conf: /etc/puppet/puppet.conf
++:puppet_conf: %%LOCALBASE%%/etc/puppet/puppet.conf
+ # whether to use sudo before the ssh command
+ :puppetssh_sudo: false
+ # the command which will be sent to the host
+-:puppetssh_command: /usr/bin/puppet agent --onetime --no-usecacheonfailure
++:puppetssh_command: %%LOCALBASE%%/bin/puppet agent --onetime --no-usecacheonfailure
+ # With which user should the proxy connect
+ #:puppetssh_user: root
+-#:puppetssh_keyfile: /etc/foreman-proxy/id_rsa
++#:puppetssh_keyfile: %%PREFIX%%/etc/foreman-proxy/id_rsa
+
+ # Which user to invoke sudo as to run puppet commands
+ #:puppet_user: root
+@@ -30,9 +30,9 @@
+ # URL of the puppet master itself for API requests
+ #:puppet_url: https://puppet.example.com:8140
+ # SSL certificates used to access the puppet master API
+-#:puppet_ssl_ca: /var/lib/puppet/ssl/certs/ca.pem
+-#:puppet_ssl_cert: /var/lib/puppet/ssl/certs/puppet.example.com.pem
+-#:puppet_ssl_key: /var/lib/puppet/ssl/private_keys/puppet.example.com.pem
++#:puppet_ssl_ca: /var/puppet/ssl/certs/ca.pem
++#:puppet_ssl_cert: /var/puppet/ssl/certs/puppet.example.com.pem
++#:puppet_ssl_key: /var/puppet/ssl/private_keys/puppet.example.com.pem
+
+ # Override use of Puppet's API to list environments, by default it will use only if
+ # environmentpath is given in puppet.conf, else will look for environments in puppet.conf
diff --git a/net/foreman-proxy/files/patch-config-settings.d-puppetca.yml.example b/net/foreman-proxy/files/patch-config-settings.d-puppetca.yml.example
new file mode 100644
index 000000000000..909dcb619db0
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-puppetca.yml.example
@@ -0,0 +1,12 @@
+--- config/settings.d/puppetca.yml.example.orig 2014-09-27 09:16:47.493418158 +0200
++++ config/settings.d/puppetca.yml.example 2014-09-27 09:16:08.243420797 +0200
+@@ -1,6 +1,6 @@
+ ---
+ :enabled: false
+-#:ssldir: /var/lib/puppet/ssl
+-#:puppetdir: /etc/puppet
++#:ssldir: /var/puppet/ssl
++#:puppetdir: %%LOCALBASE%%/etc/puppet
+ #:puppetca_use_sudo: true
+-#:sudo_command: /usr/bin/sudo
++#:sudo_command: %%LOCALBASE%%/bin/sudo
diff --git a/net/foreman-proxy/files/patch-config-settings.d-realm.yml.example b/net/foreman-proxy/files/patch-config-settings.d-realm.yml.example
new file mode 100644
index 000000000000..42d19374cbdb
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-realm.yml.example
@@ -0,0 +1,11 @@
+--- config/settings.d/realm.yml.example.orig 2014-09-27 09:04:28.342471788 +0200
++++ config/settings.d/realm.yml.example 2014-09-27 09:17:21.098415262 +0200
+@@ -6,7 +6,7 @@
+ #:realm_provider: freeipa
+
+ # Authentication for Kerberos-based Realms
+-:realm_keytab: /etc/foreman-proxy/freeipa.keytab
++:realm_keytab: %%LOCALBASE%%/etc/foreman-proxy/freeipa.keytab
+ :realm_principal: realm-proxy@EXAMPLE.COM
+
+ # FreeIPA specific settings
diff --git a/net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example b/net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example
new file mode 100644
index 000000000000..a7475421a8a2
--- /dev/null
+++ b/net/foreman-proxy/files/patch-config-settings.d-tftp.yml.example
@@ -0,0 +1,9 @@
+--- config/settings.d/tftp.yml.example.orig 2014-09-27 09:03:48.161469593 +0200
++++ config/settings.d/tftp.yml.example 2014-09-27 09:07:14.400462451 +0200
+@@ -1,5 +1,5 @@
+ ---
+ :enabled: false
+-#:tftproot: /var/lib/tftpboot
++#:tftproot: /tftpboot
+ # Defines the TFTP Servername to use, overrides the name in the subnet declaration
+ #:tftp_servername: tftp.domain.com
diff --git a/net/foreman-proxy/files/patch-config-settings.yml.example b/net/foreman-proxy/files/patch-config-settings.yml.example
deleted file mode 100644
index 3d6c700a2caf..000000000000
--- a/net/foreman-proxy/files/patch-config-settings.yml.example
+++ /dev/null
@@ -1,102 +0,0 @@
---- config/settings.yml.example.orig 2014-06-18 10:54:21.000000000 +0200
-+++ config/settings.yml.example 2014-06-19 15:42:56.264085917 +0200
-@@ -23,7 +23,7 @@
-
- # Enable TFTP management
- :tftp: false
--:tftproot: /var/lib/tftpboot
-+:tftproot: /tftpboot
- # Defines the TFTP Servername to use, overrides the name in the subnet declaration
- #:tftp_servername: tftp.domain.com
-
-@@ -35,14 +35,14 @@
- # nsupdate_gss (for GSS-TSIG support)
- # virsh (simple implementation for libvirt)
- :dns_provider: nsupdate
--#:dns_key: /etc/rndc.key
-+#:dns_key: %%LOCALBASE%%/etc/namedb/rndc.key
- # use this setting if you are managing a dns server which is not localhost though this proxy
- #:dns_server: dns.domain.com
- # use this setting if you want to override default TTL setting (86400)
- #:dns_ttl: 86400
- # use dns_tsig_* for GSS-TSIG updates using Kerberos. Required for Windows MS DNS with
- # Secure Dynamic Updates, or BIND as used in FreeIPA. Set dns_provider to nsupdate_gss.
--#:dns_tsig_keytab: /usr/share/foreman-proxy/dns.keytab
-+#:dns_tsig_keytab: %%PREFIX%%/share/foreman-proxy/dns.keytab
- #:dns_tsig_principal: DNS/host.example.com@EXAMPLE.COM
-
- # Enable DHCP management
-@@ -55,15 +55,8 @@
- # dhcp_subnets is an ISC & Native MS implementation setting. It restricts the subnets queried to a
- # subset, so as to reduce the query time.
- #:dhcp_subnets: [192.168.205.0/255.255.255.128, 192.168.205.128/255.255.255.128]
--# Settings for Ubuntu ISC
--#:dhcp_config: /etc/dhcp3/dhcpd.conf
--#:dhcp_leases: /var/lib/dhcp3/dhcpd.leases
--# Settings for Redhat ISC
--# Redhat 5
--#:dhcp_config: /etc/dhcpd.conf
--# Redhat 6
--#:dhcp_config: /etc/dhcp/dhcpd.conf
--#:dhcp_leases: /var/lib/dhcpd/dhcpd.leases
-+#:dhcp_config: %%LOCALBASE%%/etc/dhcpd.conf
-+#:dhcp_leases: /var/db/dhcpd.leases
- #:dhcp_key_name: secret_key_name
- #:dhcp_key_secret: secret_key
-
-@@ -72,10 +65,10 @@
-
- # enable PuppetCA management
- :puppetca: false
--#:ssldir: /var/lib/puppet/ssl
--#:puppetdir: /etc/puppet
-+#:ssldir: /var/puppet/ssl
-+#:puppetdir: %%LOCALBASE%%/etc/puppet
- #:puppetca_use_sudo: true
--#:sudo_command: /usr/bin/sudo
-+#:sudo_command: %%LOCALBASE%%/bin/sudo
-
- # enable Puppet management
- :puppet: false
-@@ -89,19 +82,19 @@
-
- # customrun command details
- # Set :customrun_cmd to the full path of the script you want to run, instead of /bin/false
--:customrun_cmd: /bin/false
-+:customrun_cmd: /usr/bin/false
- # Set :customrun_args to any args you want to pass to your custom script. The hostname of the
- # system to run against will be appended after the custom commands.
- :customrun_args: -ay -f -s
-
--:puppet_conf: /etc/puppet/puppet.conf
-+:puppet_conf: %%LOCALBASE%%/etc/puppet/puppet.conf
- # whether to use sudo before the ssh command
- :puppetssh_sudo: false
- # the command which will be sent to the host
--:puppetssh_command: /usr/bin/puppet agent --onetime --no-usecacheonfailure
-+:puppetssh_command: %%LOCALBASE%%/bin/puppet agent --onetime --no-usecacheonfailure
- # With which user should the proxy connect
- #:puppetssh_user: root
--#:puppetssh_keyfile: /etc/foreman-proxy/id_rsa
-+#:puppetssh_keyfile: %%PREFIX%%/etc/foreman-proxy/id_rsa
-
- # Which user to invoke sudo as to run puppet commands
- #:puppet_user: root
-@@ -113,7 +106,7 @@
- # smart-proxy client node needs to have some admin right on chef-server
- # in order to retrive all nodes public keys
- # :chef_smartproxy_clientname: 'host.example.net'
--# :chef_smartproxy_privatekey: '/etc/chef/client.pem'
-+# :chef_smartproxy_privatekey: '%%LOCALBASE%%/etc/chef/client.pem'
-
- # enable BMC management (Bare metal power and bios controls)
- # Available providers:
-@@ -130,7 +123,7 @@
- :realm_provider: freeipa
-
- # Authentication for Kerberos-based Realms
--:realm_keytab: /etc/foreman-proxy/freeipa.keytab
-+:realm_keytab: %%PREFIX%%/etc/foreman-proxy/freeipa.keytab
- :realm_principal: realm-proxy@EXAMPLE.COM
-
- # FreeIPA specific settings
diff --git a/net/foreman-proxy/files/patch-extra-migrate_settings.rb b/net/foreman-proxy/files/patch-extra-migrate_settings.rb
new file mode 100644
index 000000000000..74b6d55263bd
--- /dev/null
+++ b/net/foreman-proxy/files/patch-extra-migrate_settings.rb
@@ -0,0 +1,11 @@
+--- extra/migrate_settings.rb.orig 2014-09-27 19:07:54.618974064 +0200
++++ extra/migrate_settings.rb 2014-09-27 19:08:28.098972710 +0200
+@@ -96,7 +96,7 @@
+
+ # When running as a script
+ if __FILE__ == $0 then
+- orig_file = ARGV[0] || '/etc/foreman-proxy/settings.yml'
++ orig_file = ARGV[0] || '%%PREFIX%%/etc/foreman-proxy/settings.yml'
+ data = YAML.load_file(orig_file)
+
+ output,unknown = migrate(data.dup)
diff --git a/net/foreman-proxy/files/patch-lib-proxy-http_downloads.rb b/net/foreman-proxy/files/patch-lib-proxy-http_downloads.rb
new file mode 100644
index 000000000000..9a0d20518111
--- /dev/null
+++ b/net/foreman-proxy/files/patch-lib-proxy-http_downloads.rb
@@ -0,0 +1,14 @@
+--- lib/proxy/http_downloads.rb.orig 2014-09-27 09:21:12.321398953 +0200
++++ lib/proxy/http_downloads.rb 2014-09-27 09:21:39.710436545 +0200
+@@ -31,8 +31,8 @@
+ end
+
+ def command(src, dst)
+- wget = which("wget")
++ wget = "%%LOCALBASE%%/bin/wget"
+ "#{wget} --timeout=10 --tries=3 --no-check-certificate -nv -c \"#{escape_for_shell(src.to_s)}\" -O \"#{escape_for_shell(dst.to_s)}\""
+ end
+ end
+-end
+\ No newline at end of file
++end
diff --git a/net/foreman-proxy/files/patch-lib-proxy-tftp.rb b/net/foreman-proxy/files/patch-lib-proxy-tftp.rb
deleted file mode 100644
index eefd532a16c1..000000000000
--- a/net/foreman-proxy/files/patch-lib-proxy-tftp.rb
+++ /dev/null
@@ -1,14 +0,0 @@
---- lib/proxy/tftp.rb.orig 2014-06-18 10:54:21.000000000 +0200
-+++ lib/proxy/tftp.rb 2014-06-19 15:34:09.887122187 +0200
-@@ -107,8 +107,9 @@
- # as the dst might contain another sub directory
- FileUtils.mkdir_p destination.parent
-
-- wget = which("wget")
-- cmd = "#{wget} --timeout=10 --tries=3 --no-check-certificate -nv -c \"#{escape_for_shell(src.to_s)}\" -O \"#{escape_for_shell(destination.to_s)}\""
-+# wget = which("wget")
-+# cmd = "#{wget} --timeout=10 --tries=3 --no-check-certificate -nv -c \"#{escape_for_shell(src.to_s)}\" -O \"#{escape_for_shell(destination.to_s)}\""
-+ cmd = "/usr/bin/fetch --timeout=10 --no-verify-hostname --no-verify-peer -a -m -q -o \"#{escape_for_shell(destination.to_s)}\" \"#{escape_for_shell(src.to_s)}\""
- CommandTask.new(cmd)
- end
- end
diff --git a/net/foreman-proxy/pkg-plist b/net/foreman-proxy/pkg-plist
index 8094f264f3fa..23034275b23e 100644
--- a/net/foreman-proxy/pkg-plist
+++ b/net/foreman-proxy/pkg-plist
@@ -1,72 +1,129 @@
sbin/smart-proxy
@sample etc/foreman-proxy/settings.yml.sample
+@sample etc/foreman-proxy/settings.d/bmc.yml.sample
+@sample etc/foreman-proxy/settings.d/chef.yml.sample
+@sample etc/foreman-proxy/settings.d/dhcp.yml.sample
+@sample etc/foreman-proxy/settings.d/dns.yml.sample
+@sample etc/foreman-proxy/settings.d/puppet.yml.sample
+@sample etc/foreman-proxy/settings.d/puppetca.yml.sample
+@sample etc/foreman-proxy/settings.d/realm.yml.sample
+@sample etc/foreman-proxy/settings.d/tftp.yml.sample
+%%DATADIR%%/CHANGELOG
+%%DATADIR%%/Contributors
+%%DATADIR%%/Gemfile
+%%DATADIR%%/Gemfile.in
+%%DATADIR%%/LICENSE
+%%DATADIR%%/README
%%DATADIR%%/Rakefile
-%%DATADIR%%/config.ru
+%%DATADIR%%/VERSION
+%%DATADIR%%/bundler.d/bmc.rb
+%%DATADIR%%/bundler.d/chef.rb
+%%DATADIR%%/bundler.d/development.rb
+%%DATADIR%%/bundler.d/krb5.rb
+%%DATADIR%%/bundler.d/puppet.rb
+%%DATADIR%%/bundler.d/test.rb
%%DATADIR%%/config
-%%DATADIR%%/lib/bmc_api.rb
+%%DATADIR%%/config.ru
+%%DATADIR%%/extra/migrate_settings.rb
+%%DATADIR%%/extra/query.rb
+%%DATADIR%%/lib/bundler_helper.rb
%%DATADIR%%/lib/checks.rb
-%%DATADIR%%/lib/chefproxy_api.rb
%%DATADIR%%/lib/daemon.rb
-%%DATADIR%%/lib/dhcp_api.rb
-%%DATADIR%%/lib/dns_api.rb
-%%DATADIR%%/lib/facts_api.rb
-%%DATADIR%%/lib/features_api.rb
-%%DATADIR%%/lib/helpers.rb
-%%DATADIR%%/lib/proxy.rb
-%%DATADIR%%/lib/proxy/authentication.rb
-%%DATADIR%%/lib/proxy/bmc.rb
-%%DATADIR%%/lib/proxy/bmc/base.rb
-%%DATADIR%%/lib/proxy/bmc/ipmi.rb
-%%DATADIR%%/lib/proxy/bmc/shell.rb
-%%DATADIR%%/lib/proxy/chefproxy.rb
-%%DATADIR%%/lib/proxy/dhcp.rb
-%%DATADIR%%/lib/proxy/dhcp/monkey_patch_subnet.rb
-%%DATADIR%%/lib/proxy/dhcp/monkey_patches.rb
-%%DATADIR%%/lib/proxy/dhcp/record.rb
-%%DATADIR%%/lib/proxy/dhcp/record/lease.rb
-%%DATADIR%%/lib/proxy/dhcp/record/reservation.rb
-%%DATADIR%%/lib/proxy/dhcp/server.rb
-%%DATADIR%%/lib/proxy/dhcp/server/isc.rb
-%%DATADIR%%/lib/proxy/dhcp/server/ms.rb
-%%DATADIR%%/lib/proxy/dhcp/server/native_ms.rb
-%%DATADIR%%/lib/proxy/dhcp/server/virsh.rb
-%%DATADIR%%/lib/proxy/dhcp/subnet.rb
-%%DATADIR%%/lib/proxy/dns.rb
-%%DATADIR%%/lib/proxy/dns/default_dns_settings.rb
-%%DATADIR%%/lib/proxy/dns/dnscmd.rb
-%%DATADIR%%/lib/proxy/dns/nsupdate.rb
-%%DATADIR%%/lib/proxy/dns/nsupdate_gss.rb
-%%DATADIR%%/lib/proxy/dns/virsh.rb
%%DATADIR%%/lib/proxy/error.rb
+%%DATADIR%%/lib/proxy/helpers.rb
+%%DATADIR%%/lib/proxy/http_downloads.rb
%%DATADIR%%/lib/proxy/kerberos.rb
%%DATADIR%%/lib/proxy/log.rb
-%%DATADIR%%/lib/proxy/puppet.rb
-%%DATADIR%%/lib/proxy/puppet/class_scanner.rb
-%%DATADIR%%/lib/proxy/puppet/class_scanner_eparser.rb
-%%DATADIR%%/lib/proxy/puppet/config_reader.rb
-%%DATADIR%%/lib/proxy/puppet/customrun.rb
-%%DATADIR%%/lib/proxy/puppet/default_puppet_settings.rb
-%%DATADIR%%/lib/proxy/puppet/environment.rb
-%%DATADIR%%/lib/proxy/puppet/initializer.rb
-%%DATADIR%%/lib/proxy/puppet/mcollective.rb
-%%DATADIR%%/lib/proxy/puppet/puppet_class.rb
-%%DATADIR%%/lib/proxy/puppet/puppet_ssh.rb
-%%DATADIR%%/lib/proxy/puppet/puppetrun.rb
-%%DATADIR%%/lib/proxy/puppet/salt.rb
-%%DATADIR%%/lib/proxy/puppetca.rb
-%%DATADIR%%/lib/proxy/realm.rb
-%%DATADIR%%/lib/proxy/realm/freeipa.rb
+%%DATADIR%%/lib/proxy/plugin.rb
+%%DATADIR%%/lib/proxy/request.rb
+%%DATADIR%%/lib/proxy/settings/global.rb
+%%DATADIR%%/lib/proxy/settings/plugin.rb
%%DATADIR%%/lib/proxy/settings.rb
-%%DATADIR%%/lib/proxy/tftp.rb
%%DATADIR%%/lib/proxy/util.rb
%%DATADIR%%/lib/proxy/validations.rb
%%DATADIR%%/lib/proxy/virsh.rb
-%%DATADIR%%/lib/puppet_api.rb
-%%DATADIR%%/lib/puppetca_api.rb
-%%DATADIR%%/lib/realm_api.rb
+%%DATADIR%%/lib/proxy.rb
+%%DATADIR%%/lib/rack-patch.rb
+%%DATADIR%%/lib/sinatra/trusted_hosts.rb
%%DATADIR%%/lib/sinatra-patch.rb
%%DATADIR%%/lib/smart_proxy.rb
-%%DATADIR%%/lib/tftp_api.rb
+%%DATADIR%%/lib/smart_proxy_for_testing.rb
+%%DATADIR%%/modules/bmc/base.rb
+%%DATADIR%%/modules/bmc/bmc.rb
+%%DATADIR%%/modules/bmc/bmc_api.rb
+%%DATADIR%%/modules/bmc/bmc_plugin.rb
+%%DATADIR%%/modules/bmc/http_config.ru
+%%DATADIR%%/modules/bmc/ipmi.rb
+%%DATADIR%%/modules/bmc/shell.rb
+%%DATADIR%%/modules/chef_proxy/authentication.rb
+%%DATADIR%%/modules/chef_proxy/chef.rb
+%%DATADIR%%/modules/chef_proxy/chef_api.rb
+%%DATADIR%%/modules/chef_proxy/chef_plugin.rb
+%%DATADIR%%/modules/chef_proxy/http_config.ru
+%%DATADIR%%/modules/dhcp/dhcp/dhcp_api.rb
+%%DATADIR%%/modules/dhcp/dhcp/dhcp_plugin.rb
+%%DATADIR%%/modules/dhcp/dhcp/http_config.ru
+%%DATADIR%%/modules/dhcp/dhcp/monkey_patch_subnet.rb
+%%DATADIR%%/modules/dhcp/dhcp/monkey_patches.rb
+%%DATADIR%%/modules/dhcp/dhcp/providers/server/isc.rb
+%%DATADIR%%/modules/dhcp/dhcp/providers/server/ms.rb
+%%DATADIR%%/modules/dhcp/dhcp/providers/server/native_ms.rb
+%%DATADIR%%/modules/dhcp/dhcp/providers/server/virsh.rb
+%%DATADIR%%/modules/dhcp/dhcp/record/lease.rb
+%%DATADIR%%/modules/dhcp/dhcp/record/reservation.rb
+%%DATADIR%%/modules/dhcp/dhcp/record.rb
+%%DATADIR%%/modules/dhcp/dhcp/server.rb
+%%DATADIR%%/modules/dhcp/dhcp/subnet.rb
+%%DATADIR%%/modules/dhcp/dhcp.rb
+%%DATADIR%%/modules/dns/dns.rb
+%%DATADIR%%/modules/dns/dns_api.rb
+%%DATADIR%%/modules/dns/dns_plugin.rb
+%%DATADIR%%/modules/dns/http_config.ru
+%%DATADIR%%/modules/dns/providers/dnscmd.rb
+%%DATADIR%%/modules/dns/providers/nsupdate.rb
+%%DATADIR%%/modules/dns/providers/nsupdate_gss.rb
+%%DATADIR%%/modules/dns/providers/virsh.rb
+%%DATADIR%%/modules/facts/facts.rb
+%%DATADIR%%/modules/facts/facts_api.rb
+%%DATADIR%%/modules/facts/facts_plugin.rb
+%%DATADIR%%/modules/facts/http_config.ru
+%%DATADIR%%/modules/puppet_proxy/api_request.rb
+%%DATADIR%%/modules/puppet_proxy/class_scanner.rb
+%%DATADIR%%/modules/puppet_proxy/class_scanner_eparser.rb
+%%DATADIR%%/modules/puppet_proxy/config_reader.rb
+%%DATADIR%%/modules/puppet_proxy/customrun.rb
+%%DATADIR%%/modules/puppet_proxy/environment.rb
+%%DATADIR%%/modules/puppet_proxy/http_config.ru
+%%DATADIR%%/modules/puppet_proxy/initializer.rb
+%%DATADIR%%/modules/puppet_proxy/mcollective.rb
+%%DATADIR%%/modules/puppet_proxy/puppet.rb
+%%DATADIR%%/modules/puppet_proxy/puppet_api.rb
+%%DATADIR%%/modules/puppet_proxy/puppet_class.rb
+%%DATADIR%%/modules/puppet_proxy/puppet_plugin.rb
+%%DATADIR%%/modules/puppet_proxy/puppet_ssh.rb
+%%DATADIR%%/modules/puppet_proxy/puppetrun.rb
+%%DATADIR%%/modules/puppet_proxy/runner.rb
+%%DATADIR%%/modules/puppet_proxy/salt.rb
+%%DATADIR%%/modules/puppetca/http_config.ru
+%%DATADIR%%/modules/puppetca/puppetca.rb
+%%DATADIR%%/modules/puppetca/puppetca_api.rb
+%%DATADIR%%/modules/puppetca/puppetca_main.rb
+%%DATADIR%%/modules/puppetca/puppetca_plugin.rb
+%%DATADIR%%/modules/realm/client.rb
+%%DATADIR%%/modules/realm/freeipa.rb
+%%DATADIR%%/modules/realm/http_config.ru
+%%DATADIR%%/modules/realm/realm.rb
+%%DATADIR%%/modules/realm/realm_api.rb
+%%DATADIR%%/modules/realm/realm_plugin.rb
+%%DATADIR%%/modules/root/http_config.ru
+%%DATADIR%%/modules/root/root.rb
+%%DATADIR%%/modules/root/root_api.rb
+%%DATADIR%%/modules/root/root_plugin.rb
+%%DATADIR%%/modules/tftp/http_config.ru
+%%DATADIR%%/modules/tftp/server.rb
+%%DATADIR%%/modules/tftp/tftp.rb
+%%DATADIR%%/modules/tftp/tftp_api.rb
+%%DATADIR%%/modules/tftp/tftp_plugin.rb
%%DATADIR%%/public/css/styles.css
%%DATADIR%%/views/dhcp/index.erb
%%DATADIR%%/views/dhcp/show.erb
@@ -77,15 +134,25 @@ sbin/smart-proxy
@dirrm %%DATADIR%%/views
@dirrm %%DATADIR%%/public/css
@dirrm %%DATADIR%%/public
-@dirrm %%DATADIR%%/lib/proxy/bmc
-@dirrm %%DATADIR%%/lib/proxy/dhcp/record
-@dirrm %%DATADIR%%/lib/proxy/dhcp/server
-@dirrm %%DATADIR%%/lib/proxy/dhcp
-@dirrm %%DATADIR%%/lib/proxy/dns
-@dirrm %%DATADIR%%/lib/proxy/puppet
-@dirrm %%DATADIR%%/lib/proxy/realm
+@dirrm %%DATADIR%%/modules/tftp
+@dirrm %%DATADIR%%/modules/root
+@dirrm %%DATADIR%%/modules/realm
+@dirrm %%DATADIR%%/modules/puppetca
+@dirrm %%DATADIR%%/modules/puppet_proxy
+@dirrm %%DATADIR%%/modules/facts
+@dirrm %%DATADIR%%/modules/dns/providers
+@dirrm %%DATADIR%%/modules/dhcp/dhcp/record
+@dirrm %%DATADIR%%/modules/dhcp/dhcp/providers
+@dirrm %%DATADIR%%/modules/dhcp/dhcp
+@dirrm %%DATADIR%%/modules/dhcp
+@dirrm %%DATADIR%%/modules/dns
+@dirrm %%DATADIR%%/modules/bmc
+@dirrm %%DATADIR%%/modules/chef_proxy
+@dirrm %%DATADIR%%/modules
@dirrm %%DATADIR%%/lib/proxy
@dirrm %%DATADIR%%/lib
+@dirrm %%DATADIR%%/extra
+@dirrm %%DATADIR%%/bundler.d
@dirrmtry %%DATADIR%%
@dirrmtry etc/foreman-proxy
@cwd /