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

Index: cfengine3/src/generic_agent.c
===================================================================
--- cfengine3.orig/src/generic_agent.c	2011-05-06 22:24:14.000000000 +0000
+++ cfengine3/src/generic_agent.c	2011-05-06 22:24:25.000000000 +0000
@@ -490,7 +490,6 @@
    CfOut(cf_verbose,"","Work directory is %s\n",CFWORKDIR);
 
    snprintf(HASHDB,CF_BUFSIZE-1,"%s%c%s",CFWORKDIR,FILE_SEPARATOR,CF_CHKDB);
-
    snprintf(vbuff,CF_BUFSIZE,"%s%cinputs%cupdate.conf",CFWORKDIR,FILE_SEPARATOR,FILE_SEPARATOR);
    MakeParentDirectory(vbuff,force);
    snprintf(vbuff,CF_BUFSIZE,"%s%cbin%ccf-agent -D from_cfexecd",CFWORKDIR,FILE_SEPARATOR,FILE_SEPARATOR);
@@ -1211,7 +1210,7 @@
    }
 else
    {
-   snprintf(LOGFILE,CF_BUFSIZE,"%s%ccfagent.%s.log",CFWORKDIR,FILE_SEPARATOR,VSYSNAME.nodename);
+   snprintf(LOGFILE,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename);
    VSETUIDLOG = strdup(LOGFILE);
    }
 
@@ -1762,7 +1761,7 @@
 
 { FILE *fp;
 
-snprintf(PIDFILE,CF_BUFSIZE-1,"%s%c%s",CFWORKDIR,FILE_SEPARATOR,filename);
+snprintf(PIDFILE,CF_BUFSIZE-1,"/var/run/%s",filename);
 
 if ((fp = fopen(PIDFILE,"w")) == NULL)
    {
Index: cfengine3/src/agent.c
===================================================================
--- cfengine3.orig/src/agent.c	2011-05-06 22:12:42.000000000 +0000
+++ cfengine3/src/agent.c	2011-05-06 22:24:25.000000000 +0000
@@ -338,7 +338,7 @@
   status which we need for setting returns
 */
 
-snprintf(filename,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename);
+snprintf(filename,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename);
 MapName(filename);
 
 if ((fp = fopen(filename,"a")) != NULL)
Index: cfengine3/src/files_interfaces.c
===================================================================
--- cfengine3.orig/src/files_interfaces.c	2011-05-06 22:12:42.000000000 +0000
+++ cfengine3/src/files_interfaces.c	2011-05-06 22:24:25.000000000 +0000
@@ -1344,7 +1344,7 @@
 b.edits.backup = cfa_nobackup;
 b.edits.maxfilesize = 1000000;
 
-snprintf(filename,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename);
+snprintf(filename,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename);
 MapName(filename);
 
 if (!LoadFileAsItemList(&VSETUIDLIST,filename,b,pp))
@@ -1364,7 +1364,7 @@
 b.edits.backup = cfa_nobackup;
 b.edits.maxfilesize = 1000000;
 
-snprintf(filename,CF_BUFSIZE,"%s/cfagent.%s.log",CFWORKDIR,VSYSNAME.nodename);
+snprintf(filename,CF_BUFSIZE,"/var/log/cfagent.%s.log",VSYSNAME.nodename);
 MapName(filename);
 
 PurgeItemList(&VSETUIDLIST,"SETUID/SETGID");
Index: cfengine3/src/transaction.c
===================================================================
--- cfengine3.orig/src/transaction.c	2011-05-06 22:12:42.000000000 +0000
+++ cfengine3/src/transaction.c	2011-05-06 22:24:25.000000000 +0000
@@ -158,7 +158,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);
 
