- Update to 2.6.1rc1

PR:		ports/149213
Submitted by:	Russell Jackson <raj AT csub.edu> (maintainer)
This commit is contained in:
Li-Wen Hsu 2010-08-04 17:06:24 +00:00
parent 333392cf29
commit 43e71a5c00
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=258784
13 changed files with 279 additions and 110 deletions

View file

@ -6,44 +6,60 @@
#
PORTNAME= puppet
PORTVERSION= 0.25.4
DISTVERSION= 2.6.1rc1
CATEGORIES= sysutils
MASTER_SITES= http://www.puppetlabs.com/downloads/${PORTNAME}/
MASTER_SITES= http://www.puppetlabs.com/downloads/puppet/
MAINTAINER= raj@csub.edu
COMMENT= A configuration management framework written in Ruby
BUILD_DEPENDS= ${RUBY_SITELIBDIR}/facter.rb:${PORTSDIR}/sysutils/facter \
portupgrade>0:${PORTSDIR}/ports-mgmt/portupgrade
RUN_DEPENDS= ${BUILD_DEPENDS}
RUN_DEPENDS= ${RUBY_SITELIBDIR}/facter.rb:${PORTSDIR}/sysutils/facter \
rubygem-ruby-augeas>=0:${PORTSDIR}/textproc/rubygem-augeas \
ruby18-iconv>=0:${PORTSDIR}/converters/ruby-iconv
CONFLICTS= puppet-devel-[0-9]*
NO_BUILD= yes
USE_RUBY= yes
USE_RC_SUBR= puppetmasterd puppetd
USE_RC_SUBR= puppet puppetmaster
PORTDOCS= CHANGELOG README LICENSE COPYING
PORTEXAMPLES= *
PUPPET_USER:= puppet
PUPPET_GROUP:= ${PUPPET_USER}
PUPPET_VARDIR:= /var/${PORTNAME}
PUPPET_RUNDIR:= /var/run/${PORTNAME}
PUPPET_WORKDIR:= /var/${PORTNAME}
SUB_FILES+= pkg-install pkg-message pkg-deinstall
SUB_LIST+= PUPPET_RUNDIR="${PUPPET_RUNDIR}" \
PUPPET_USER="${PUPPET_USER}" \
SUB_LIST+= PUPPET_USER="${PUPPET_USER}" \
PUPPET_GROUP="${PUPPET_GROUP}" \
PUPPET_WORKDIR="${PUPPET_WORKDIR}"
PUPPET_VARDIR="${PUPPET_VARDIR}" \
PUPPET_RUNDIR="${PUPPET_RUNDIR}"
MANCOMPRESSED= yes
MAN8= filebucket.8 pi.8 puppet.8 puppet.conf.8 puppetca.8 puppetd.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
.include <bsd.port.options.mk>
.if defined(WITH_MONGREL)
RUN_DEPENDS+= rubygem-mongrel>=0:${PORTSDIR}/www/rubygem-mongrel
.endif
.include <bsd.port.pre.mk>
post-patch:
@${REINPLACE_CMD} -e "s|/etc/puppet|${PREFIX}/etc/puppet|" \
${WRKSRC}/lib/puppet/reference/configuration.rb
@${REINPLACE_CMD} -e "s|/etc/puppet|${PREFIX}/etc/puppet|" \
${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|${PUPPET_VARDIR}|" \
${WRKSRC}/lib/puppet/reference/configuration.rb \
${WRKSRC}/lib/puppet/util/run_mode.rb
@${REINPLACE_CMD} -e "s|\$$vardir/run|${PUPPET_RUNDIR}|" \
${WRKSRC}/lib/puppet/util/run_mode.rb
@${REINPLACE_CMD} -e "s|\$$confdir/ssl|${PUPPET_VARDIR}/ssl|" \
${WRKSRC}/lib/puppet/defaults.rb
pre-install:
@ -54,10 +70,7 @@ do-install:
post-install:
${INSTALL} -d ${PREFIX}/etc/${PORTNAME}
.for DIR in ssl manifests
${INSTALL} -d ${PREFIX}/etc/${PORTNAME}/${DIR}
.endfor
${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/bin/puppetmasterd \
${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/sbin/puppetmasterd \
--confdir=${PREFIX}/etc/${PORTNAME} \
--rundir=${PUPPET_RUNDIR} \
--genconfig | \

View file

@ -1,3 +1,3 @@
MD5 (puppet-0.25.4.tar.gz) = 69c97019fda5620f9f45f6ad64407e3b
SHA256 (puppet-0.25.4.tar.gz) = c2dd640a31d1e57ad09929001f90247cd83908485f1f737abca352eb1866fbf3
SIZE (puppet-0.25.4.tar.gz) = 1424240
MD5 (puppet-2.6.1rc1.tar.gz) = 487a0f04afc0117b245214db421e6f0e
SHA256 (puppet-2.6.1rc1.tar.gz) = b523259ffd51bb0c4c4db96276befd6b889f83daa0472bc0c1e73bf3e788a5cb
SIZE (puppet-2.6.1rc1.tar.gz) = 1490327

View file

@ -0,0 +1,120 @@
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
-

View file

@ -0,0 +1,19 @@
--- lib/puppet/provider/service/freebsd.rb.orig 2010-07-29 06:51:38.000000000 +0000
+++ lib/puppet/provider/service/freebsd.rb 2010-07-29 06:50:46.000000000 +0000
@@ -18,6 +18,7 @@
def rcvar
rcvar = execute([self.initscript, :rcvar], :failonfail => true, :squelch => false)
rcvar = rcvar.split("\n")
+ rcvar.delete_if {|str| str !~ /^(#\s\S+|\w+enable=.*)$/ }
end
# Extract service name
@@ -44,7 +45,7 @@
def rcvar_value
value = self.rcvar[1]
self.error("No rcvar value found in rcvar") if value.nil?
- value = value.gsub!(/(.*)_enable=\"?(.*)\"?/, '\2')
+ value = value.gsub!(/(.*)_enable=\"?(\w+)\"?/, '\2')
self.error("rcvar value is empty") if value.nil?
self.debug("rcvar value is #{value}")
value

View file

@ -1,14 +1,14 @@
#!/bin/sh
# $FreeBSD:
# $FreeBSD$
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
RUNDIR=%%PUPPET_RUNDIR%%
WORKDIR=%%PUPPET_WORKDIR%%
VARDIR=%%PUPPET_VARDIR%%
if [ "$2" = "POST-DEINSTALL" ]; then
echo "=> Deleting ${RUNDIR} if empty..."
rm -d ${RUNDIR} 2>/dev/null || true
echo "=> Deleting ${WORKDIR} if empty..."
rm -d ${WORKDIR} 2>/dev/null || true
echo "=> Deleting ${VARDIR} if empty..."
rm -d ${VARDIR} 2>/dev/null || true
fi

View file

@ -8,7 +8,7 @@ UID=814
GID=$UID
RUNDIR=%%PUPPET_RUNDIR%%
WORKDIR=%%PUPPET_WORKDIR%%
VARDIR=%%PUPPET_VARDIR%%
PW="pw"
CHOWN="chown"
@ -43,11 +43,11 @@ elif [ "$2" = "POST-INSTALL" ]; then
echo -n "=> Creating RUNDIR ${RUNDIR}... "
${INSTALL_DIR} ${RUNDIR} || echo "failed"
fi
if [ -d ${WORKDIR} ]; then
echo "=> ${WORKDIR} already exists."
if [ -d ${VARDIR} ]; then
echo "=> ${VARDIR} already exists."
else
echo -n "=> Creating WORKDIR ${WORKDIR}... "
${INSTALL_DIR} ${WORKDIR} || echo "failed"
echo -n "=> Creating VARDIR ${VARDIR}... "
${INSTALL_DIR} ${VARDIR} || echo "failed"
fi
fi

View file

@ -1,11 +1,14 @@
To enable puppetd and/or puppetmasterd, add:
puppetd_enable="YES"
puppetmasterd_enable="YES"
To enable the puppet agent, add the following to /etc/rc.conf:
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, %%PREFIX%%/etc/puppet/puppet.conf.
Now the default PID directory is %%PUPPET_RUNDIR%%.
The default PID directory is %%PUPPET_RUNDIR%%.

View file

@ -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=`set_rcvar`
load_rc_config "$name"
: ${puppet_enable="NO"}
: ${puppet_rundir="%%PUPPET_RUNDIR%%"}
: ${puppet_flags=""}
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"

View file

@ -1,26 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: puppetd
# REQUIRE: NETWORK
# Add the following lines to /etc/rc.conf to enable puppetd:
#
# puppetd_enable="YES"
. /etc/rc.subr
name="puppetd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
command_interpreter="%%PREFIX%%/bin/ruby18"
load_rc_config "$name"
: ${puppetd_enable="NO"}
: ${puppetd_pid="%%PUPPET_RUNDIR%%/${name}.pid"}
: ${puppetd_flags="--rundir %%PUPPET_RUNDIR%%"}
pidfile="$puppetd_pid"
run_rc_command "$1"

View file

@ -0,0 +1,57 @@
#!/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=`set_rcvar`
load_rc_config "${name}"
: ${puppetmaster_enable="NO"}
: ${puppetmaster_rundir="%%PUPPET_RUNDIR%%"}
: ${puppetmaster_flags=""}
: ${puppetmaster_mongrel_ports=""}
command_interpreter="%%PREFIX%%/bin/ruby18"
command="%%PREFIX%%/bin/puppet"
command_args="master ${puppetmaster_flags}"
unset puppetmaster_flags
pidfile="${puppetmaster_rundir}/master.pid"
start_precmd="puppetmaster_checkconfig"
restart_precmd="puppetmaster_checkconfig"
puppetmaster_checkconfig() {
echo -n "Performing sanity check of ${name} configuration: "
${command} ${command_args} --parseonly >/dev/null 2>&1
rv=$?
if [ $rv != 0 ]; then
echo "FAILED, ${name} exited with status ${rv}"
${command} ${command_args} --parseonly
return 1
else
echo "OK"
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

View file

@ -1,45 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: puppetmasterd
# REQUIRE: NETWORK
# Add the following lines to /etc/rc.conf to enable puppetmasterd:
#
# puppetmasterd_enable="YES"
# puppetmasterd_confdir: Set to %%PREFIX%%/etc/puppet by default
# puppetmasterd_flags: Set to "--pidfile ${puppetmasterd_pid}" by default
#
. /etc/rc.subr
name="puppetmasterd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
command_interpreter="%%PREFIX%%/bin/ruby18"
start_precmd="puppetmasterd_checkconfig"
restart_precmd="puppetmasterd_checkconfig"
puppetmasterd_checkconfig() {
echo -n "Performing sanity check of ${name} configuration: "
${command} --parseonly ${puppetmasterd_flags} >/dev/null 2>&1
rv=$?
if [ $rv != 0 ]; then
echo "FAILED, ${name} exited with status ${rv}"
${command} --parseonly ${puppetmasterd_flags}
return 1
else
echo "OK"
fi
}
load_rc_config "$name"
: ${puppetmasterd_enable="NO"}
: ${puppetmasterd_confdir="%%PREFIX%%/etc/puppet"}
: ${puppetmasterd_pid="%%PUPPET_RUNDIR%%/${name}.pid"}
: ${puppetmasterd_flags="--pidfile ${puppetmasterd_pid}"}
pidfile="$puppetmasterd_pid"
run_rc_command "$1"

View file

@ -4,4 +4,4 @@ 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.reductivelabs.com/projects/puppet/
WWW: http://www.puppetlabs.com

View file

@ -10,8 +10,4 @@ sbin/puppetmasterd
sbin/puppetqd
sbin/puppetrun
etc/puppet/puppet.conf-dist
@exec mkdir -p %D/etc/puppet/ssl
@exec mkdir -p %D/etc/puppet/manifests
@dirrmtry etc/puppet/ssl
@dirrmtry etc/puppet/manifests
@dirrmtry etc/puppet