--- cfengine3-3.0.2+dfsg.orig/debian/watch +++ cfengine3-3.0.2+dfsg/debian/watch @@ -0,0 +1,10 @@ +# Compulsory line, this is a version 3 file +version=3 + +# usually the cfengine maintainer releases versions like x.x.xb7 or x.x.xa4 +# *before* the official version, which does not contain any letter, so we need +# to adapt our version otherwise uscan will believe, for example, that 3.0.2 is +# older than 3.0.2b3 +opts="uversionmangle=s/([a-z]\d)/~$1/i,dversionmangle=s/\+dfsg//" \ +http://www.cfengine.org/pages/downloads /tarballs/cfengine-(.*)\.tar\.gz \ +debian sh debian/repack.sh --- cfengine3-3.0.2+dfsg.orig/debian/copyright +++ cfengine3-3.0.2+dfsg/debian/copyright @@ -0,0 +1,80 @@ +Format-Specification: + http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196 +Upstream-Maintainer: Mark Burgess +Upstream-Source: http://www.cfengine.org/download.php +Upstream-Name: cfengine + +X-Repackaging-Reasoning: + Upstream sources are repackaged to remove a file which contains a pdf but + not the source to generate it: + + docs/ContributorStatement.pdf + . + Repackaging is done via debian/repack.sh and can be replayed using "uscan -f" + +Files: * +Copyright: 2008, Cfengine AS +License: GPL-3 + +Files: pub/getopt* +Copyright: 1987-1994, Free Software Foundation, Inc. +License LGPL-2+ + +Files: pub/snprintf.c +Copyright: 1999, Mark Martinec +License: Frontier Artistic License + +Files: debian/* +Copyright: 2009, Antonio Radici +License: GPL-3 + +Files: debian/repack.sh +Copyright: 2008, Damyan Ivanov +License: Artistic | GPL-1+ + +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + On Debian GNU/Linux systems, the complete text of version 3 of the GNU + General Public License can be found in `/usr/share/common-licenses/GPL-3' + + In addition, as a special exception, the author of this program gives + permission to link the code of its release with the OpenSSL project's + "OpenSSL" library (or with modified versions of it that use the same + license as the "OpenSSL" library), and distribute the linked executables. + You must obey the GNU General Public License in all respects for all of + the code used other than "OpenSSL". If you modify this file, you may + extend this exception to your version of the file, but you are not + obligated to do so. If you do not wish to do so, delete this exception + statement from your version. + +License: LGPL-2+ + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Library General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) any + later version. + A copy of the LGPL-2 can be found at /usr/share/common-licenses/LGPL-2 on + any Debian system. + +License: Frontier Artistic License + This program is free software; you can redistribute it and/or modify + it under the terms of the "Frontier Artistic License". + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + A copy of the Frontier Artistic License can be found at + http://spinwardstars.com/frontier/fal.html + +License: Artistic + This program is free software; you can redistribute it and/or modify + it under the terms of the Artistic License, which comes with Perl. + On Debian GNU/Linux systems, the complete text of the Artistic License + can be found in `/usr/share/common-licenses/Artistic' + +License: GPL-1+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + On Debian GNU/Linux systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL' --- cfengine3-3.0.2+dfsg.orig/debian/cfengine3.default +++ cfengine3-3.0.2+dfsg/debian/cfengine3.default @@ -0,0 +1,20 @@ +# Defaults for cfengine initscript +# sourced by /etc/init.d/cfengine3 +# installed at /etc/default/cfengine3 by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +# Set variable to 1 to start the daemon; 0 otherwise. + +# to start these three daemons you need the /etc/cfengine3/promises.cf +# have a look at the examples in /usr/share/doc/cfengine3/examples +RUN_CFMONITORD=0 +RUN_CFSERVERD=0 +RUN_CFEXECD=0 + +# Additional options that are passed to the daemons +CFMONITORD_OPTS="" +CFSERVERD_OPTS="" +CFEXECD_OPTS="" --- cfengine3-3.0.2+dfsg.orig/debian/control +++ cfengine3-3.0.2+dfsg/debian/control @@ -0,0 +1,37 @@ +Source: cfengine3 +Section: admin +Priority: optional +Maintainer: Antonio Radici +Build-Depends: debhelper (>= 7), autotools-dev, quilt, libdb-dev, + libssl-dev, flex, bison, libpcre3-dev +Standards-Version: 3.8.3 +DM-Upload-Allowed: yes +Homepage: http://www.cfengine.org/ +Vcs-Browser: http://git.debian.org/?p=collab-maint/cfengine3.git +Vcs-Git: git://git.debian.org/git/collab-maint/cfengine3.git + +Package: cfengine3 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: tool for configuring and maintaining network machines + Cfengine is a suite of programs for integrated autonomic management + of either individual or networked computers. + . + Cfengine 3 is both a more powerful and much simplified version of cfengine, + which has been designed to inter operate with cfengine 2 rather than be + backwards compatible with it. + . + With cfengine 3 you can install, configure and maintain computers using + powerful hands-free tools. + +Package: cfengine3-dbg +Architecture: any +Section: debug +Priority: extra +Depends: cfengine3 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: debugging symbols for cfengine3 + The main purpose of cfengine is to allow the system administrator + to create a single central file which will define how every host + on a network should be configured. + . + This package contains the debugging symbols for cfengine3. --- cfengine3-3.0.2+dfsg.orig/debian/dirs +++ cfengine3-3.0.2+dfsg/debian/dirs @@ -0,0 +1,2 @@ +usr/sbin +etc/cfengine3 --- cfengine3-3.0.2+dfsg.orig/debian/compat +++ cfengine3-3.0.2+dfsg/debian/compat @@ -0,0 +1 @@ +7 --- cfengine3-3.0.2+dfsg.orig/debian/links +++ cfengine3-3.0.2+dfsg/debian/links @@ -0,0 +1,2 @@ +etc/cfengine3 var/lib/cfengine3/inputs +usr/sbin var/lib/cfengine3/bin --- cfengine3-3.0.2+dfsg.orig/debian/changelog +++ cfengine3-3.0.2+dfsg/debian/changelog @@ -0,0 +1,24 @@ +cfengine3 (3.0.2+dfsg-2) unstable; urgency=low + + * debian/control: + + adding missing full stops (Closes: 550108) + + updating my mail to antonio@debian.org + + adding a B-D to libpcre3-dev (Closes: 552520) + + cfengine2 no longer in Conflicts (Closes: 555479) + * debian/rules: do not compress .cf files + * debian/patches: + + fix-example-paths added, to adapt examples to our FHS + compliant paths (Closes: 552144) + + remove-man-errors: fix for some minor typos (Closes: 552473) + + rename-doesnt-fail: prevent failures if rename fails (Closes: 555932) + + fix-error-typos: to fix a small typo in cf-agent, so lintian is happy + * debian/README.Debian: + + warn people to modify site.cf before starting the daemons + + -- Antonio Radici Tue, 08 Dec 2009 16:19:24 +0000 + +cfengine3 (3.0.2+dfsg-1) unstable; urgency=low + + * Initial release (Closes: #518059) + + -- Antonio Radici Wed, 23 Sep 2009 20:52:47 +0100 --- cfengine3-3.0.2+dfsg.orig/debian/clean +++ cfengine3-3.0.2+dfsg/debian/clean @@ -0,0 +1,8 @@ +# cruft removal from the upstream tarball +tests/units/*~ +config.log +tests/file_operands/Makefile +tests/units/Makefile +# doc removal (they are autogenerated) +docs/*.8 +docs/texinfo.tex --- cfengine3-3.0.2+dfsg.orig/debian/info +++ cfengine3-3.0.2+dfsg/debian/info @@ -0,0 +1,3 @@ +docs/cf3-reference.info-2 +docs/cf3-reference.info +docs/cf3-reference.info-1 --- cfengine3-3.0.2+dfsg.orig/debian/cfengine3.init +++ cfengine3-3.0.2+dfsg/debian/cfengine3.init @@ -0,0 +1,241 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: cfengine3 +# Required-Start: $remote_fs $network $syslog +# Required-Stop: $remote_fs $network $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: initscript for cfengine3 +# Description: starts all the daemon needed by cfengine3 if they are +# enabled on /etc/default/cfengine3 +### END INIT INFO + +# Author: Antonio Radici + +# Do NOT "set -e" + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="datacenter management platform" +NAME=cfengine3 +PIDROOT=/var/run +SCRIPTNAME=/etc/init.d/$NAME + +CFEXECD_DAEMON=/usr/sbin/cf-execd +CFSERVERD_DAEMON=/usr/sbin/cf-serverd +CFMONITORD_DAEMON=/usr/sbin/cf-monitord + +#DAEMON_ARGS="--options args" +#PIDFILE=/var/run/$NAME.pid + +# Exit if the package is not installed +[ -x "$CFEXECD_DAEMON" ] || exit 0 +[ -x "$CFSERVERD_DAEMON" ] || exit 0 +[ -x "$CFMONITORD_DAEMON" ] || exit 0 + +# defaults +RUN_CFMONITORD=1 +RUN_CFEXECD=1 +RUN_CFSERVERD=1 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + DAEMON=$1 + DAEMON_NAME=`basename $DAEMON` + PIDFILE="$PIDROOT/$DAEMON_NAME.pid" + + # get the args + [ $DAEMON_NAME = "cf-monitord" ] && DAEMON_ARGS=$CFMONITORD_ARGS + [ $DAEMON_NAME = "cf-serverd" ] && DAEMON_ARGS=$CFSERVERD_ARGS + [ $DAEMON_NAME = "cf-execd" ] && DAEMON_ARGS=$CFEXECD_ARGS + + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + DAEMON=$1 + DAEMON_NAME=`basename $DAEMON` + PIDFILE="$PIDROOT/$DAEMON_NAME.pid" + + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $DAEMON_NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + DAEMON=$1 + DAEMON_NAME=`basename $DAEMON` + PIDFILE="$PIDROOT/$DAEMON_NAME.pid" + + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $DAEMON_NAME + return 0 +} + +# Function to start the cfengine daemons +start_cfengine() { + RETVAL=0 + if [ "$RUN_CFMONITORD" = "1" ]; then + do_start $CFMONITORD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + if [ "$RUN_CFSERVERD" = "1" ]; then + do_start $CFSERVERD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + if [ "$RUN_CFEXECD" = "1" ]; then + do_start $CFEXECD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + + return $RETVAL +} + +# Function to stop the cfengine daemons +stop_cfengine() { + RETVAL=0 + if [ "$RUN_CFEXECD" = "1" ]; then + do_stop $CFEXECD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + if [ "$RUN_CFMONITORD" = "1" ]; then + do_stop $CFMONITORD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + if [ "$RUN_CFSERVERD" = "1" ]; then + do_stop $CFSERVERD_DAEMON + [ $? = "0" ] || RETVAL=$? + fi + + return $RETVAL +} + +# Function to return the status of the cfengine daemons +status_cfengine() { + RETVAL=0 + if [ "$RUN_CFMONITORD" = "1" ]; then + status_of_proc "$CFMONITORD_DAEMON" "cf-monitord" + [ $? = 0 ] || RETVAL=1 + fi + if [ "$RUN_CFSERVERD" = "1" ]; then + status_of_proc "$CFSERVERD_DAEMON" "cf-serverd" + [ $? = 0 ] || RETVAL=1 + fi + if [ "$RUN_CFEXECD" = "1" ]; then + status_of_proc "$CFEXECD_DAEMON" "cf-execd" + [ $? = 0 ] || RETVAL=1 + fi + + return $RETVAL +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + start_cfengine + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + stop_cfengine + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_cfengine + exit $? + ;; + #reload|force-reload) + # + # If do_reload() is not implemented then leave this commented out + # and leave 'force-reload' as an alias for 'restart'. + # + #log_daemon_msg "Reloading $DESC" "$NAME" + #do_reload + #log_end_msg $? + #;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + stop_cfengine + case "$?" in + 0|1) + sleep 8; #otherwise the lock db becomes corrupted + start_cfengine + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- cfengine3-3.0.2+dfsg.orig/debian/rules +++ cfengine3-3.0.2+dfsg/debian/rules @@ -0,0 +1,120 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +else +CROSS= --build $(DEB_BUILD_GNU_TYPE) +endif + +include /usr/share/quilt/quilt.make + +config.status: configure +configure: config-stamp + +config-stamp: $(QUILT_STAMPFN) + dh_testdir + # Add here commands to configure the package. +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + ./configure $(CROSS) --prefix=/usr --with-sql=no --with-workdir=/var/lib/cfengine3 --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" + + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/cfengine.sgml > cfengine.1 + + touch $@ + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + rm -f config.sub config.guess + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/cfengine3. + $(MAKE) DESTDIR=$(CURDIR)/debian/cfengine3 install + + # clean the cfengine share directory and copy over the needed files + /bin/rm $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/*cf + /bin/rm $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/NEWS + /bin/rm $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/INSTALL + /bin/rm $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/README + /bin/rm $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/ChangeLog + /bin/mv $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine/ \ + $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine3/ + /bin/mv $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine3/inputs \ + $(CURDIR)/debian/cfengine3/usr/share/doc/cfengine3/examples + # clean the not-needed static libraries + /bin/rm -rf $(CURDIR)/debian/cfengine3/usr/lib + +# Build architecture-independent files here. +binary-indep: install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python + dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip --dbg-package=cfengine3-dbg + dh_compress -X.cf + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- cfengine3-3.0.2+dfsg.orig/debian/README.Debian +++ cfengine3-3.0.2+dfsg/debian/README.Debian @@ -0,0 +1,30 @@ +There are some tweaks which were applied to the standard cfengine3 installation +and you should be aware of them: + +*) cfengine3 is FHS, that means that, unlike the original, we log in /var/log, +the binaries are located in /usr/sbin and the inputs files are in +/etc/cfengine3; for upstream compatibility we have two symlinks: + +/etc/cfengine3 -> /var/lib/cfengine3/inputs +/usr/sbin -> /var/lib/cfengine3/bin + +*) to enable the daemons you need to modify /etc/default/cfengine3 and set the +proper variables; the daemons won't be started unless there is an +/etc/cfengine3/promises.cf file present; if you want to test that everything is +working you can do: + +cp /usr/share/doc/cfengine3/examples/* /etc/cfengine3/ + +At this point you MUST adapt /etc/cfengine3/site.cf to your needs, you may want +to remove the blank auth for the user 'mark' (the author of cfengine), and +anything that update your config files + +When everything is ready you can start the daemons: +/etc/init.d/cfengine3 start + +*) By default we are not starting any daemon, in most of your installations you +will only need the cfagent with a proper configuration file + +*) For more info you should have a look at the reference manual and the relevant +docs: +http://www.cfengine.org/manuals/cf3-reference.html --- cfengine3-3.0.2+dfsg.orig/debian/repack.sh +++ cfengine3-3.0.2+dfsg/debian/repack.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Repackage upstream source to exclude non-distributable files +# should be called as "repack.sh --upstream-source +# (for example, via uscan) + +set -e +set -u + +VER="$2" +FILE="$3" +PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'` + +REPACK_DIR="$PKG-$VER.orig" # DevRef ยง 6.7.8.2 + +echo -e "\nRepackaging $FILE\n" + +REPACKED_ORIG=`echo $FILE | sed 's/\.orig\./+dfsg.orig./'` + +DIR=`mktemp -d ./tmpRepackXXXXXX` +trap "rm -rf \"$DIR\"" QUIT INT EXIT + +# Create an extra directory to cope with rootless tarballs +UP_BASE="$DIR/unpack" +mkdir "$UP_BASE" +tar xzf "$FILE" -C "$UP_BASE" + +if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then + # Tarball does contain a root directory + UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`" +fi + +## Remove stuff +rm $UP_BASE/docs/ContributorStatement.pdf + +mv "$UP_BASE" "$DIR/$REPACK_DIR" + +# Using a pipe hides tar errors! +tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR" +gzip -9 -n < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz" + +mv "$DIR/repacked.tar.gz" "$REPACKED_ORIG" + +echo "*** $REPACKED_ORIG ready" --- cfengine3-3.0.2+dfsg.orig/debian/README.source +++ cfengine3-3.0.2+dfsg/debian/README.source @@ -0,0 +1,57 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- cfengine3-3.0.2+dfsg.orig/debian/postinst +++ cfengine3-3.0.2+dfsg/debian/postinst @@ -0,0 +1,47 @@ +#!/bin/sh +# postinst script for cfengine +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +INPUTS=/var/lib/cfengine3/inputs + +make_key () { + if [ ! -f /var/lib/cfengine3/ppkeys/localhost.priv ]; then + cf-key + fi +} + +case "$1" in + configure) + make_key + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- cfengine3-3.0.2+dfsg.orig/debian/patches/rename-doesnt-fail +++ cfengine3-3.0.2+dfsg/debian/patches/rename-doesnt-fail @@ -0,0 +1,15 @@ +The purpose of this patch is to backport a fix that is already on upstream +trunk/, the reason is that if rename fails we don't want error messages +(see http://bugs.debian.org/555932) + +--- a/src/item-lib.c ++++ b/src/item-lib.c +@@ -242,7 +242,7 @@ + + if (rename(new,file) == -1) + { +- CfOut(cf_error,"rename","Error while renaming %s\n",file); ++ CfOut(cf_inform,"rename","Error while renaming %s\n",file); + return false; + } + --- cfengine3-3.0.2+dfsg.orig/debian/patches/remove-man-errors +++ cfengine3-3.0.2+dfsg/debian/patches/remove-man-errors @@ -0,0 +1,53 @@ +the docs are autogenerated by -M, it all boils down to this source +file; I'm removing all the man errors from here + +--- a/src/generic_agent.c ++++ b/src/generic_agent.c +@@ -1510,7 +1510,7 @@ + { + if (options[i].has_arg) + { +- printf("--%-12s, -%c value - %s\n",options[i].name,(char)options[i].val,hints[i]); ++ printf("--%-12s, -%c - %s\n",options[i].name,(char)options[i].val,hints[i]); + } + else + { +@@ -1538,12 +1538,12 @@ + printf(".SH SYNOPSIS:\n\n %s [options]\n\n.SH DESCRIPTION:\n\n%s\n",GetArg0(component),id); + + printf(".B cfengine\n" +- "is a self-healing configuration and change management based system. You can think of" ++ "is a self-healing configuration and change management based system. You can think of \n" + ".B cfengine\n" + "as a very high level language, much higher level than Perl or shell. A" + "single statement is called a promise, and compliance can result in many hundreds of files" + "being created, or the permissions of many hundreds of" +- "files being set. The idea of " ++ "files being set. The idea of \n" + ".B cfengine\n" + "is to create a one or more sets of configuration files which will" + "classify and describe the setup of every host in a network.\n"); +@@ -1554,7 +1554,7 @@ + { + if (options[i].has_arg) + { +- printf(".IP \"--%s, -%c\" value\n%s\n",options[i].name,(char)options[i].val,hints[i]); ++ printf(".IP \"--%s, -%c\"\n%s\n",options[i].name,(char)options[i].val,hints[i]); + } + else + { +@@ -1567,10 +1567,10 @@ + ".SH INFORMATION\n"); + + printf("\nBug reports: bug-cfengine@cfengine.org\n"); +-printf(".pp\nCommunity help: help-cfengine@cfengine.org\n"); +-printf(".pp\nCommunity info: http://www.cfengine.org\n"); +-printf(".pp\nSupport services: http://www.cfengine.com\n"); +-printf(".pp\nThis software is (C) 2008- Cfengine AS.\n"); ++printf(".PP\nCommunity help: help-cfengine@cfengine.org\n"); ++printf(".PP\nCommunity info: http://www.cfengine.org\n"); ++printf(".PP\nSupport services: http://www.cfengine.com\n"); ++printf(".PP\nThis software is (C) 2008- Cfengine AS.\n"); + } + + /*******************************************************************/ --- cfengine3-3.0.2+dfsg.orig/debian/patches/cf-monitor-pid +++ cfengine3-3.0.2+dfsg/debian/patches/cf-monitor-pid @@ -0,0 +1,18 @@ +This patch renames the cf-monitor.pid to cf-monitord.pid because +the daemon is called cf-monitord and the init script I wrote needs +a PID in the $DAEMON_NAME.pid format. + +All the other PID's are correctly referring to their repective daemon +names, this bug was notified to upstream + +--- a/src/env_monitor.c ++++ b/src/env_monitor.c +@@ -339,7 +339,7 @@ + return; + } + +-WritePID("cf-monitor.pid"); ++WritePID("cf-monitord.pid"); + + OpenSniffer(); + --- cfengine3-3.0.2+dfsg.orig/debian/patches/fix-error-typos +++ cfengine3-3.0.2+dfsg/debian/patches/fix-error-typos @@ -0,0 +1,13 @@ +to fix a small typo in cf-agent + +--- a/src/agent.c ++++ b/src/agent.c +@@ -920,7 +920,7 @@ + { + if (putenv(s) != 0) + { +- CfOut(cf_inform,"putenv","Failed to set environement %s",s); ++ CfOut(cf_inform,"putenv","Failed to set environment %s",s); + } + } + --- cfengine3-3.0.2+dfsg.orig/debian/patches/series +++ cfengine3-3.0.2+dfsg/debian/patches/series @@ -0,0 +1,6 @@ +remove-man-errors +cf-monitor-pid +fhs-compliance +fix-examples-paths +rename-doesnt-fail +fix-error-typos --- cfengine3-3.0.2+dfsg.orig/debian/patches/fhs-compliance +++ cfengine3-3.0.2+dfsg/debian/patches/fhs-compliance @@ -0,0 +1,72 @@ +A patch to implement various things to be FHS (and Debian policy) +compliant: PID files will go to /var/run; the configuration files +will go to /etc/cfengine3 (same as we did with cfengine2); logs to +/var/log + +That symlink is created by debian/links but we need to remove the +actual creation of the inputs dir any cf-* binary will fail + +--- a/src/generic_agent.c ++++ b/src/generic_agent.c +@@ -359,8 +359,9 @@ + + snprintf(HASHDB,CF_BUFSIZE-1,"%s/%s",CFWORKDIR,CF_CHKDB); + +- snprintf(vbuff,CF_BUFSIZE,"%s/inputs/update.conf",CFWORKDIR); ++ /* snprintf(vbuff,CF_BUFSIZE,"%s/inputs/update.conf",CFWORKDIR); + MakeParentDirectory(vbuff,force); ++ */ + snprintf(vbuff,CF_BUFSIZE,"%s/bin/cf-agent -D from_cfexecd",CFWORKDIR); + MakeParentDirectory(vbuff,force); + snprintf(vbuff,CF_BUFSIZE,"%s/outputs/spooled_reports",CFWORKDIR); +@@ -997,7 +998,7 @@ + FatalError("Uname couldn't get kernel name info!!\n"); + } + +-snprintf(LOGFILE,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename); ++snprintf(LOGFILE,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename); + VSETUIDLOG = strdup(LOGFILE); + + snprintf(vbuff,CF_BUFSIZE,"%s/.",CFWORKDIR); +@@ -1588,7 +1589,7 @@ + + { FILE *fp; + +-snprintf(PIDFILE,CF_BUFSIZE-1,"%s/%s",CFWORKDIR,filename); ++snprintf(PIDFILE,CF_BUFSIZE-1,"/var/run/%s",filename); + + if ((fp = fopen(PIDFILE,"w")) == NULL) + { +--- a/src/agent.c ++++ b/src/agent.c +@@ -280,7 +280,7 @@ + CFA_MAXTHREADS = 30; + EDITFILESIZE = 100000; + +-snprintf(filename,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename); ++snprintf(filename,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename); + + if ((fp = fopen(filename,"a")) == NULL) + { +--- a/src/files_interfaces.c ++++ b/src/files_interfaces.c +@@ -312,7 +312,7 @@ + return; + } + +-snprintf(filename,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename); ++snprintf(filename,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename); + + if (!LoadFileAsItemList(&VSETUIDLIST,filename,a,pp)) + { +--- a/src/transaction.c ++++ b/src/transaction.c +@@ -152,7 +152,7 @@ + sum = (CF_MACROALPHABET * sum + cc_operand[i]) % CF_HASHTABLESIZE; + } + +-snprintf(cflog,CF_BUFSIZE,"%s/cf3.%.40s.runlog",CFWORKDIR,host); ++snprintf(cflog,CF_BUFSIZE,"/var/log/cf3.%.40s.runlog",host); + snprintf(cflock,CF_BUFSIZE,"lock.%.100s.%s.%.100s_%d_%s",pp->bundle,cc_operator,cc_operand,sum,str_digest); + snprintf(cflast,CF_BUFSIZE,"last.%.100s.%s.%.100s_%d_%s",pp->bundle,cc_operator,cc_operand,sum,str_digest); + --- cfengine3-3.0.2+dfsg.orig/debian/patches/fix-examples-paths +++ cfengine3-3.0.2+dfsg/debian/patches/fix-examples-paths @@ -0,0 +1,47 @@ +The purpose of this patch is to fix all the pats according to what was modified +by the fhs-compliance patch; see #552144 for more details + +I'm also removing the auto-update of the binaries because the debian package is +supposed to update the binaries, rather than cf-execd itself + +--- a/inputs/library.cf ++++ b/inputs/library.cf +@@ -109,7 +109,7 @@ + + exec_fix:: + +- "0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/cfengine/bin/cf-execd -F"; ++ "0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/sbin/cf-execd -F"; + + replace_patterns: + +--- a/inputs/update.cf ++++ b/inputs/update.cf +@@ -8,19 +8,12 @@ + + files: + +- "/var/cfengine/inputs" ++ "/var/lib/cfengine3/inputs" + + perms => u_p("600"), + copy_from => mycopy("$(master_location)","localhost"), + depth_search => recurse("inf"), + action => immediate; +- +- "/var/cfengine/bin" +- +- perms => u_p("700"), +- copy_from => mycopy("/usr/local/sbin","localhost"), +- depth_search => recurse("inf"), +- action => immediate; + } + + ############################################ +@@ -55,4 +48,4 @@ + body action immediate + { + ifelapsed => "1"; +-} +\ No newline at end of file ++}