[64242] users/ged/sysutils/cfengine3

ged at macports.org ged at macports.org
Fri Feb 26 14:27:58 PST 2010


Revision: 64242
          http://trac.macports.org/changeset/64242
Author:   ged at macports.org
Date:     2010-02-26 14:27:57 -0800 (Fri, 26 Feb 2010)
Log Message:
-----------
First working version; still needs more testing

Modified Paths:
--------------
    users/ged/sysutils/cfengine3/Portfile

Added Paths:
-----------
    users/ged/sysutils/cfengine3/files/patch-src-files_operators.c.diff

Removed Paths:
-------------
    users/ged/sysutils/cfengine3/files/cfagent.conf.in
    users/ged/sysutils/cfengine3/files/cfengine.sh.in
    users/ged/sysutils/cfengine3/files/cfrun.hosts.in
    users/ged/sysutils/cfengine3/files/cfservd.conf.in
    users/ged/sysutils/cfengine3/files/patch-pub__getopt.c
    users/ged/sysutils/cfengine3/files/update.conf.in

Modified: users/ged/sysutils/cfengine3/Portfile
===================================================================
--- users/ged/sysutils/cfengine3/Portfile	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/Portfile	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,21 +1,22 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 # $Id$
-PortSystem			1.0
+PortSystem 1.0
+PortGroup muniversal 1.0
+PortGroup xcodeversion 1.0
 
 name				cfengine3
 conflicts			cfengine
 version				3.0.3
-revision			0
+revision			1
 categories			sysutils
 maintainers			ged
 description			network configuration-management tool
-long_description	a tool for setting up and maintaining BSD and System-5-like operating \
-					system optionally attached to a TCP/IP network. You can think of cfengine \
-					as a very high level language, much higher level than Perl or shell: a \
-					single statement can result in many hundreds of operations being performed \
-					on multiple hosts. Cfengine is good at performing a lot of common system \
-					administration tasks, and allows you to build on its strengths with your \
-					own scripts. 
+long_description	a suite of programs for integrated autonomic \
+					management of either individual or networked \
+					computers. Cfengine 3 is a significant rewrite \
+					of underlying cfengine technology which \
+					preserves the core principles and methodology \
+					of cfengine2’s approach. 
 homepage			http://www.cfengine.org/
 master_sites		http://www.cfengine.org/tarballs/
 distfiles			cfengine-${version}.tar.gz
@@ -31,6 +32,8 @@
 					port:pcre \
 					port:gd2
                     
