# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 90306 2012-03-01 18:19:36Z raimue@macports.org $

PortSystem          1.0

name                puppet
conflicts           cln
version             2.7.6
categories          sysutils
platforms           darwin
maintainers         explanatorygap.net:nigel puppetlabs.com:nigel openmaintainer
supported_archs     noarch

description         Puppet is a configuration management solution.

long_description    Puppet is a configuration management solution. \
                    The Puppet framework provides a means to describe IT \
                    infrastructure as policy, execute that policy to build \
                    services then audit and enforce ongoing changes to the \
                    policy.

homepage            http://projects.puppetlabs.com/projects/puppet
master_sites        http://puppetlabs.com/downloads/puppet/

checksums           md5     6dfbeb7810524c97747f45aa194b506f \
                    sha1    c9822c9e239557de1a7c7a97f1f72a9616f244fe \
                    rmd160  fcccf9b793aa3bf47ca677e72f4b10687766612d

depends_lib         port:ruby \
                    port:facter

use_configure       no
build               {}
test.run            no
destroot.cmd        ${prefix}/bin/ruby ${worksrcpath}/install.rb \
                    --destdir=${destroot} \
                    --configdir=${prefix}/etc/puppet

set puppetuser      puppet
set puppetgroup     puppet

pre-destroot        {
                        addgroup ${puppetgroup}
                        set gid [existsgroup ${puppetgroup}]
                        adduser ${puppetuser} gid=${gid} realname=Puppet\ User
                    }

post-destroot       {
                        set etcexamplesdestdir ${destroot}${prefix}/share/examples/${name}/etc/puppet
                        xinstall -m 755 -d ${etcexamplesdestdir}
                        eval xinstall -m 644 [glob ${worksrcpath}/examples/etc/puppet/*] \
                            ${etcexamplesdestdir}
                    }
