Index: install.sh
--- install.sh.orig	2012-06-30 14:56:00.000000000 +0200
+++ install.sh	2012-10-22 09:06:32.000000000 +0200
@@ -84,7 +84,7 @@
   local s       # Manual section
 
   s=`echo $p | cut -c ${#p}`
-  cat man/$p | sed -e "s/ETC_DIR_PLACEHOLDER/$exp_etcdir/ ; s/BIN_DIR_PLACEHOLDER/$exp_bindir/ ; s/LIB_DIR_PLACEHOLDER/$exp_libdir/ ; s/LOG_DIR_PLACEHOLDER/$exp_logdir/ ; s/MSG_DIR_PLACEHOLDER/$exp_msgdir/ ; s/DOC_DIR_PLACEHOLDER/$exp_docdir/" > $MANDIR/man${s}/$p
+  cat man/$p | sed -e "s/ETC_DIR_PLACEHOLDER/$exp_etcdir/ ; s/BIN_DIR_PLACEHOLDER/$exp_bindir/ ; s/LIB_DIR_PLACEHOLDER/$exp_libdir/ ; s/LOG_DIR_PLACEHOLDER/$exp_logdir/ ; s/MSG_DIR_PLACEHOLDER/$exp_msgdir/ ; s/DOC_DIR_PLACEHOLDER/$exp_docdir/" > $DESTDIR$MANDIR/man${s}/$p
 }
 
 
@@ -125,36 +125,36 @@
   umask 0022
   if [ $update -eq 0 ]; then
     echo "Creating directories..."
-    mkdir -p $ETCDIR
-    mkdir -p $BINDIR
-    mkdir -p $LIBDIR
-    mkdir -p $LOGDIR
-    mkdir -p $MSGDIR/C
-    mkdir -p $MANDIR/man1
-    mkdir -p $MANDIR/man5
-    mkdir -p $DOCDIR
-    mkdir -p $DOCDIR/samples
-    chmod 1777 $LOGDIR
+    mkdir -p $DESTDIR$ETCDIR
+    mkdir -p $DESTDIR$BINDIR
+    mkdir -p $DESTDIR$LIBDIR
+    mkdir -p $DESTDIR$LOGDIR
+    mkdir -p $DESTDIR$MSGDIR/C
+    mkdir -p $DESTDIR$MANDIR/man1
+    mkdir -p $DESTDIR$MANDIR/man5
+    mkdir -p $DESTDIR$DOCDIR
+    mkdir -p $DESTDIR$DOCDIR/samples
+    chmod 1777 $DESTDIR$LOGDIR
   fi
   
   echo "Copying program files..."
-  sed -e "/^\$PREFIX = /d ; s/^\$ETCDIR = .*$/\$ETCDIR = '$exp_etcdir';/ ; s/^\$BINDIR = .*$/\$BINDIR = '$exp_bindir';/ ;s/^\$LIBDIR = .*$/\$LIBDIR = '$exp_libdir';/ ;s/^\$LOGDIR = .*$/\$LOGDIR = '$exp_logdir';/ ;s/^\$MSGDIR = .*$/\$MSGDIR = '$exp_msgdir';/ ;" ccfe.pl > $BINDIR/ccfe
-  chmod 755 $BINDIR/ccfe
+  sed -e "/^\$PREFIX = /d ; s/^\$ETCDIR = .*$/\$ETCDIR = '$exp_etcdir';/ ; s/^\$BINDIR = .*$/\$BINDIR = '$exp_bindir';/ ;s/^\$LIBDIR = .*$/\$LIBDIR = '$exp_libdir';/ ;s/^\$LOGDIR = .*$/\$LOGDIR = '$exp_logdir';/ ;s/^\$MSGDIR = .*$/\$MSGDIR = '$exp_msgdir';/ ;" ccfe.pl > $DESTDIR$BINDIR/ccfe
+  chmod 755 $DESTDIR$BINDIR/ccfe
 
   if [ $update -eq 0 ]; then
-    cp ccfe.conf $ETCDIR/
-    cp msg/C/ccfe $MSGDIR/C/ccfe
+    cp ccfe.conf $DESTDIR$ETCDIR/
+    cp msg/C/ccfe $DESTDIR$MSGDIR/C/ccfe
 
     # Test main menu:
-    mkdir -p $LIBDIR/ccfe
-    cp ccfe.menu $LIBDIR/ccfe
+    mkdir -p $DESTDIR$LIBDIR/ccfe
+    cp ccfe.menu $DESTDIR$LIBDIR/ccfe
     echo "Creating sample file $LIBDIR/ccfe/it_works.txt..."
-    mk_welcome > $LIBDIR/ccfe/it_works.txt
+    mk_welcome > $DESTDIR$LIBDIR/ccfe/it_works.txt
 
     # Demos:
-    cp -r demo.menu $LIBDIR/ccfe
-    cp -r demo.d $LIBDIR/ccfe
-    PATH=$BINDIR:$PATH
+    cp -r demo.menu $DESTDIR$LIBDIR/ccfe
+    cp -r demo.d $DESTDIR$LIBDIR/ccfe
+    PATH=$DESTDIR$BINDIR:$PATH
     export PATH
     cd ccfe-plugin-sysmon
     ./install.sh
@@ -168,14 +168,14 @@
   done
 
   echo "Copying release documentation and samples..."
-  cp README COPYING AUTHORS ChangeLog $DOCDIR/
-  cp -rp ccfe-plugin-sysmon $DOCDIR/samples
-  cp -p ccfe.conf.console $DOCDIR/samples
+  cp README COPYING AUTHORS ChangeLog $DESTDIR$DOCDIR/
+  cp -rp ccfe-plugin-sysmon $DESTDIR$DOCDIR/samples
+  cp -p ccfe.conf.console $DESTDIR$DOCDIR/samples
 
   if [ $update -eq 0 ]; then
     # Save subdirs for future uninstall option:
     echo "Saving install informations..."
-    cat <<EOT > "$ETCDIR/$SAVED_INFO"
+    cat <<EOT > "$DESTDIR$ETCDIR/$SAVED_INFO"
 # Installed on $(date)
 ETCDIR="$ETCDIR"
 BINDIR="$BINDIR"
