packages: cfengine/cf-execd (NEW), cfengine/cf-monitord (NEW), cfengine/cf-...

glen glen at pld-linux.org
Mon May 9 10:27:35 CEST 2011


Author: glen                         Date: Mon May  9 08:27:35 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new, based on fedora package

---- Files affected:
packages/cfengine:
   cf-execd (NONE -> 1.1)  (NEW), cf-monitord (NONE -> 1.1)  (NEW), cf-serverd (NONE -> 1.1)  (NEW), cfengine.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/cfengine/cf-execd
diff -u /dev/null packages/cfengine/cf-execd:1.1
--- /dev/null	Mon May  9 10:27:35 2011
+++ packages/cfengine/cf-execd	Mon May  9 10:27:30 2011
@@ -0,0 +1,74 @@
+#!/bin/bash
+#
+# cf-execd         Start/Stop the cfengine client daemon.
+#
+# chkconfig: - 98 20
+# description: cf-execd is scheduler and reporter in cfengine client hosts.
+#              For more information, visit http://www.cfengine.org
+# processname: cf-execd
+# config: /var/cfengine/inputs
+
+# Source function library.
+. /etc/init.d/functions
+
+exec="/usr/sbin/cf-execd"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+	echo -n $"Starting $prog: "
+	daemon $exec
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch $lockfile
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	killproc $prog
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f $lockfile
+	return $RETVAL
+}
+
+
+restart() {
+  	stop
+	start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+fdrstatus() {
+	status $prog
+}
+
+case "$1" in
+    start|stop|restart|reload)
+	$1
+	;;    
+    force-reload)
+        force_reload
+        ;;
+    status)
+  	fdrstatus
+	;;
+    condrestart)
+        [ ! -f $lockfile ] || restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+        exit 3
+esac
+exit $?

================================================================
Index: packages/cfengine/cf-monitord
diff -u /dev/null packages/cfengine/cf-monitord:1.1
--- /dev/null	Mon May  9 10:27:35 2011
+++ packages/cfengine/cf-monitord	Mon May  9 10:27:30 2011
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# cf-monitord:       Starts the GNU cfengine environment daemon
+#
+# chkconfig: - 15 85
+# description:  This process maintains state information about the client
+#   machine's environment (network status, running processes, load, disk
+#   usage, etc.).  This data is made available as classes that can be used
+#   in the agent configuration file to regulate activity based on the system's
+#   deviation from what has been measured over a long period of time
+#   (2 months or more) to be normal or average activity.
+#
+# processname: cf-monitord
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+exec="/usr/sbin/cf-monitord"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    echo -n $"Starting GNU cfengine environmental history daemon: "
+    daemon $prog
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && touch $lockfile
+}
+
+stop() {
+    echo -n $"Stopping GNU cfengine environmental history daemon: "
+    killproc $exec
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && rm -f $lockfile
+    return $RETVAL
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+fdrstatus() {
+    status $prog
+}
+
+case "$1" in
+    start|stop|restart|reload)
+	$1
+	;;    
+    force-reload)
+        force_reload
+        ;;
+    status)
+  	fdrstatus
+	;;
+    condrestart)
+        [ ! -f $lockfile ] || restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+        exit 3
+esac
+exit $?
+

================================================================
Index: packages/cfengine/cf-serverd
diff -u /dev/null packages/cfengine/cf-serverd:1.1
--- /dev/null	Mon May  9 10:27:35 2011
+++ packages/cfengine/cf-serverd	Mon May  9 10:27:30 2011
@@ -0,0 +1,77 @@
+#!/bin/bash
+#
+# cf-serverd         Start/Stop the cfengine server daemon.
+#
+# chkconfig: - 96 20
+# description: cf-serverd is responsible from giving out configuration files to
+#              those cfengine clients, who wish to update their configs.
+#              For more information, visit http://www.cfengine.org
+# processname: cf-serverd
+# config: /var/cfengine/masterfiles
+
+# Source function library.
+. /etc/init.d/functions
+
+exec="/usr/sbin/cf-serverd"
+prog=$(basename $exec)
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+# See how we were called.
+ 
+start() {
+	[ ! -f /var/cfengine/ppkeys/localhost.priv ] && /usr/sbin/cfkey
+	echo -n $"Starting $prog: "
+	daemon $exec
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch $lockfile
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	killproc $prog
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f $lockfile
+	return $RETVAL
+}
+
+restart() {
+  	stop
+	start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+fdrstatus() {
+	status $prog
+}
+
+case "$1" in
+    start|stop|restart|reload)
+	$1
+	;;    
+    force-reload)
+        force_reload
+        ;;
+    status)
+  	fdrstatus
+	;;
+    condrestart)
+        [ ! -f $lockfile ] || restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+        exit 3
+esac
+exit $?

