diff options
author | lwhsu <lwhsu@FreeBSD.org> | 2010-08-05 01:06:24 +0800 |
---|---|---|
committer | lwhsu <lwhsu@FreeBSD.org> | 2010-08-05 01:06:24 +0800 |
commit | 7ff9d9b24f5ab9c860d73067281c6d99c883136e (patch) | |
tree | d0ee331653a8d193713aaf813ffd088f7251757a /sysutils/puppet | |
parent | 088cc5881d36a2b97f92fcabc14c22b616f8b70b (diff) | |
download | freebsd-ports-gnome-7ff9d9b24f5ab9c860d73067281c6d99c883136e.tar.gz freebsd-ports-gnome-7ff9d9b24f5ab9c860d73067281c6d99c883136e.tar.zst freebsd-ports-gnome-7ff9d9b24f5ab9c860d73067281c6d99c883136e.zip |
- Update to 2.6.1rc1
PR: ports/149213
Submitted by: Russell Jackson <raj AT csub.edu> (maintainer)
Diffstat (limited to 'sysutils/puppet')
-rw-r--r-- | sysutils/puppet/Makefile | 47 | ||||
-rw-r--r-- | sysutils/puppet/distinfo | 6 | ||||
-rw-r--r-- | sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435 | 120 | ||||
-rw-r--r-- | sysutils/puppet/files/patch-redmine-4383 | 19 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-deinstall.in | 8 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-install.in | 10 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-message.in | 13 | ||||
-rw-r--r-- | sysutils/puppet/files/puppet.in | 32 | ||||
-rw-r--r-- | sysutils/puppet/files/puppetd.in | 26 | ||||
-rw-r--r-- | sysutils/puppet/files/puppetmaster.in | 57 | ||||
-rw-r--r-- | sysutils/puppet/files/puppetmasterd.in | 45 | ||||
-rw-r--r-- | sysutils/puppet/pkg-descr | 2 | ||||
-rw-r--r-- | sysutils/puppet/pkg-plist | 4 |
13 files changed, 279 insertions, 110 deletions
diff --git a/sysutils/puppet/Makefile b/sysutils/puppet/Makefile index c27c59a3ceba..cb976ee53f5f 100644 --- a/sysutils/puppet/Makefile +++ b/sysutils/puppet/Makefile @@ -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 | \ diff --git a/sysutils/puppet/distinfo b/sysutils/puppet/distinfo index ff55eb965ded..62543247c881 100644 --- a/sysutils/puppet/distinfo +++ b/sysutils/puppet/distinfo @@ -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 diff --git a/sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435 b/sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435 new file mode 100644 index 000000000000..873c78a6b22c --- /dev/null +++ b/sysutils/puppet/files/patch-git_2.6.x-16f841ed5674ef8c0782c1d8d92c5fddc4376435 @@ -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 +- diff --git a/sysutils/puppet/files/patch-redmine-4383 b/sysutils/puppet/files/patch-redmine-4383 new file mode 100644 index 000000000000..2c9e9923323e --- /dev/null +++ b/sysutils/puppet/files/patch-redmine-4383 @@ -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 diff --git a/sysutils/puppet/files/pkg-deinstall.in b/sysutils/puppet/files/pkg-deinstall.in index 70bf15c5da89..695acf2661ef 100644 --- a/sysutils/puppet/files/pkg-deinstall.in +++ b/sysutils/puppet/files/pkg-deinstall.in @@ -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 diff --git a/sysutils/puppet/files/pkg-install.in b/sysutils/puppet/files/pkg-install.in index d446e5e003d2..9aad2d58e591 100644 --- a/sysutils/puppet/files/pkg-install.in +++ b/sysutils/puppet/files/pkg-install.in @@ -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 diff --git a/sysutils/puppet/files/pkg-message.in b/sysutils/puppet/files/pkg-message.in index a384ab8c99fe..d4ced0f176a0 100644 --- a/sysutils/puppet/files/pkg-message.in +++ b/sysutils/puppet/files/pkg-message.in @@ -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%%. + diff --git a/sysutils/puppet/files/puppet.in b/sysutils/puppet/files/puppet.in new file mode 100644 index 000000000000..069361f0b113 --- /dev/null +++ b/sysutils/puppet/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=`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" diff --git a/sysutils/puppet/files/puppetd.in b/sysutils/puppet/files/puppetd.in deleted file mode 100644 index 63d69909a1dc..000000000000 --- a/sysutils/puppet/files/puppetd.in +++ /dev/null @@ -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" diff --git a/sysutils/puppet/files/puppetmaster.in b/sysutils/puppet/files/puppetmaster.in new file mode 100644 index 000000000000..6850ee5920c9 --- /dev/null +++ b/sysutils/puppet/files/puppetmaster.in @@ -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 diff --git a/sysutils/puppet/files/puppetmasterd.in b/sysutils/puppet/files/puppetmasterd.in deleted file mode 100644 index 230b551d4537..000000000000 --- a/sysutils/puppet/files/puppetmasterd.in +++ /dev/null @@ -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" diff --git a/sysutils/puppet/pkg-descr b/sysutils/puppet/pkg-descr index d635504435dd..a29c19f53ba8 100644 --- a/sysutils/puppet/pkg-descr +++ b/sysutils/puppet/pkg-descr @@ -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 diff --git a/sysutils/puppet/pkg-plist b/sysutils/puppet/pkg-plist index 843b227fab58..788e347cc87e 100644 --- a/sysutils/puppet/pkg-plist +++ b/sysutils/puppet/pkg-plist @@ -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 |