diff options
author | swills <swills@FreeBSD.org> | 2012-06-03 08:57:59 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2012-06-03 08:57:59 +0800 |
commit | 0ba1dd0e1b6f6b360954b0364a94212030e2a3c6 (patch) | |
tree | a5810bfb82b0732bf6e39d15876f97083761e236 /sysutils | |
parent | 2153d40e44586391e654551948361a824b2ee7c0 (diff) | |
download | freebsd-ports-gnome-0ba1dd0e1b6f6b360954b0364a94212030e2a3c6.tar.gz freebsd-ports-gnome-0ba1dd0e1b6f6b360954b0364a94212030e2a3c6.tar.zst freebsd-ports-gnome-0ba1dd0e1b6f6b360954b0364a94212030e2a3c6.zip |
- Use USERS instead of pkg-install script ot create users
- Move creation of var directories to plist
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/puppet/Makefile | 27 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-deinstall.in | 14 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-install.in | 54 | ||||
-rw-r--r-- | sysutils/puppet/files/pkg-message.in | 2 | ||||
-rw-r--r-- | sysutils/puppet/files/puppet.in | 2 | ||||
-rw-r--r-- | sysutils/puppet/files/puppetmaster.in | 2 | ||||
-rw-r--r-- | sysutils/puppet/pkg-plist | 7 |
7 files changed, 19 insertions, 89 deletions
diff --git a/sysutils/puppet/Makefile b/sysutils/puppet/Makefile index cb2302fd3f6a..4275f04a8513 100644 --- a/sysutils/puppet/Makefile +++ b/sysutils/puppet/Makefile @@ -7,6 +7,7 @@ PORTNAME= puppet PORTVERSION= 2.7.14 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://downloads.puppetlabs.com/puppet/ @@ -22,15 +23,9 @@ USE_RUBY_FEATURES= iconv USE_RC_SUBR= puppet puppetmaster PORTDOCS= CHANGELOG LICENSE README.md PORTEXAMPLES= * -PUPPET_USER:= puppet -PUPPET_GROUP:= ${PUPPET_USER} -PUPPET_VARDIR:= /var/${PORTNAME} -PUPPET_RUNDIR:= /var/run/${PORTNAME} -SUB_FILES+= pkg-install pkg-message pkg-deinstall -SUB_LIST+= PUPPET_USER="${PUPPET_USER}" \ - PUPPET_GROUP="${PUPPET_GROUP}" \ - PUPPET_VARDIR="${PUPPET_VARDIR}" \ - PUPPET_RUNDIR="${PUPPET_RUNDIR}" +USERS= puppet +GROUPS= puppet +SUB_FILES+= pkg-message MANCOMPRESSED= yes MAN5= puppet.conf.5 @@ -77,26 +72,25 @@ post-patch: ${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}|" \ + @${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|${PUPPET_RUNDIR}|" \ + @${REINPLACE_CMD} -e "s|\$$vardir/run|/var/run/puppet|" \ ${WRKSRC}/lib/puppet/util/run_mode.rb - @${REINPLACE_CMD} -e "s|\$$confdir/ssl|${PUPPET_VARDIR}/ssl|" \ + @${REINPLACE_CMD} -e "s|\$$confdir/ssl|/var/run/puppet/ssl|" \ ${WRKSRC}/lib/puppet/defaults.rb -pre-install: - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - 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=${PUPPET_RUNDIR} | \ + --rundir=/var/run/puppet | \ ${SED} -e 's/genconfig = true/# genconfig = false/' | \ ${SED} -e 's/factdest =/# factdest =/' \ > ${ETCDIR}/puppet.conf-dist @@ -108,7 +102,6 @@ post-install: ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST} @${FIND} ${RUBY_SITELIBDIR}/${PORTNAME} -type d | ${SORT} -r | \ ${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST} - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .if !defined(NOPORTDOCS) ${INSTALL} -d ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} diff --git a/sysutils/puppet/files/pkg-deinstall.in b/sysutils/puppet/files/pkg-deinstall.in deleted file mode 100644 index 695acf2661ef..000000000000 --- a/sysutils/puppet/files/pkg-deinstall.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -PATH="/bin:/sbin:/usr/bin:/usr/sbin" - -RUNDIR=%%PUPPET_RUNDIR%% -VARDIR=%%PUPPET_VARDIR%% - -if [ "$2" = "POST-DEINSTALL" ]; then - echo "=> Deleting ${RUNDIR} if empty..." - rm -d ${RUNDIR} 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 deleted file mode 100644 index 9aad2d58e591..000000000000 --- a/sysutils/puppet/files/pkg-install.in +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -PATH="/bin:/sbin:/usr/bin:/usr/sbin" - -PUPPET_USER=%%PUPPET_USER%% -PUPPET_GROUP=%%PUPPET_GROUP%% -UID=814 -GID=$UID - -RUNDIR=%%PUPPET_RUNDIR%% -VARDIR=%%PUPPET_VARDIR%% - -PW="pw" -CHOWN="chown" -INSTALL_DIR="install -d -o ${PUPPET_USER} -g ${PUPPET_GROUP} -m 0755" - -if [ "$2" = "PRE-INSTALL" ]; then - - if ! ${PW} groupshow ${PUPPET_GROUP} 2>/dev/null 1>&2; then - if ${PW} groupadd ${PUPPET_GROUP} -g $GID; then - echo "=> Added group \"${PUPPET_GROUP}\"." - else - echo "=> Adding group \"${PUPPET_GROUP}\" failed..." - exit 1 - fi - fi - - if ! ${PW} usershow ${PUPPET_USER} 2>/dev/null 1>&2; then - if ${PW} useradd ${PUPPET_USER} -u $UID -g ${PUPPET_GROUP} -h - \ - -s "/sbin/nologin" -d "/nonexistent" \ - -c "Puppet Daemon"; then - echo "=> Added user \"${PUPPET_USER}\"." - else - echo "=> Adding user \"${PUPPET_USER}\" failed..." - exit 1 - fi - fi - -elif [ "$2" = "POST-INSTALL" ]; then - if [ -d ${RUNDIR} ]; then - echo "=> ${RUNDIR} already exists." - else - echo -n "=> Creating RUNDIR ${RUNDIR}... " - ${INSTALL_DIR} ${RUNDIR} || echo "failed" - fi - if [ -d ${VARDIR} ]; then - echo "=> ${VARDIR} already exists." - else - echo -n "=> Creating VARDIR ${VARDIR}... " - ${INSTALL_DIR} ${VARDIR} || echo "failed" - fi -fi - -exit 0 diff --git a/sysutils/puppet/files/pkg-message.in b/sysutils/puppet/files/pkg-message.in index 1ba663e6a5fe..d036be0a93e0 100644 --- a/sysutils/puppet/files/pkg-message.in +++ b/sysutils/puppet/files/pkg-message.in @@ -10,5 +10,5 @@ To enable the puppetmaster, add the following to /etc/rc.conf: Individual config files such as %%PREFIX%%/etc/puppetmasterd.conf are deprecated. Use a single file, %%ETCDIR%%/puppet.conf. -The default PID directory is %%PUPPET_RUNDIR%%. +The default PID directory is /var/run/puppet diff --git a/sysutils/puppet/files/puppet.in b/sysutils/puppet/files/puppet.in index 9d1cd480c8b0..d98c9d5d64f3 100644 --- a/sysutils/puppet/files/puppet.in +++ b/sysutils/puppet/files/puppet.in @@ -19,7 +19,7 @@ rcvar=puppet_enable load_rc_config "$name" : ${puppet_enable="NO"} -: ${puppet_rundir="%%PUPPET_RUNDIR%%"} +: ${puppet_rundir="/var/run/puppet"} : ${puppet_flags="--rundir=${puppet_rundir}"} command_interpreter="%%PREFIX%%/bin/ruby18" diff --git a/sysutils/puppet/files/puppetmaster.in b/sysutils/puppet/files/puppetmaster.in index b525ed0f54eb..fe38db24fde6 100644 --- a/sysutils/puppet/files/puppetmaster.in +++ b/sysutils/puppet/files/puppetmaster.in @@ -19,7 +19,7 @@ rcvar=puppetmaster_enable load_rc_config "${name}" : ${puppetmaster_enable="NO"} -: ${puppetmaster_rundir="%%PUPPET_RUNDIR%%"} +: ${puppetmaster_rundir="/var/run/puppet"} : ${puppetmaster_flags="--rundir=${puppetmaster_rundir}"} command_interpreter="%%PREFIX%%/bin/ruby18" diff --git a/sysutils/puppet/pkg-plist b/sysutils/puppet/pkg-plist index 5fe745387d77..ca143352c836 100644 --- a/sysutils/puppet/pkg-plist +++ b/sysutils/puppet/pkg-plist @@ -1,4 +1,3 @@ -@comment $FreeBSD$ bin/filebucket bin/pi bin/puppet @@ -12,3 +11,9 @@ 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 |