================================================================
Index: packages/cfengine/cfengine.spec
diff -u /dev/null packages/cfengine/cfengine.spec:1.1
--- /dev/null	Mon May  9 10:27:35 2011
+++ packages/cfengine/cfengine.spec	Mon May  9 10:27:30 2011
@@ -0,0 +1,147 @@
+# $Revision$, $Date$
+# TODO
+# - precise texinfo deps
+# - pldize initscript
+# - FHS
+Summary:	A systems administration tool for networks
+Name:		cfengine
+Version:	3.0.5p1
+Release:	0.1
+License:	GPL v3
+Group:		Applications/System
+Source0:	http://www.cfengine.org/tarballs/%{name}-%{version}.tar.gz
+# Source0-md5:	b74af23928253e11dcce3d98510f1066
+Source1:	cf-execd
+Source2:	cf-serverd
+Source3:	cf-monitord
+URL:		http://www.cfengine.org/
+BuildRequires:	acl-devel
+BuildRequires:	bison
+BuildRequires:	db-devel
+BuildRequires:	flex
+BuildRequires:	libselinux-devel
+BuildRequires:	m4
+BuildRequires:	openssl-devel
+BuildRequires:	pcre-devel
+BuildRequires:	tetex-dvips
+Requires(post,preun):	/sbin/chkconfig
+Requires:	rc-scripts
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Cfengine, or the configuration engine is an agent/software robot and a
+very high level language for building expert systems to administrate
+and configure large computer networks. Cfengine uses the idea of
+classes and a primitive form of intelligence to define and automate
+the configuration and maintenance of system state, for small to huge
+configurations. Cfengine is designed to be a part of a computer immune
+system.
+
+%package doc
+Summary:	Documentation for cfengine
+Group:		Documentation
+Requires:	%{name} = %{version}-%{release}
+
+%description doc
+This package contains the documentation for cfengine.
+
+%prep
+%setup -q
+
+%build
+%configure \
+	BERKELEY_DB_LIB=-ldb \
+	--docdir=%{_docdir}/%{name}-%{version} \
+	--enable-selinux
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/%{name}}
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# make directory tree for cfengine configs
+install -d $RPM_BUILD_ROOT%{_var}/%{name}
+for i in ppkeys inputs outputs; do
+	mkdir -m 0700 $RPM_BUILD_ROOT%{_var}/%{name}/$i
+done
+
+# It's ugly, but thats the way Mark wants to have it. :(
+# If we don't create this link, cfexecd will not be able to start
+# (hardcoded) /var/sbin/cf-agent in scheduled intervals. Other option
+# would be to patch cfengine to use %{_sbindir}/cf-agent
+# but upstream won't support this
+install -d $RPM_BUILD_ROOT%{_var}/%{name}/bin
+ln -sf %{_sbindir}/cf-agent $RPM_BUILD_ROOT%{_var}/%{name}/bin
+ln -sf %{_sbindir}/cf-promises $RPM_BUILD_ROOT%{_var}/%{name}/bin
+
+# init scripts
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+for i in %{SOURCE1} %{SOURCE2} %{SOURCE3}; do
+	install -p -m 0755 $i $RPM_BUILD_ROOT/etc/rc.d/init.d
+done
+
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+
+# All this stuff is pushed into doc/contrib directories
+rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
+rm -f $RPM_BUILD_ROOT%{_sbindir}/cfdoc
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+# cfagent won't run nicely, unless your host has keys.
+if [ ! -d /mnt/sysimage -a ! -f %{_var}/%{name}/ppkeys/localhost.priv ]; then
+	%{_sbindir}/cf-key >/dev/null || :
+fi
+
+# add init files to chkconfig
+/sbin/chkconfig --add cf-monitord
+/sbin/chkconfig --add cf-execd
+/sbin/chkconfig --add cf-serverd
+%service cf-monitord restart
+%service cf-execd restart
+%service cf-serverd restart
+
+%preun
+if [ "$1" = "0" ]; then
+	%service cf-monitord stop
+	%service cf-execd stop
+	%service cf-serverd stop
+	/sbin/chkconfig --del cf-monitord
+	/sbin/chkconfig --del cf-execd
+	/sbin/chkconfig --del cf-serverd
+fi
+
+%postun
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog README TODO
+%attr(755,root,root) %{_sbindir}/*
+%{_libdir}/libpromises*
+%{_mandir}/man8/*
+%attr(754,root,root) /etc/rc.d/init.d/cf-monitord
+%attr(754,root,root) /etc/rc.d/init.d/cf-execd
+%attr(754,root,root) /etc/rc.d/init.d/cf-serverd
+%{_var}/%{name}
+
+%files doc
+%defattr(644,root,root,755)
+%doc inputs
+%doc docs/*html
+%doc docs/*pdf
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2011/05/09 08:27:30  glen
+- new, based on fedora package
================================================================


More information about the pld-cvs-commit mailing list