aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/puppet/Makefile13
-rw-r--r--sysutils/puppet/distinfo4
-rw-r--r--sysutils/puppet/files/optpatch-package_origin30
-rw-r--r--sysutils/puppet/files/optpatch-package_root8
-rw-r--r--sysutils/puppet/pkg-plist15
-rw-r--r--sysutils/puppet27/Makefile116
-rw-r--r--sysutils/puppet27/distinfo2
-rw-r--r--sysutils/puppet27/files/optpatch-package_origin200
-rw-r--r--sysutils/puppet27/files/optpatch-package_root11
-rw-r--r--sysutils/puppet27/files/patch-demote_ports_provider13
-rw-r--r--sysutils/puppet27/files/patch-exec.rb17
-rw-r--r--sysutils/puppet27/files/pkg-message.in14
-rw-r--r--sysutils/puppet27/files/puppet.in32
-rw-r--r--sysutils/puppet27/files/puppetmaster.in56
-rw-r--r--sysutils/puppet27/pkg-descr7
-rw-r--r--sysutils/puppet27/pkg-plist19
16 files changed, 518 insertions, 39 deletions
diff --git a/sysutils/puppet/Makefile b/sysutils/puppet/Makefile
index 9a2c032728a2..db97a016db58 100644
--- a/sysutils/puppet/Makefile
+++ b/sysutils/puppet/Makefile
@@ -1,10 +1,8 @@
# Created by: Tomoyuki Sakurai <cherry@trombik.mine.nu>
# $FreeBSD$
-#
PORTNAME= puppet
-PORTVERSION= 2.7.19
-PORTREVISION= 1
+PORTVERSION= 3.0.1
CATEGORIES= sysutils
MASTER_SITES= http://downloads.puppetlabs.com/puppet/
@@ -14,12 +12,12 @@ COMMENT= A configuration management framework written in Ruby
RUN_DEPENDS= facter>=0:${PORTSDIR}/sysutils/facter \
rubygem-ruby-augeas>=0:${PORTSDIR}/textproc/rubygem-augeas
-CONFLICTS= puppet-2.6*
+CONFLICTS= puppet-2* rubygem-hiera-puppet-[0-9]*
NO_BUILD= yes
USE_RUBY= yes
USE_RUBY_FEATURES= iconv
USE_RC_SUBR= puppet puppetmaster
-PORTDOCS= CHANGELOG LICENSE README.md
+PORTDOCS= LICENSE README.md
PORTEXAMPLES= *
USERS= puppet
GROUPS= puppet
@@ -27,7 +25,7 @@ SUB_FILES+= pkg-message
MANCOMPRESSED= yes
MAN5= puppet.conf.5
-MAN8= filebucket.8 pi.8 puppet-agent.8 puppet-apply.8 puppet-ca.8 \
+MAN8= puppet-agent.8 puppet-apply.8 puppet-ca.8 \
puppet-catalog.8 puppet-cert.8 puppet-certificate.8 \
puppet-certificate_request.8 puppet-certificate_revocation_list.8 \
puppet-config.8 puppet-describe.8 puppet-device.8 puppet-doc.8 \
@@ -38,8 +36,7 @@ MAN8= filebucket.8 pi.8 puppet-agent.8 puppet-apply.8 puppet-ca.8 \
puppet-module.8 puppet-node.8 puppet-parser.8 puppet-plugin.8 \
puppet-queue.8 puppet-report.8 puppet-resource.8 \
puppet-resource_type.8 puppet-secret_agent.8 puppet-status.8 \
- puppet.8 puppetca.8 puppetd.8 puppetdoc.8 puppetmasterd.8 \
- puppetqd.8 puppetrun.8 ralsh.8
+ puppet.8
OPTIONS_DEFINE= MONGREL PACKAGE_ORIGIN PACKAGE_ROOT
OPTIONS_DEFAULT= PACKAGE_ORIGIN
diff --git a/sysutils/puppet/distinfo b/sysutils/puppet/distinfo
index f0b40cd63478..70531b4df724 100644
--- a/sysutils/puppet/distinfo
+++ b/sysutils/puppet/distinfo
@@ -1,2 +1,2 @@
-SHA256 (puppet-2.7.19.tar.gz) = 13b103513253ae5af466c8fcf25f36cbc41290f824fa7580041f0700d23a3c3a
-SIZE (puppet-2.7.19.tar.gz) = 1936300
+SHA256 (puppet-3.0.1.tar.gz) = 5e4d0cfdd6989faf4f6c5c76c0d3bcfa0364e380549be1a2f7c3abd22b0b562b
+SIZE (puppet-3.0.1.tar.gz) = 1505102
diff --git a/sysutils/puppet/files/optpatch-package_origin b/sysutils/puppet/files/optpatch-package_origin
index 8e62b395e3fa..971cb41066a3 100644
--- a/sysutils/puppet/files/optpatch-package_origin
+++ b/sysutils/puppet/files/optpatch-package_origin
@@ -1,8 +1,5 @@
-
-$FreeBSD$
-
---- lib/puppet/provider/package/freebsd.rb.orig
-+++ lib/puppet/provider/package/freebsd.rb
+--- lib/puppet/provider/package/freebsd.rb.orig 2012-10-20 00:57:51.000000000 -0400
++++ lib/puppet/provider/package/freebsd.rb 2012-10-21 14:53:41.054105583 -0400
@@ -1,37 +1,163 @@
-Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do
- desc "The specific form of package management on FreeBSD. This is an
@@ -10,13 +7,14 @@ $FreeBSD$
- ports and packages. Apparently all of the tools are written in Ruby,
- so there are plans to rewrite this support to directly use those
- libraries."
-+require 'open-uri'
-+require 'net/ftp'
-+require 'bzip2'
-
+-
- commands :pkginfo => "/usr/sbin/pkg_info",
- :pkgadd => "/usr/sbin/pkg_add",
- :pkgdelete => "/usr/sbin/pkg_delete"
++require 'open-uri'
++require 'net/ftp'
++require 'bzip2'
++
+Puppet::Type.type(:package).provide :freebsd, :parent => Puppet::Provider::Package do
+ include Puppet::Util::Execution
+
@@ -55,11 +53,7 @@ $FreeBSD$
+ :pkg_version => pkg_string.split("-")[-1],
+ }
+ end
-
-- if @resource[:source] =~ /\/$/
-- if @resource[:source] =~ /^(ftp|https?):/
-- Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
-- pkgadd "-r", @resource[:name]
++
+ def self.unparse_pkg_info(pkg_info)
+ [:pkg_name, :pkg_version].map { |key| pkg_info[key] }.join("-")
+ end
@@ -91,7 +85,11 @@ $FreeBSD$
+ end
+ packages
+ end
-+
+
+- if @resource[:source] =~ /\/$/
+- if @resource[:source] =~ /^(ftp|https?):/
+- Puppet::Util.withenv :PACKAGESITE => @resource[:source] do
+- pkgadd "-r", @resource[:name]
+ def ports_index
+ @@lock.synchronize do
+ if @@ports_index.nil?
@@ -112,7 +110,7 @@ $FreeBSD$
+ raise Puppet::Error.new "Could not fetch ports INDEX: #{$!}"
end
- else
-- Puppet::Util::Execution::withenv :PKG_PATH => @resource[:source] do
+- Puppet::Util.withenv :PKG_PATH => @resource[:source] do
- pkgadd @resource[:name]
+ end
+ end
diff --git a/sysutils/puppet/files/optpatch-package_root b/sysutils/puppet/files/optpatch-package_root
index cbab8d58cf9d..489ab5d0b5ed 100644
--- a/sysutils/puppet/files/optpatch-package_root
+++ b/sysutils/puppet/files/optpatch-package_root
@@ -1,11 +1,11 @@
---- lib/puppet/provider/package/freebsd.rb-orig 2011-04-21 19:36:17.000000000 -0500
-+++ lib/puppet/provider/package/freebsd.rb 2011-04-21 20:09:50.000000000 -0500
+--- lib/puppet/provider/package/freebsd.rb.orig 2012-10-21 14:45:57.110106541 -0400
++++ lib/puppet/provider/package/freebsd.rb 2012-10-21 14:47:41.281104749 -0400
@@ -20,7 +20,7 @@
if @resource[:source] =~ /\/$/
if @resource[:source] =~ /^(ftp|https?):/
-- Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
-+ Puppet::Util::Execution::withenv :PACKAGEROOT => @resource[:source] do
+- Puppet::Util.withenv :PACKAGESITE => @resource[:source] do
++ Puppet::Util.withenv :PACKAGEROOT => @resource[:source] do
pkgadd "-r", @resource[:name]
end
else
diff --git a/sysutils/puppet/pkg-plist b/sysutils/puppet/pkg-plist
index ca143352c836..ae04afb3cb73 100644
--- a/sysutils/puppet/pkg-plist
+++ b/sysutils/puppet/pkg-plist
@@ -1,13 +1,8 @@
-bin/filebucket
-bin/pi
+bin/extlookup2hiera
bin/puppet
-bin/puppetdoc
-bin/ralsh
-sbin/puppetca
-sbin/puppetd
-sbin/puppetmasterd
-sbin/puppetqd
-sbin/puppetrun
+%%RUBY_SITELIBDIR%%/hiera/backend/puppet_backend.rb
+%%RUBY_SITELIBDIR%%/hiera/scope.rb
+%%RUBY_SITELIBDIR%%/hiera_puppet.rb
%%ETCDIR%%/puppet.conf-dist
%%ETCDIR%%/auth.conf-dist
@dirrmtry etc/puppet
@@ -17,3 +12,5 @@ sbin/puppetrun
@exec /usr/sbin/chown -Rh puppet:puppet /var/run/puppet
@exec /bin/mkdir -p /var/puppet
@exec /usr/sbin/chown -Rh puppet:puppet /var/puppet
+@dirrm %%RUBY_SITELIBDIR%%/hiera/backend
+@dirrm %%RUBY_SITELIBDIR%%/hiera
diff --git a/sysutils/puppet27/Makefile b/sysutils/puppet27/Makefile
new file mode 100644
index 000000000000..2b435edb0e82
--- /dev/null
+++ b/sysutils/puppet27/Makefile
@@ -0,0 +1,116 @@
+# Created by: Tomoyuki Sakurai <cherry@trombik.mine.nu>
+# $FreeBSD$
+
+PORTNAME= puppet
+PORTVERSION= 2.7.19
+PORTREVISION= 1
+CATEGORIES= sysutils
+MASTER_SITES= http://downloads.puppetlabs.com/puppet/
+
+MAINTAINER= swills@FreeBSD.org
+COMMENT= A configuration management framework written in Ruby
+
+RUN_DEPENDS= facter>=0:${PORTSDIR}/sysutils/facter \
+ rubygem-ruby-augeas>=0:${PORTSDIR}/textproc/rubygem-augeas
+
+LATEST_LINK= puppet27
+CONFLICTS= puppet-2.6* puppet-3*
+NO_BUILD= yes
+USE_RUBY= yes
+USE_RUBY_FEATURES= iconv
+USE_RC_SUBR= puppet puppetmaster
+PORTDOCS= CHANGELOG LICENSE README.md
+PORTEXAMPLES= *
+USERS= puppet
+GROUPS= puppet
+SUB_FILES+= pkg-message
+
+MANCOMPRESSED= yes
+MAN5= puppet.conf.5
+MAN8= filebucket.8 pi.8 puppet-agent.8 puppet-apply.8 puppet-ca.8 \
+ puppet-catalog.8 puppet-cert.8 puppet-certificate.8 \
+ puppet-certificate_request.8 puppet-certificate_revocation_list.8 \
+ puppet-config.8 puppet-describe.8 puppet-device.8 puppet-doc.8 \
+ puppet-facts.8 puppet-file.8 puppet-filebucket.8 puppet-help.8 \
+ puppet-inspect.8 puppet-instrumentation_data.8 \
+ puppet-instrumentation_listener.8 puppet-instrumentation_probe.8 \
+ puppet-key.8 puppet-kick.8 puppet-man.8 puppet-master.8 \
+ puppet-module.8 puppet-node.8 puppet-parser.8 puppet-plugin.8 \
+ puppet-queue.8 puppet-report.8 puppet-resource.8 \
+ puppet-resource_type.8 puppet-secret_agent.8 puppet-status.8 \
+ puppet.8 puppetca.8 puppetd.8 puppetdoc.8 puppetmasterd.8 \
+ puppetqd.8 puppetrun.8 ralsh.8
+
+OPTIONS_DEFINE= MONGREL PACKAGE_ORIGIN PACKAGE_ROOT
+OPTIONS_DEFAULT= PACKAGE_ORIGIN
+MONGREL_DESC= Run puppet server as a mongrel service
+PACKAGE_ORIGIN_DESC= Use port origin as package name
+PACKAGE_ROOT_DESC= Use PACKAGEROOT insted of PACKAGESITE
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MMONGREL}
+RUN_DEPENDS+= rubygem-mongrel>=0:${PORTSDIR}/www/rubygem-mongrel
+.endif
+
+.if ${PORT_OPTIONS:MPACKAGE_ORIGIN}
+EXTRA_PATCHES+= ${FILESDIR}/optpatch-package_origin
+RUN_DEPENDS+= rubygem-bzip2>=0:${PORTSDIR}/archivers/rubygem-bzip2
+.endif
+
+.if ${PORT_OPTIONS:MPACKAGE_ROOT}
+.if ! ${PORT_OPTIONS:MPACKAGE_ORIGIN}
+EXTRA_PATCHES+= ${FILESDIR}/optpatch-package_root
+.else
+BROKEN= PACKAGE_ROOT option patch is incompatable with PACKAGE_ORIGIN patch.
+.endif
+.endif
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+ @${REINPLACE_CMD} -e "s|/etc/puppet|${ETCDIR}|" \
+ ${WRKSRC}/install.rb \
+ ${WRKSRC}/lib/puppet/reference/configuration.rb \
+ ${WRKSRC}/lib/puppet/defaults.rb \
+ ${WRKSRC}/lib/puppet/util/run_mode.rb
+ @${REINPLACE_CMD} -e "s|/var/lib/puppet|/var/puppet|" \
+ ${WRKSRC}/lib/puppet/reference/configuration.rb \
+ ${WRKSRC}/lib/puppet/util/run_mode.rb
+ @${REINPLACE_CMD} -e "s|\$$vardir/run|/var/run/puppet|" \
+ ${WRKSRC}/lib/puppet/util/run_mode.rb
+ @${REINPLACE_CMD} -e "s|\$$confdir/ssl|/var/puppet/ssl|" \
+ ${WRKSRC}/lib/puppet/defaults.rb
+
+do-install:
+ @cd ${WRKSRC} && ${SETENV} PREFIX=${PREFIX} ${RUBY} ${WRKSRC}/install.rb --no-configs
+
+post-install:
+ ${INSTALL} -d ${ETCDIR}
+ ${INSTALL} -m 0755 -o puppet -g puppet -d /var/puppet
+ ${INSTALL} -m 0755 -o puppet -g puppet -d /var/run/puppet
+ ${INSTALL} -m 0644 ${WRKSRC}/conf/auth.conf ${ETCDIR}/auth.conf-dist
+ ${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/bin/puppet --genconfig \
+ --confdir=${ETCDIR} \
+ --rundir=/var/run/puppet | \
+ ${SED} -e 's/genconfig = true/# genconfig = false/' | \
+ ${SED} -e 's/factdest =/# factdest =/' \
+ > ${ETCDIR}/puppet.conf-dist
+ @${ECHO} ${RUBY_SITELIBDIR}/puppet.rb | \
+ ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
+ @${ECHO} ${RUBY_SITELIBDIR}/semver.rb | \
+ ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
+ @${FIND} ${RUBY_SITELIBDIR}/${PORTNAME} -type f | \
+ ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
+ @${FIND} ${RUBY_SITELIBDIR}/${PORTNAME} -type d | ${SORT} -r | \
+ ${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
+.if ${PORT_OPTIONS:MDOCS}
+ ${INSTALL} -d ${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
+.endif
+.if ${PORT_OPTIONS:MEXAMPLES}
+ cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/puppet27/distinfo b/sysutils/puppet27/distinfo
new file mode 100644
index 000000000000..f0b40cd63478
--- /dev/null
+++ b/sysutils/puppet27/distinfo
@@ -0,0 +1,2 @@
+SHA256 (puppet-2.7.19.tar.gz) = 13b103513253ae5af466c8fcf25f36cbc41290f824fa7580041f0700d23a3c3a
+SIZE (puppet-2.7.19.tar.gz) = 1936300
diff --git a/sysutils/puppet27/files/optpatch-package_origin b/sysutils/puppet27/files/optpatch-package_origin
new file mode 100644
index 000000000000..8e62b395e3fa
--- /dev/null
+++ b/sysutils/puppet27/files/optpatch-package_origin
@@ -0,0 +1,200 @@
+
+$FreeBSD$
+
+--- lib/puppet/provider/package/freebsd.rb.orig
++++ lib/puppet/provider/package/freebsd.rb
+@@ -1,37 +1,163 @@
+-Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do
+- desc "The specific form of package management on FreeBSD. This is an
+- extremely quirky packaging system, in that it freely mixes between
+- ports and packages. Apparently all of the tools are written in Ruby,
+- so there are plans to rewrite this support to directly use those
+- libraries."
++require 'open-uri'
++require 'net/ftp'
++require 'bzip2'
+
+- commands :pkginfo => "/usr/sbin/pkg_info",
+- :pkgadd => "/usr/sbin/pkg_add",
+- :pkgdelete => "/usr/sbin/pkg_delete"
++Puppet::Type.type(:package).provide :freebsd, :parent => Puppet::Provider::Package do
++ include Puppet::Util::Execution
++
++ desc "The specific form of package management on FreeBSD. Resource names must be
++ specified as the port origin: <port_category>/<port_name>."
++
++ commands :pkginfo => "/usr/sbin/pkg_info",
++ :pkgadd => "/usr/sbin/pkg_add",
++ :pkgdelete => "/usr/sbin/pkg_delete"
+
+ confine :operatingsystem => :freebsd
++ defaultfor :operatingsystem => :freebsd
+
+- def self.listcmd
+- command(:pkginfo)
++ @@lock = Mutex.new
++ @@ports_index = nil
++
++ # fix bug in URI::FTP merge method that tries to set typecode
++ # even when other is a string.
++ class URI::FTP
++ def merge(other)
++ tmp = super(other)
++ if self != tmp
++ tmp.set_typecode(other.typecode) rescue NoMethodError
++ end
++ return tmp
++ end
+ end
+
+- def install
+- should = @resource.should(:ensure)
++ def self.parse_pkg_string(pkg_string)
++ {
++ :pkg_name => pkg_string.split("-").slice(0..-2).join("-"),
++ :pkg_version => pkg_string.split("-")[-1],
++ }
++ end
+
+- if @resource[:source] =~ /\/$/
+- if @resource[:source] =~ /^(ftp|https?):/
+- Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
+- pkgadd "-r", @resource[:name]
++ def self.unparse_pkg_info(pkg_info)
++ [:pkg_name, :pkg_version].map { |key| pkg_info[key] }.join("-")
++ end
++
++ def self.parse_origin(origin_path)
++ begin
++ origin = {
++ :port_category => origin_path.split("/").fetch(-2),
++ :port_name => origin_path.split("/").fetch(-1),
++ }
++ rescue IndexError
++ raise Puppet::Error.new "#{origin_path}: not in required origin format: .*/<port_category>/<port_name>"
++ end
++ origin
++ end
++
++ def self.instances
++ packages = []
++ output = pkginfo "-aoQ"
++ output.split("\n").each do |data|
++ pkg_string, pkg_origin = data.split(":")
++ pkg_info = self.parse_pkg_string(pkg_string)
++
++ packages << new({
++ :provider => self.name,
++ :name => pkg_origin,
++ :ensure => pkg_info[:pkg_version],
++ })
++ end
++ packages
++ end
++
++ def ports_index
++ @@lock.synchronize do
++ if @@ports_index.nil?
++ @@ports_index = {}
++ uri = source.merge "INDEX.bz2"
++ Puppet.debug "Fetching INDEX: #{uri.inspect}"
++ begin
++ Bzip2::Reader.open(uri) do |f|
++ while (line = f.gets)
++ fields = line.split("|")
++ pkg_info = self.class.parse_pkg_string(fields[0])
++ origin = self.class.parse_origin(fields[1])
++ @@ports_index[origin] = pkg_info
++ end
++ end
++ rescue IOError, OpenURI::HTTPError, Net::FTPError
++ @@ports_index = nil
++ raise Puppet::Error.new "Could not fetch ports INDEX: #{$!}"
+ end
+- else
+- Puppet::Util::Execution::withenv :PKG_PATH => @resource[:source] do
+- pkgadd @resource[:name]
++ end
++ end
++ @@ports_index
++ end
++
++ def uri_path
++ Facter.loadfacts
++ File.join(
++ "/", "pub", "FreeBSD", "ports",
++ Facter.value(:hardwareisa),
++ [
++ "packages",
++ Facter.value(:kernelmajversion).split(".")[0],
++ "stable",
++ ].join("-")
++ ) << "/"
++ end
++
++ def source
++ if !defined? @source
++ if @resource[:source]
++ @source = URI.parse(@resource[:source])
++ if @source.path.empty?
++ @source.merge! uri_path
+ end
++ else # source parameter not set; build default source URI
++ @source = URI::FTP.build({
++ :host => "ftp.freebsd.org",
++ :path => uri_path,
++ })
+ end
++ Puppet.debug "Package: #{@resource[:name]}: source => #{@source.inspect}"
++ end
++ @source
++ end
++
++ def origin
++ if !defined? @origin
++ @origin = self.class.parse_origin(@resource[:name])
++ Puppet.debug "Package: #{@resource[:name]}: origin => #{@origin.inspect}"
++ end
++ @origin
++ end
++
++ def package_uri
++ begin
++ pkg_name = self.class.unparse_pkg_info(ports_index.fetch(origin))
++ rescue IndexError
++ raise Puppet::Error.new "package not found in INDEX"
++ end
++ uri = source.merge File.join("All", pkg_name + ".tbz")
++ Puppet.debug "Package: #{@resource[:name]}: package_uri => #{uri.inspect}"
++ uri
++ end
++
++ def install
++ should = @resource.should(:ensure)
++ origin # call origin so we check the package name for correctness early
++
++ # Source URI is for local file path.
++ if !source.absolute? or source.scheme == "file"
++ pkgadd source.path
++ # Source URI is to specific package file
++ elsif source.absolute? && source.path.end_with?(".tbz")
++ pkgadd source.to_s
++ # Source URI is to a package repository
+ else
+- Puppet.warning "source is defined but does not have trailing slash, ignoring #{@resource[:source]}" if @resource[:source]
+- pkgadd "-r", @resource[:name]
++ pkgadd "-f", package_uri.to_s
+ end
++ nil
+ end
+
+ def query
+@@ -44,6 +170,7 @@
+ end
+
+ def uninstall
+- pkgdelete "#{@resource[:name]}-#{@resource.should(:ensure)}"
++ output = pkginfo "-qO", @resource[:name]
++ output.split("\n").each { |pkg_name| pkgdelete([pkg_name]) }
+ end
+ end
diff --git a/sysutils/puppet27/files/optpatch-package_root b/sysutils/puppet27/files/optpatch-package_root
new file mode 100644
index 000000000000..cbab8d58cf9d
--- /dev/null
+++ b/sysutils/puppet27/files/optpatch-package_root
@@ -0,0 +1,11 @@
+--- lib/puppet/provider/package/freebsd.rb-orig 2011-04-21 19:36:17.000000000 -0500
++++ lib/puppet/provider/package/freebsd.rb 2011-04-21 20:09:50.000000000 -0500
+@@ -20,7 +20,7 @@
+
+ if @resource[:source] =~ /\/$/
+ if @resource[:source] =~ /^(ftp|https?):/
+- Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
++ Puppet::Util::Execution::withenv :PACKAGEROOT => @resource[:source] do
+ pkgadd "-r", @resource[:name]
+ end
+ else
diff --git a/sysutils/puppet27/files/patch-demote_ports_provider b/sysutils/puppet27/files/patch-demote_ports_provider
new file mode 100644
index 000000000000..6e5245f4c44c
--- /dev/null
+++ b/sysutils/puppet27/files/patch-demote_ports_provider
@@ -0,0 +1,13 @@
+diff --git a/lib/puppet/provider/package/ports.rb b/lib/puppet/provider/package/ports.rb
+index c802092..1f2ed43 100755
+--- lib/puppet/provider/package/ports.rb
++++ lib/puppet/provider/package/ports.rb
+@@ -6,8 +6,6 @@ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :fre
+ :portuninstall => "/usr/local/sbin/pkg_deinstall",
+ :portinfo => "/usr/sbin/pkg_info"
+
+- defaultfor :operatingsystem => :freebsd
+-
+ # I hate ports
+ %w{INTERACTIVE UNAME}.each do |var|
+ ENV.delete(var) if ENV.include?(var)
diff --git a/sysutils/puppet27/files/patch-exec.rb b/sysutils/puppet27/files/patch-exec.rb
new file mode 100644
index 000000000000..ff9d28983d96
--- /dev/null
+++ b/sysutils/puppet27/files/patch-exec.rb
@@ -0,0 +1,17 @@
+--- lib/puppet/provider/exec.rb.orig 2012-08-21 17:41:17.000000000 -0400
++++ lib/puppet/provider/exec.rb 2012-08-30 12:31:32.000000000 -0400
+@@ -66,11 +66,9 @@
+ end
+
+ def extractexe(command)
+- if command.is_a? Array
+- command.first
+- elsif match = /^"([^"]+)"|^'([^']+)'/.match(command)
+- # extract whichever of the two sides matched the content.
+- match[1] or match[2]
++ # easy case: command was quoted
++ if command =~ /^"([^"]+)"/
++ $1
+ else
+ command.split(/ /)[0]
+ end
diff --git a/sysutils/puppet27/files/pkg-message.in b/sysutils/puppet27/files/pkg-message.in
new file mode 100644
index 000000000000..d036be0a93e0
--- /dev/null
+++ b/sysutils/puppet27/files/pkg-message.in
@@ -0,0 +1,14 @@
+
+To enable the puppet agent, add the following to /etc/rc.conf:
+
+ puppet_enable="YES"
+
+To enable the puppetmaster, add the following to /etc/rc.conf:
+
+ puppetmaster_enable="YES"
+
+Individual config files such as %%PREFIX%%/etc/puppetmasterd.conf are
+deprecated. Use a single file, %%ETCDIR%%/puppet.conf.
+
+The default PID directory is /var/run/puppet
+
diff --git a/sysutils/puppet27/files/puppet.in b/sysutils/puppet27/files/puppet.in
new file mode 100644
index 000000000000..d98c9d5d64f3
--- /dev/null
+++ b/sysutils/puppet27/files/puppet.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: puppet
+# REQUIRE: NETWORK
+
+#
+# Add the following lines to /etc/rc.conf to enable the puppet agent:
+#
+# puppet_enable="YES"
+
+. /etc/rc.subr
+
+name="puppet"
+rcvar=puppet_enable
+
+load_rc_config "$name"
+
+: ${puppet_enable="NO"}
+: ${puppet_rundir="/var/run/puppet"}
+: ${puppet_flags="--rundir=${puppet_rundir}"}
+
+command_interpreter="%%PREFIX%%/bin/ruby18"
+command="%%PREFIX%%/bin/puppet"
+command_args="agent ${puppet_flags}"
+unset puppet_flags
+
+pidfile="${puppet_rundir}/agent.pid"
+
+run_rc_command "$1"
diff --git a/sysutils/puppet27/files/puppetmaster.in b/sysutils/puppet27/files/puppetmaster.in
new file mode 100644
index 000000000000..fe38db24fde6
--- /dev/null
+++ b/sysutils/puppet27/files/puppetmaster.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: puppetmaster
+# REQUIRE: NETWORK
+
+# Add the following lines to /etc/rc.conf to enable the puppetmaster:
+#
+# puppetmaster_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="puppetmaster"
+rcvar=puppetmaster_enable
+
+load_rc_config "${name}"
+
+: ${puppetmaster_enable="NO"}
+: ${puppetmaster_rundir="/var/run/puppet"}
+: ${puppetmaster_flags="--rundir=${puppetmaster_rundir}"}
+
+command_interpreter="%%PREFIX%%/bin/ruby18"
+command="%%PREFIX%%/bin/puppet"
+command_args="master ${puppetmaster_flags}"
+unset puppetmaster_flags
+
+pidfile="${puppetmaster_rundir}/master.pid"
+puppet_manifestdir="$($command config print manifestdir)"
+
+start_precmd="puppetmaster_checkconfig"
+restart_precmd="puppetmaster_checkconfig"
+puppetmaster_checkconfig() {
+ echo -n "Performing sanity check of ${name} configuration: "
+ if ! ${command} parser validate "${puppet_manifestdir}/site.pp"
+ then
+ echo "FAILED"
+ return 1
+ else
+ echo "OK"
+ return 0
+ fi
+}
+
+if [ -z "${puppetmaster_mongrel_ports}" ]; then
+ run_rc_command "$1"
+else
+ for port in ${puppetmaster_mongrel_ports}; do
+ pidfile="${puppetmaster_rundir}/mongrel.${port}.pid"
+ command_args="master --pidfile=${pidfile} --servertype=mongrel --masterport=${port}"
+ run_rc_command "$1"
+ _rc_restart_done="false"
+ done
+fi
diff --git a/sysutils/puppet27/pkg-descr b/sysutils/puppet27/pkg-descr
new file mode 100644
index 000000000000..a29c19f53ba8
--- /dev/null
+++ b/sysutils/puppet27/pkg-descr
@@ -0,0 +1,7 @@
+Puppet lets you centrally manage every important aspect of your system using
+a cross-platform specification language that manages all the separate
+elements normally aggregated in different files, like users, cron jobs, and
+hosts, along with obviously discrete elements like packages, services, and
+files.
+
+WWW: http://www.puppetlabs.com
diff --git a/sysutils/puppet27/pkg-plist b/sysutils/puppet27/pkg-plist
new file mode 100644
index 000000000000..ca143352c836
--- /dev/null
+++ b/sysutils/puppet27/pkg-plist
@@ -0,0 +1,19 @@
+bin/filebucket
+bin/pi
+bin/puppet
+bin/puppetdoc
+bin/ralsh
+sbin/puppetca
+sbin/puppetd
+sbin/puppetmasterd
+sbin/puppetqd
+sbin/puppetrun
+%%ETCDIR%%/puppet.conf-dist
+%%ETCDIR%%/auth.conf-dist
+@dirrmtry etc/puppet
+@unexec rmdir /var/puppet 2>/dev/null || true
+@unexec rmdir /var/run/puppet 2>/dev/null || true
+@exec /bin/mkdir -p /var/run/puppet
+@exec /usr/sbin/chown -Rh puppet:puppet /var/run/puppet
+@exec /bin/mkdir -p /var/puppet
+@exec /usr/sbin/chown -Rh puppet:puppet /var/puppet