+patchfiles          patch-src-files_operators.c.diff
+
 post-patch {
 	foreach manfile [glob ${worksrcpath}/docs/*.8] {
 		reinplace "s|/usr/local|${prefix}|g" $manfile
@@ -38,134 +41,20 @@
 	}
 }
 
-set cfworkdir	${prefix}/var/cfengine
+post-build {
+	system "${worksrcpath}/libtool --finish ${prefix}/lib"
+}
 
+set cfworkdir		${prefix}/var/cfengine
+
 configure.cflags	-I${prefix}/include/db46 -I${prefix}/include
 configure.ldflags	-L${prefix}/lib/db46 -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
+					--with-openssl=${prefix} \
+					--with-pcre=${prefix}
 
-# 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=
-# }
 
-variant sql {
-	configure.args-append	--with-sql 
-}
-variant ldap {}
-variant mysql {}
-variant graphviz {}
-variant tokyocabinet {}
-
-# platform darwin {
-# 	startupitem.create			yes
-# 	startupitem.name			Cfengine3
-# 	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"
-# }
-# 
-
-# vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
\ No newline at end of file
+# vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

Deleted: users/ged/sysutils/cfengine3/files/cfagent.conf.in
===================================================================
--- users/ged/sysutils/cfengine3/files/cfagent.conf.in	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/cfagent.conf.in	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,70 +0,0 @@
-##################################################
-# 
-#  cfagent.conf
-#
-#  This is a simple file for getting started with
-#  cfengine. It is harmless. If you get cfengine
-#  running with this file, you can build on it.
-#
-##################################################
-
-###
-#
-# BEGIN cfagent.conf (Only hard classes in this file )
-#
-###
-
-control:
-
-	Syslog = ( on )  # enable syslog logging
-
-	actionsequence = ( checktimezone files processes shellcommands )
-
-	domain         = ( __DOMAIN )
-	timezone       = ( __TIMEZONE )
-
-	smtpserver     = ( __HOST.__DOMAIN )  # used by cfexecd
-	sysadm         = ( root at __HOST.__DOMAIN )  # where to mail output
-
-    schedule       = ( Min00_05 )       # run once an hour
-
-######################################################################
-
-files:
-
-	# Check some important files
-
-	/etc/passwd mode=644 owner=root action=warnall
-
-	# Do a tripwire check on binaries!
-
-	/usr/bin               # Scan /usr/bin dir
-
-		owner=root,daemon  # all files must be owned by root or daemon
-		checksum=md5       # use md5 or sha
-		recurse=inf        # all subdirs
-		action=warnall
-
-#####################################################################
-
-processes:
-
-	"cfservd"  restart __CFWORKDIR/bin/cfservd
-
-	"cfenvd"   restart "__CFWORKDIR/bin/cfenvd -H"
-
-	"cfexecd$" restart __CFWORKDIR/bin/cfexecd
-
-######################################################################
-
-shellcommands:
-
-      "/bin/echo 'Cfengine successfully executed.' && /bin/echo 'Replace me with something useful.'"
-
-
-###
-#
-# END cfagent.conf
-#
-###
-

Deleted: users/ged/sysutils/cfengine3/files/cfengine.sh.in
===================================================================
--- users/ged/sysutils/cfengine3/files/cfengine.sh.in	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/cfengine.sh.in	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-CFWORKDIR=__CFWORKDIR
-
-case "$1" in
-start)
-	[ -x $CFWORKDIR/bin/cfservd ] && $CFWORKDIR/bin/cfservd
-	[ -x $CFWORKDIR/bin/cfenvd ] && $CFWORKDIR/bin/cfenvd -H
-	[ -x $CFWORKDIR/bin/cfexecd ] && $CFWORKDIR/bin/cfexecd
-	([ -x $CFWORKDIR/bin/cfservd ] && [ -x $CFWORKDIR/bin/cfenvd ] && \
-	 [ -x $CFWORKDIR/bin/cfexecd ] && [ -x $CFWORKDIR/bin/cfagent ]) \
-		|| __PREFIX/sbin/cfagent --no-splay -f update.conf
-	;;
-stop)
-	/usr/bin/killall -SIGUSR1 cfagent 2>/dev/null
-	/usr/bin/killall -SIGUSR1 cfexecd 2>/dev/null
-	/usr/bin/killall -SIGUSR1 cfenvd 2>/dev/null
-	/usr/bin/killall -SIGUSR1 cfservd 2>/dev/null
-	;;
-restart)
-	$0 stop
-	$0 start
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop|restart}" >&2
-	;;
-esac
-
-exit 0
-

Deleted: users/ged/sysutils/cfengine3/files/cfrun.hosts.in
===================================================================
--- users/ged/sysutils/cfengine3/files/cfrun.hosts.in	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/cfrun.hosts.in	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,25 +0,0 @@
-#######
-#
-# BEGIN cfrun.hosts
-#
-# This is the host list for cfrun.
-# Only these hosts will be contacted by remote connection.
-#
-#######
-
-domain=__DOMAIN
-#access=userA,userB,userC # etc.
-access=root
-
-__HOST
-# hostA
-# hostB
-# hostC
-# etc.
-
-###
-#
-# END cfrun.hosts
-#
-###
-

Deleted: users/ged/sysutils/cfengine3/files/cfservd.conf.in
===================================================================
--- users/ged/sysutils/cfengine3/files/cfservd.conf.in	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/cfservd.conf.in	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,40 +0,0 @@
-#########################################################
-#
-# This is a cfservd config file - it is used for the server
-# part of cfengine, for remote file transfers and control
-# over cfengine using the cfrun program.
-#
-#########################################################
-     
-control:
-     
-	domain = ( __DOMAIN )
-     
-	cfrunCommand = ( "__CFWORKDIR/bin/cfagent" )
-     
-	any::
-     
-		IfElapsed = ( 1 )
-		ExpireAfter = ( 15 )
-		MaxConnections = ( 50 )
-		MultipleConnections = ( true )
-     
-#########################################################
-     
-grant:
-     
-	# Grant access to all hosts at __DOMAIN.
-	# Files should be world readable
-     
-	__CFWORKDIR/masterfiles/inputs   *.__DOMAIN
-     
-	# Make sure there is permission to execute by cfrun
-     
-	__CFWORKDIR/bin/cfagent          *.__DOMAIN
-     
-########
-#
-# END cfservd.conf
-#
-########
-

Deleted: users/ged/sysutils/cfengine3/files/patch-pub__getopt.c
===================================================================
--- users/ged/sysutils/cfengine3/files/patch-pub__getopt.c	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/patch-pub__getopt.c	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,11 +0,0 @@
---- pub/getopt.c	2005-02-08 11:48:47.000000000 +0000
-+++ pub/getopt.c.new	2007-06-13 11:57:57.000000000 +0000
-@@ -156,7 +156,7 @@
- /* Value of POSIXLY_CORRECT environment variable.  */
- static char *posixly_correct;
- 
--#ifdef	__GNU_LIBRARY__
-+#if defined(__GNU_LIBRARY__) || defined(__APPLE__)
- /* We want to avoid inclusion of string.h with non-GNU libraries
-    because there are many ways it can cause trouble.
-    On some systems, it contains special magic macros that don't work

Added: users/ged/sysutils/cfengine3/files/patch-src-files_operators.c.diff
===================================================================
--- users/ged/sysutils/cfengine3/files/patch-src-files_operators.c.diff	                        (rev 0)
+++ users/ged/sysutils/cfengine3/files/patch-src-files_operators.c.diff	2010-02-26 22:27:57 UTC (rev 64242)
@@ -0,0 +1,11 @@
+--- src/files_operators.c.orig	2009-12-09 08:45:44.000000000 -0800
++++ src/files_operators.c	2010-02-24 17:44:18.000000000 -0800
+@@ -575,7 +575,7 @@
+ 
+ Debug("VerifyFinderType of %s for %s\n", file,a.perms.findertype);
+ 
+-if (strncmp(a.perms.findertype,"*",CF_BUFSIZE) == 0 || strncmp(a.perms.findertype,"",CF_BUFSIZE) == 0)
++if (!a.perms.findertype || strncmp(a.perms.findertype,"*",CF_BUFSIZE) == 0 || strncmp(a.perms.findertype,"",CF_BUFSIZE) == 0)
+    {
+    return 0;
+    }

Deleted: users/ged/sysutils/cfengine3/files/update.conf.in
===================================================================
--- users/ged/sysutils/cfengine3/files/update.conf.in	2010-02-26 21:57:14 UTC (rev 64241)
+++ users/ged/sysutils/cfengine3/files/update.conf.in	2010-02-26 22:27:57 UTC (rev 64242)
@@ -1,120 +0,0 @@
-#######
-#
-# BEGIN update.conf
-#
-# This script distributes the configuration, a simple file so that,
-# if there are syntax errors in the main config, we can still
-# distribute a correct configuration to the machines afterwards, even
-# though the main config won't parse. It is read and run just before the
-# main configuration is parsed.
-#
-#######
-     
-control:
-     
-	Syslog = ( on )  # enable syslog logging
-
-	actionsequence  = ( copy processes tidy )  # Keep this simple and constant
-     
-	domain          = ( __DOMAIN )  # Needed for remote copy
-     
-	#
-	# Which host/dir is the master for configuration roll-outs?
-	#
-     
-	policyhost      = ( __HOST.__DOMAIN )
-	master_cfinput  = ( __CFWORKDIR/masterfiles/inputs )
-
-	AddInstallable  = ( new_cfenvd new_cfservd new_cfexecd )
-
-	#
-	# Some convenient variables
-	#
-     
-	workdir         = ( __CFWORKDIR )
-	cf_install_dir  = ( __PREFIX/sbin )
-     
-	# Avoid server contention
-     
-	SplayTime = ( 5 )
-     
-############################################################################
-     
-#
-# Make sure there is a local copy of the configuration and
-# the most important binaries in case we have no connectivity
-# e.g. for mobile stations or during DOS attacks
-#
-     
-copy:
-     
-	$(master_cfinput)            dest=$(workdir)/inputs
-                                 r=inf
-                                 mode=700
-                                 type=binary
-                                 exclude=*-dist
-                                 exclude=*.lst
-                                 exclude=*~
-                                 exclude=#*
-                                 server=$(policyhost)
-                                 trustkey=true
-     
-	$(cf_install_dir)/cfagent    dest=$(workdir)/bin/cfagent
-                                 mode=755
-                                 backup=false
-                                 type=checksum
-     
-	$(cf_install_dir)/cfservd    dest=$(workdir)/bin/cfservd
-                                 mode=755
-                                 backup=false
-                                 type=checksum
-                                 define=new_cfservd
-     
-	$(cf_install_dir)/cfexecd    dest=$(workdir)/bin/cfexecd
-                                 mode=755
-                                 backup=false
-                                 type=checksum
-                                 define=new_cfexecd
-     
-	$(cf_install_dir)/cfenvd     dest=$(workdir)/bin/cfenvd 
-                                 mode=755
-                                 backup=false
-                                 type=checksum
-                                 define=new_cfenvd
-     
-#####################################################################
-     
-tidy:
-     
-	#
-	# Cfexecd stores output in this directory.
-	# Make sure we don't build up files and choke on our own words!
-	#
-     
-	$(workdir)/outputs pattern=* age=7
-
-#####################################################################
-
-processes:
-
-	#
-	# Make sure to restart cfenvd or cfservd when the binaries
-	# are updated.
-	#
-
-	new_cfservd::
-		"cfservd"  signal=term restart __CFWORKDIR/bin/cfservd
-
-	new_cfenvd::
-		"cfenvd"   signal=kill restart "__CFWORKDIR/bin/cfenvd -H"
-
-	new_cfexecd::
-		"cfexecd$" signal=term restart __CFWORKDIR/bin/cfexecd
-
- 
-#######
-#
-# END update.conf
-#
-#######
-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100226/01b17524/attachment.html>


More information about the macports-changes mailing list