summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-03-17 12:51:19 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-03-17 12:51:19 +0000
commit0c1fcc1da7884f2638d0ad7ebf81e7cb3998d4f7 (patch)
tree44656bc1c735f29d9b5c5776775bd31ee9c48ddb /sysutils
parent- Update to 2.6.5 (diff)
- Update 2.6.6
PR: 155451 Submitted by: Russell Jackson <raj@csub.edu> (maintainer)
Notes
Notes: svn path=/head/; revision=271091
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/puppet/Makefile11
-rw-r--r--sysutils/puppet/distinfo4
-rw-r--r--sysutils/puppet/files/optpatch-package_origin113
-rw-r--r--sysutils/puppet/files/patch-demote_ports_provider13
-rw-r--r--sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435120
-rw-r--r--sysutils/puppet/pkg-plist3
6 files changed, 138 insertions, 126 deletions
diff --git a/sysutils/puppet/Makefile b/sysutils/puppet/Makefile
index ea1924f11667..a09bb7ffc966 100644
--- a/sysutils/puppet/Makefile
+++ b/sysutils/puppet/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= puppet
-PORTVERSION= 2.6.4
+PORTVERSION= 2.6.6
CATEGORIES= sysutils
MASTER_SITES= http://www.puppetlabs.com/downloads/puppet/
@@ -39,7 +39,8 @@ MAN5= puppet.conf.5
MAN8= filebucket.8 pi.8 puppet.8 puppetca.8 puppetd.8 \
puppetdoc.8 puppetmasterd.8 puppetrun.8 ralsh.8 puppetqd.8
-OPTIONS= MONGREL "Run puppet server as a mongrel service" Off
+OPTIONS= MONGREL "Run puppet server as a mongrel service" Off \
+ PACKAGE_ORIGIN "Use port origin as package name" On
.include <bsd.port.options.mk>
@@ -47,6 +48,10 @@ OPTIONS= MONGREL "Run puppet server as a mongrel service" Off
RUN_DEPENDS+= rubygem-mongrel>=0:${PORTSDIR}/www/rubygem-mongrel
.endif
+.if defined(WITH_PACKAGE_ORIGIN)
+EXTRA_PATCHES+= ${FILESDIR}/optpatch-package_origin
+.endif
+
.include <bsd.port.pre.mk>
post-patch:
@@ -71,6 +76,7 @@ do-install:
post-install:
${INSTALL} -d ${ETCDIR}
+ ${INSTALL} -m 0644 ${WRKSRC}/conf/auth.conf ${ETCDIR}/auth.conf-dist
${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/sbin/puppetmasterd \
--confdir=${ETCDIR} \
--rundir=${PUPPET_RUNDIR} \
@@ -90,7 +96,6 @@ post-install:
.endif
.if !defined(NOPORTEXAMPLES)
cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
- ${INSTALL} ${WRKSRC}/conf/auth.conf ${EXAMPLESDIR}/etc
.endif
@${CAT} ${PKGMESSAGE}
diff --git a/sysutils/puppet/distinfo b/sysutils/puppet/distinfo
index e04f340ed7ba..ed0859f7c100 100644
--- a/sysutils/puppet/distinfo
+++ b/sysutils/puppet/distinfo
@@ -1,2 +1,2 @@
-SHA256 (puppet-2.6.4.tar.gz) = 349f9b320330a3546619d4236fa30dd52af327f17767d9762f6f70465bcdaa1f
-SIZE (puppet-2.6.4.tar.gz) = 1500339
+SHA256 (puppet-2.6.6.tar.gz) = bc613c2764345947268a080ca0595aa6d4dbb0b9eab65d1476ff6542caf1647a
+SIZE (puppet-2.6.6.tar.gz) = 1514638
diff --git a/sysutils/puppet/files/optpatch-package_origin b/sysutils/puppet/files/optpatch-package_origin
new file mode 100644
index 000000000000..f47dc9425d39
--- /dev/null
+++ b/sysutils/puppet/files/optpatch-package_origin
@@ -0,0 +1,113 @@
+diff --git a/lib/puppet/provider/package/freebsd.rb b/lib/puppet/provider/package/freebsd.rb
+index e10a20b..fbda52d 100755
+--- lib/puppet/provider/package/freebsd.rb
++++ lib/puppet/provider/package/freebsd.rb
+@@ -1,36 +1,79 @@
+ 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."
++ include Puppet::Util::Execution
+
+- commands :pkginfo => "/usr/sbin/pkg_info",
+- :pkgadd => "/usr/sbin/pkg_add",
+- :pkgdelete => "/usr/sbin/pkg_delete"
++ 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.instances
++ packages = []
++
++ output = pkginfo "-aoQ"
++ output.split("\n").each do |data|
++ lhs, pkg_origin = data.split(":")
++ pkg_name = lhs.split("-").slice(0..-2).join("-")
++ pkg_version = lhs.split("-")[-1]
++
++ packages << new({
++ :provider => self.name,
++ :name => pkg_origin,
++ :ensure => pkg_version,
++ })
++ end
+
+- def self.listcmd
+- command(:pkginfo)
++ packages
+ end
+
+ def install
+ should = @resource.should(:ensure)
++
++ origin = {}
++ [:category, :name].zip(@resource[:name].split("/")).each { |a,b| origin[a] = b }
++ Puppet.debug "origin => #{origin.inspect}"
++ if origin[:name] == nil
++ raise Puppet::Error.new "package name must be in origin format: <category>/<name>"
++ end
++
++ # source parameter is set
++ if @resource[:source]
++ source = URI.parse(@resource[:source])
++ Puppet.debug "source => #{source.inspect}"
+
+- if @resource[:source] =~ /\/$/
+- if @resource[:source] =~ /^(ftp|https?):/
+- Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
+- pkgadd "-r", @resource[:name]
++ # URI is for local file path.
++ if (source.scheme == "file" || source.scheme == nil) && source.path
++ # Pass pkg_add only the URI path.
++ pkgadd source.path
++
++ # URI scheme is something other than 'file'.
++ elsif source.scheme && source.host && source.path
++ if source.path.end_with?(".tbz") # URI references a package.
++ # Pass pkg_add the entire URI.
++ pkgadd source.to_s
++ else # Assume URI references a directory.
++ # Set PACKAGESITE in execution environment to source URI.
++ # Pass pkg_add the origin name.
++ withenv :PACKAGESITE => source.path.end_with?("/") ? source.to_s : source.to_s << "/" do
++ Puppet.debug "ENV['PACKAGESITE'] => #{ENV['PACKAGESITE']}"
++ pkgadd "-rf", origin[:name]
++ end
+ end
++
++ # URI is not usable by pkg_add
+ else
+- Puppet::Util::Execution::withenv :PKG_PATH => @resource[:source] do
+- pkgadd @resource[:name]
+- end
++ raise Puppet::Error.new "source URI is inappropriate: #{source.inspect}"
+ end
++
++ # source parameter is not set.
+ else
+- Puppet.warning "source is defined but does not have trailing slash, ignoring #{@resource[:source]}" if @resource[:source]
+- pkgadd "-r", @resource[:name]
++ # fetch package using default PACKAGESITE directory logic.
++ # Pass pkg_add the origin name.
++ pkgadd "-rf", origin[:name]
+ end
+ end
+
+@@ -44,7 +87,7 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do
+ 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/puppet/files/patch-demote_ports_provider b/sysutils/puppet/files/patch-demote_ports_provider
new file mode 100644
index 000000000000..6e5245f4c44c
--- /dev/null
+++ b/sysutils/puppet/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/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435 b/sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435
deleted file mode 100644
index 873c78a6b22c..000000000000
--- a/sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435
+++ /dev/null
@@ -1,120 +0,0 @@
-commit 16f841ed5674ef8c0782c1d8d92c5fddc4376435
-Author: Russell Jackson <raj@fbsd.csub.edu>
-Date: Wed Jul 28 18:20:10 2010 -0700
-
- ports provider broken. Removed.
- Use "freebsd" provider by default on FreeBSD.
-
-diff --git a/lib/puppet/provider/package/freebsd.rb b/lib/puppet/provider/package/freebsd.rb
-index 2f012a4..6664223 100755
---- lib/puppet/provider/package/freebsd.rb
-+++ lib/puppet/provider/package/freebsd.rb
-@@ -10,6 +10,7 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do
- :pkgdelete => "/usr/sbin/pkg_delete"
-
- confine :operatingsystem => :freebsd
-+ defaultfor :operatingsystem => :freebsd
-
- def self.listcmd
- command(:pkginfo)
-diff --git a/lib/puppet/provider/package/ports.rb b/lib/puppet/provider/package/ports.rb
-deleted file mode 100755
-index c802092..0000000
---- lib/puppet/provider/package/ports.rb
-+++ /dev/null
-@@ -1,95 +0,0 @@
--Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :freebsd do
-- desc "Support for FreeBSD's ports. Again, this still mixes packages and ports."
--
-- commands :portupgrade => "/usr/local/sbin/portupgrade",
-- :portversion => "/usr/local/sbin/portversion",
-- :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)
-- end
--
-- def install
-- # -N: install if the package is missing, otherwise upgrade
-- # -M: yes, we're a batch, so don't ask any questions
-- cmd = %w{-N -M BATCH=yes} << @resource[:name]
--
-- output = portupgrade(*cmd)
-- if output =~ /\*\* No such /
-- raise Puppet::ExecutionFailure, "Could not find package #{@resource[:name]}"
-- end
-- end
--
-- # If there are multiple packages, we only use the last one
-- def latest
-- cmd = ["-v", @resource[:name]]
--
-- begin
-- output = portversion(*cmd)
-- rescue Puppet::ExecutionFailure
-- raise Puppet::Error.new(output)
-- end
-- line = output.split("\n").pop
--
-- unless line =~ /^(\S+)\s+(\S)\s+(.+)$/
-- # There's no "latest" version, so just return a placeholder
-- return :latest
-- end
--
-- pkgstuff = $1
-- match = $2
-- info = $3
--
-- unless pkgstuff =~ /^(\S+)-([^-\s]+)$/
-- raise Puppet::Error,
-- "Could not match package info '#{pkgstuff}'"
-- end
--
-- name, version = $1, $2
--
-- if match == "=" or match == ">"
-- # we're up to date or more recent
-- return version
-- end
--
-- # Else, we need to be updated; we need to pull out the new version
--
-- unless info =~ /\((\w+) has (.+)\)/
-- raise Puppet::Error,
-- "Could not match version info '#{info}'"
-- end
--
-- source, newversion = $1, $2
--
-- debug "Newer version in #{source}"
-- newversion
-- end
--
-- def query
-- # support portorigin_glob such as "mail/postfix"
-- name = self.name
-- if name =~ /\//
-- name = self.name.split(/\//).slice(1)
-- end
-- self.class.instances.each do |instance|
-- if instance.name == name
-- return instance.properties
-- end
-- end
--
-- nil
-- end
--
-- def uninstall
-- portuninstall @resource[:name]
-- end
--
-- def update
-- install
-- end
--end
--
diff --git a/sysutils/puppet/pkg-plist b/sysutils/puppet/pkg-plist
index 2d2d95fca43b..5fe745387d77 100644
--- a/sysutils/puppet/pkg-plist
+++ b/sysutils/puppet/pkg-plist
@@ -10,4 +10,5 @@ sbin/puppetmasterd
sbin/puppetqd
sbin/puppetrun
%%ETCDIR%%/puppet.conf-dist
-@dirrmtry %%ETCDIR%%
+%%ETCDIR%%/auth.conf-dist
+@dirrmtry etc/puppet