Download and Install cfengine version 2.2.1 on Mac OS X
Thursday the 28th of August, 2008

    cfengine  most recent diff


      View the most recent changes for the cfengine port at: cfengine.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for cfengine.
      The raw portfile for cfengine 2.2.1 is located here:
      http://cfengine.darwinports.com/dports/sysutils/cfengine/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/cfengine
      Google
      Web Darwinports.com



      # $Id: Portfile 36283 2008-04-25 13:35:43Z jmr macports.org $
      PortSystem 1.0

      Name: cfengine
      Version: 2.2.1
      revision 1
      Category: sysutils
      Maintainers: nomaintainer
      Description: a tool for setting up and maintaining computer systems
      Long Description: Cfengine, or the configuration engine is an autonomous agent and a middle to high level policy language for building expert systems which administrate and configure large computer networks.
      Homepage: http://www.cfengine.org/
      master_sites ftp://ftp.iu.hio.no/pub/cfengine/ ftp://sunsite.uio.no/pub/cfengine/ http://ftp.us.xemacs.org/ftp/pub/cfengine/cfengine-ftp/
      checksums sha1 ce4954174110c43541d25775747ae65ada30063d
      Platform: darwin

      depends_lib port:db44 port:openssl port:pcre

      patchfiles patch-pub__getopt.c
      post-patch {
      cd ${worksrcpath}
      foreach manfile [glob doc/*.8] {
      reinplace "s|/usr/local|${prefix}|g" $manfile
      reinplace "s|/var/cfengine|${prefix}&|g" $manfile
      }
      }

      set cfworkdir ${prefix}/var/cfengine

      configure.cflags -I${prefix}/include/db44 -I${prefix}/include
      configure.ldflags -L${prefix}/lib/db44 -L${prefix}/lib
      configure.args --mandir='\${prefix}/share/man' --infodir='\${prefix}/share/info' --with-workdir="${cfworkdir}" --with-berkeleydb=default --with-openssl=default --with-pcre=default --with-docs

      build.args ps_DATA=
      destroot.args ps_DATA=

      pre-destroot {
      if {$env(USER) != "root"} {
      ui_msg "-----------------------------------------------------------"
      ui_msg "Note that you are not running as root, so files installed"
      ui_msg "by this port will not end up with proper ownership and"
      ui_msg "likely not work correctly with ${name}."
      ui_msg "-----------------------------------------------------------"
      }
      }

      destroot.keepdirs ${destroot}${cfworkdir}/bin ${destroot}${cfworkdir}/inputs ${destroot}${cfworkdir}/modules ${destroot}${cfworkdir}/outputs ${destroot}${cfworkdir}/ppkeys ${destroot}${cfworkdir}/rpc_in ${destroot}${cfworkdir}/rpc_out ${destroot}${cfworkdir}/state
      post-destroot {
      # Create cfengine directories
      xinstall -d -m 0755 ${destroot}${cfworkdir}
      # Create cfengine sub-directories
      foreach subdir {bin modules state} {
      xinstall -d -m 0755 ${destroot}${cfworkdir}/${subdir}
      }
      foreach subdir {inputs masterfiles/inputs outputs ppkeys rpc_in rpc_out} {
      xinstall -d -m 0700 ${destroot}${cfworkdir}/${subdir}
      }
      # Create distribution sample conf files
      set hostname [exec hostname]
      set host [lindex [split ${hostname} {.}] 0]
      set domain [join [lrange [split ${hostname} {.}] 1 end] {.}]
      set timezone [exec date +%Z]
      foreach conf {cfagent.conf cfservd.conf update.conf cfrun.hosts} {
      xinstall -m 0644 ${filespath}/${conf}.in ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      reinplace "s|__PREFIX|${prefix}|g" ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      reinplace "s|__CFWORKDIR|${cfworkdir}|g" ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      reinplace "s|__HOST|${host}|g" ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      reinplace "s|__DOMAIN|${domain}|g" ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      reinplace "s|__TIMEZONE|${timezone}|g" ${destroot}${cfworkdir}/masterfiles/inputs/${conf}-dist
      }
      # Create startup rc script (if non-Darwin)
      if {![variant_isset darwin]} {
      xinstall -d -m 0755 ${destroot}${prefix}/etc/rc.d
      xinstall -m 0755 ${filespath}/${name}.sh.in ${destroot}${prefix}/etc/rc.d/${name}.sh
      reinplace "s|__PREFIX|${prefix}|" ${destroot}${prefix}/etc/rc.d/${name}.sh
      reinplace "s|__CFWORKDIR|${cfworkdir}|" ${destroot}${prefix}/etc/rc.d/${name}.sh
      }
      }

      post-activate {
      # Make sure initial conf files are present and setup correctly
      if {![file exists ${cfworkdir}/inputs/update.conf]} {
      xinstall -m 0644 ${cfworkdir}/masterfiles/inputs/update.conf-dist ${cfworkdir}/inputs/update.conf
      }
      foreach conf {cfagent.conf cfservd.conf update.conf cfrun.hosts} {
      if {![file exists ${cfworkdir}/masterfiles/inputs/${conf}]} {
      xinstall -m 0644 ${cfworkdir}/masterfiles/inputs/${conf}-dist ${cfworkdir}/masterfiles/inputs/${conf}
      }
      }
      # Check for root public-private keys, create if missing
      if {![file exists ${cfworkdir}/ppkeys/localhost.priv] || ![file exists ${cfworkdir}/ppkeys/localhost.pub]} {
      if {[file exists ${cfworkdir}/ppkeys/localhost.priv]} {
      delete ${cfworkdir}/ppkeys/localhost.priv
      }
      if {[file exists ${cfworkdir}/ppkeys/localhost.pub]} {
      delete ${cfworkdir}/ppkeys/localhost.pub
      }
      system "${prefix}/sbin/cfkey"
      }
      }

      Variant: psdocs {
      depends_build bin:tex:texlive bin:texinfo:texinfo
      build.args-delete ps_DATA=
      destroot.args-delete ps_DATA=
      }

      platform darwin {
      startupitem.create yes
      startupitem.name Cfengine
      startupitem.start "\[ -x ${cfworkdir}/bin/cfservd \] && ${cfworkdir}/bin/cfservd"
      startupitem.start-append "\[ -x ${cfworkdir}/bin/cfenvd \] && ${cfworkdir}/bin/cfenvd -H"
      startupitem.start-append "\[ -x ${cfworkdir}/bin/cfexecd \] && ${cfworkdir}/bin/cfexecd"
      startupitem.start-append "(\[ -x ${cfworkdir}/bin/cfservd \] && \[ -x ${cfworkdir}/bin/cfenvd \] && \\"
      startupitem.start-append " \[ -x ${cfworkdir}/bin/cfexecd \] && \[ -x ${cfworkdir}/bin/cfagent \]) \\"
      startupitem.start-append "\t|| ${prefix}/sbin/cfagent --no-splay -f update.conf"
      startupitem.stop "/usr/bin/killall -SIGUSR1 cfagent 2>/dev/null"
      startupitem.stop-append "/usr/bin/killall -SIGUSR1 cfexecd 2>/dev/null"
      startupitem.stop-append "/usr/bin/killall -SIGUSR1 cfenvd 2>/dev/null"
      startupitem.stop-append "/usr/bin/killall -SIGUSR1 cfservd 2>/dev/null"
      }


    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/cfengine
      % sudo port install cfengine
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching cfengine
      ---> Verifying checksum for cfengine
      ---> Extracting cfengine
      ---> Configuring cfengine
      ---> Building cfengine with target all
      ---> Staging cfengine into destroot
      ---> Installing cfengine
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using cfengine with these commands:
      %  man cfengine
      % apropos cfengine
      % which cfengine
      % locate cfengine

     Where to find more information:

    Darwin Ports



    image test