diff --git a/.bltk.metadata b/.bltk.metadata
new file mode 100644
index 0000000..b736c72
--- /dev/null
+++ b/.bltk.metadata
@@ -0,0 +1,4 @@
+b2f0e91e47d520c084886d45d6d1ae0b3bbba4a1 SOURCES/OOCALC_FILE_SAMPLE.ods
+95471e77bcea7b10d33da79d692389632d123b7e SOURCES/OODRAW_FILE_SAMPLE.odg
+cfa9af9dc835a1306f47044f20603ebc87544670 SOURCES/OOWRITER_FILE_SAMPLE.odt
+e836bed25688ff9916a315f41d50f48203b215b7 SOURCES/bltk-1.1.0.tar.gz
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..05e2640
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+SOURCES/OOCALC_FILE_SAMPLE.ods
+SOURCES/OODRAW_FILE_SAMPLE.odg
+SOURCES/OOWRITER_FILE_SAMPLE.odt
+SOURCES/bltk-1.1.0.tar.gz
diff --git a/SOURCES/bltk-1.0.9-bltk_paths.patch b/SOURCES/bltk-1.0.9-bltk_paths.patch
new file mode 100644
index 0000000..00dff31
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-bltk_paths.patch
@@ -0,0 +1,477 @@
+--- orig-1.0.9/tools/analyzer/bltk_plot.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_plot.sh	2009-07-17 11:03:54.822883564 +0200
+@@ -41,23 +41,41 @@
+ 
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
+ }
+ 
+ set_bltk_root
+--- orig-1.0.9/tools/analyzer/bltk_report_check.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_report_check.sh	2009-07-17 11:03:54.824880651 +0200
+@@ -41,26 +41,44 @@
+ 
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
+ }
+ 
+-set_bltk_root
++set_bltk_paths
+ 
+ Failed="Failed !!!"
+ 
+--- orig-1.0.9/tools/analyzer/bltk_report_compress.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_report_compress.sh	2009-07-17 11:03:54.818881008 +0200
+@@ -41,27 +41,44 @@
+ 
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
+-	export BLTK_GET_REALPATH=$BLTK_BIN/bltk_get_realpath
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
+ }
+ 
+-set_bltk_root
++set_bltk_paths
+ 
+ CWD=$PWD
+ 
+--- orig-1.0.9/tools/analyzer/bltk_report.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_report.sh	2009-07-17 11:03:54.820880959 +0200
+@@ -38,29 +38,51 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
+-
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
+-
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
+-}
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-set_bltk_root
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
++}
++
++set_bltk_paths
++
++if [ ! $? = 0 ]; then
++  echo "ERROR in setting environmental paths" >&2
++  exit 1
++fi
+ 
+ BLTK_GET_STAT_CMD="$BLTK_BIN/bltk_get_stat $stat_ign_lines_arg"
+ BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
+--- orig-1.0.9/tools/analyzer/bltk_report_table.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_report_table.sh	2009-07-17 11:03:54.823880990 +0200
+@@ -41,26 +41,44 @@
+ 
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
+ }
+ 
+-set_bltk_root
++set_bltk_paths
+ 
+ BLTK_REPORT=$BLTK_BIN/bltk_report
+ 
+--- orig-1.0.9/tools/analyzer/bltk_report_uncompress.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/bltk_report_uncompress.sh	2009-07-17 11:03:54.837880784 +0200
+@@ -41,27 +41,44 @@
+ 
+ unalias -a
+ 
+-set_bltk_root()
++set_bltk_paths()
+ {
+-	PROG=`basename $0`
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
+-	export BLTK_GET_REALPATH=$BLTK_BIN/bltk_get_realpath
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
+ }
+ 
+-set_bltk_root
++set_bltk_paths
+ 
+ CWD=$PWD
+ 
+--- orig-1.0.9/tools/analyzer/bltk_func.sh	1970-01-01 01:00:00.000000000 +0100
++++ curr-1.0.9-1/tools/analyzer/bltk_func.sh	2009-07-17 11:03:54.824880651 +0200
+@@ -0,0 +1,77 @@
++#!/bin/bash
++#
++# Copyright (c) 2009 Red Hat Inc.
++# Copyright (c) 2009 Jiri Skala <jskala@redhat.com>
++# All rights reserved.
++#
++# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions
++# are met:
++#
++#   Redistributions of source code must retain the above copyright notice,
++#   this list of conditions and the following disclaimer.
++#
++#   Redistributions in binary form must reproduce the above copyright
++#   notice, this list of conditions and the following disclaimer in the
++#   documentation and/or other materials provided with the distribution.
++#
++#   Neither the name of Intel Corporation nor the names of its contributors
++#   may be used to endorse or promote products derived from this software
++#   without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
++#
++# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
++# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
++# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
++# DAMAGE.
++#
++# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++#
++
++set_bltk_paths()
++{
++  WHICH_BLTK=`which bltk`
++  RETCODE=$?
++
++  if [[ $RETCODE = 0 ]]
++  then
++    file -b $WHICH_BLTK | grep symbolic > /dev/null
++    TMPCODE=$?
++    if [[ $TMPCODE = 0 ]]
++    then
++      BLTK_MAIN=`readlink -f $WHICH_BLTK`
++    else
++      BLTK_MAIN=$WHICH_BLTK
++    fi
++    BLTK_ROOT=`echo $BLTK_MAIN | sed 's|/bin/.*$||'`
++
++    root_len=`echo $BLTK_ROOT | wc -c`
++    main_len=`echo $BLTK_MAIN | wc -c`
++    
++    if [[ $root_len = $main_len ]]
++    then
++      RETCODE=2
++    else
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
++      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
++
++      export BLTK_ROOT
++      export BLTK_BIN=$BLTK_ROOT/bin
++      export BLTK_TMP=$BLTK_HOME/tmp
++    fi
++  fi
++
++  return $RETCODE
++}
++
+--- orig-1.0.9/tools/analyzer/Makefile	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/analyzer/Makefile	2009-07-17 11:03:54.826913428 +0200
+@@ -15,7 +15,7 @@
+ 
+ SHFILES		= bltk_get_stat bltk_report bltk_report_table bltk_report_check \
+ 			bltk_plot bltk_get_hd_rpm \
+-			bltk_report_compress bltk_report_uncompress
++			bltk_report_compress bltk_report_uncompress bltk_func
+ SHFILES_SH	= ${SHFILES:=.sh}
+ SHTARGETS	= $(SHFILES:%=$(BIN)/%)
+ 
diff --git a/SOURCES/bltk-1.0.9-conf.patch b/SOURCES/bltk-1.0.9-conf.patch
new file mode 100644
index 0000000..e8c1291
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-conf.patch
@@ -0,0 +1,514 @@
+diff -up /dev/null bltk/include/parseconf.h
+--- /dev/null	2009-07-29 07:53:51.640007938 +0200
++++ bltk/include/parseconf.h	2009-07-29 11:14:00.913495946 +0200
+@@ -0,0 +1,61 @@
++/*
++ *  Copyright (c) 2009 Red Hat Inc.
++ *  Copyright (c) 2009 Jiri Skala <jskala@redhat.com>
++ *  All rights reserved.
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ *
++ *  Redistribution and use in source and binary forms, with or without
++ *  modification, are permitted provided that the following conditions
++ *  are met:
++ *
++ *    Redistributions of source code must retain the above copyright notice,
++ *    this list of conditions and the following disclaimer.
++ *
++ *    Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ *    Neither the name of Intel Corporation nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
++ *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
++ *  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++ *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
++ *  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
++ *  DAMAGE.
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ */
++
++#ifndef __PARSECONF_H__
++#define __PARSECONF_H__
++
++extern char *bltk_home;
++extern char *soffice_prog;
++extern char *wl_office_working_dir;
++extern char *bltk_player_prog;
++extern char *bltk_player_file;
++extern char *bltk_reader_prog;
++
++extern int wl_developer_enabled;
++extern int wl_developer_extern;
++extern int wl_game_enabled;
++extern int wl_game_extern;
++extern int wl_office_enabled;
++extern int wl_office_extern;
++extern int wl_player_enabled;
++extern int wl_player_extern;
++extern int wl_reader_enabled;
++extern int wl_reader_extern;
++
++#endif
++
+diff -up bltk/tools/bltk/main.c.conf bltk/tools/bltk/main.c
+--- bltk/tools/bltk/main.c.conf	2009-04-10 09:14:20.000000000 +0200
++++ bltk/tools/bltk/main.c	2009-07-29 11:15:27.694746739 +0200
+@@ -57,6 +57,7 @@
+ #include <ctype.h>
+ 
+ #include "bltk.h"
++#include "parseconf.h"
+ 
+ #define	OUTPUT_CONSOLE		10
+ #define	OUTPUT_FILE		20
+@@ -960,12 +961,13 @@ static int environment_init(int argc, ch
+ 	char str[STR_LEN];
+ 	int ret, i;
+ 
+-	(void)unlink(LAST_RESULTS);
+-	ret = symlink(results, LAST_RESULTS);
++	sprintf(str, "%s/%s", bltk_home, LAST_RESULTS);
++	(void)unlink(str);
++	ret = symlink(results, str);
+ 	if (ret != 0) {
+ 		(void)sprintf(prt_str, "symlink(%s, %s) failed, "
+ 			      "errno %d (%s)\n",
+-			      results, LAST_RESULTS, errno, strerror(errno));
++			      results, str, errno, strerror(errno));
+ 		write_to_err_log(prt_str);
+ 		prog_exit(1);
+ 	}
+@@ -987,6 +989,7 @@ static int environment_init(int argc, ch
+ 	(void)sprintf(fail_fname, "%s/fail", results);
+ 	(void)sprintf(pass_fname, "%s/pass", results);
+ 	prog_putenv("BLTK_FAIL_FNAME", fail_fname);
++	prog_putenv("BLTK_STOP_FNAME", stop_fname);
+ 	prog_putenv("BLTK_PASS_FNAME", pass_fname);
+ 
+ 	(void)sprintf(err_log_fname, "%s/err.log", results);
+@@ -1041,10 +1044,12 @@ static int environment_init(int argc, ch
+ 	}
+ 	(void)strcat(cmdline, "'");
+ 
+-	(void)sprintf(cmd, "%s >>history", cmdline);
++	sprintf(str, "%s/%s", bltk_home, HISTORY);
++	(void)sprintf(cmd, "%s >>%s", cmdline, str);
+ 	(void)prog_system(cmd);
+ 
+-	(void)sprintf(cmd, "%s >last_cmd", cmdline);
++	sprintf(str, "%s/%s", bltk_home, LAST_CMD);
++	(void)sprintf(cmd, "%s >%s", cmdline, str);
+ 	(void)prog_system(cmd);
+ 
+ 	(void)sprintf(cmd, "%s >%s/cmd", cmdline, results);
+@@ -1078,7 +1083,7 @@ static int environment_init(int argc, ch
+ 	set_signal(SIGUSR2);
+ 	set_signal(SIGHUP);
+ 
+-	(void)sprintf(cmd, "mkdir -p -m 0777 %s/tmp", bltk_root);
++	(void)sprintf(cmd, "mkdir -p -m 0777 %s/tmp", bltk_home);
+ 	ret = prog_system(cmd);
+ 	if (ret != 0) {
+ 		(void)sprintf(prt_str, "%s failed\n", cmd);
+@@ -1608,6 +1613,28 @@ static char *get_bltk_root_by_argv0(char
+ 	return (wp1);
+ }
+ 
++static char *get_bltk_root_by_proc()
++{
++	char str[256], *path, *ret=NULL;
++
++	snprintf(str, sizeof str, "/proc/%d/exe", getpid());
++	if (readlink(str, str, sizeof str) > -1)
++	{
++		if ((path = dirname(str)))
++		{
++			// take one folder higher
++			ret = strrchr(path, '/');
++			if (ret != NULL)
++			{
++				*ret = 0;
++				ret = path;
++			}
++		}
++	}
++
++	return ret ? strdup(ret) : ret;
++}
++
+ static char *get_bltk_root_by_path(char *argv0)
+ {
+ 	char *path, *dpath, *res;
+@@ -1648,7 +1675,7 @@ static void set_bltk_root(char *argv0)
+ 	int ret;
+ 	char cwd[STR_LEN];
+ 
+-	wp1 = check_bltk_root(".");
++	wp1 = get_bltk_root_by_proc();
+ 	if (wp1 == NULL) {
+ 		wp1 = get_bltk_root_by_argv0(argv0);
+ 	}
+@@ -1792,6 +1819,12 @@ int main(int argc, char **argv)
+ 	(void)umask(0);
+ 	(void)set_path(0);
+ 
++	param_init();
++
++	prog_putenv("BLTK_HOME", bltk_home);
++	prog_putenv("WL_OFFICE_WORKING_DIR", wl_office_working_dir);
++	prog_putenv("WL_READER_WORKING_DIR", wl_office_working_dir);
++
+ 	time_start = time_prev = prog_time();
+ 
+ 	(void)prog_system("xset dpms 0 0 0 >/dev/null 2>&1");
+@@ -2125,7 +2158,7 @@ int main(int argc, char **argv)
+ 			    ("getcwd() failed, cannot continue the test\n");
+ 			prog_exit(1);
+ 		}
+-		(void)sprintf(results_str, "%s/%s", results_parent, results);
++		(void)sprintf(results_str, "%s/%s", bltk_home, results);
+ 		results = results_str;
+ 	}
+ 
+diff -up bltk/tools/bltk/Makefile.conf bltk/tools/bltk/Makefile
+--- bltk/tools/bltk/Makefile.conf	2009-04-10 09:14:20.000000000 +0200
++++ bltk/tools/bltk/Makefile	2009-07-29 11:14:00.917495009 +0200
+@@ -4,12 +4,12 @@ CFLAGS		= -Wall -pedantic -std=c99 -g -O
+ 
+ BIN		= ../../bin
+ 
+-FILES		= main init file stat
++FILES		= main init file stat parseconf
+ 
+ OFILES		= ${FILES:=.o}
+ CFILES		= ${FILES:=.c}
+ 
+-HIDERS		= ../../include/bltk.h
++HIDERS		= ../../include/bltk.h ../../include/parseconf.h
+ 
+ TARGETS		= $(BIN)/bltk
+ 
+@@ -38,6 +38,7 @@ main.o : $(HIDERS) main.c
+ init.o : $(HIDERS) init.c
+ file.o : $(HIDERS) file.c
+ stat.o : $(HIDERS) stat.c
++parseconf.o : $(HIDERS) parseconf.c
+ 
+ $(SHTARGETS) : $(SHFILES_SH)
+ 	cp $(@:$(BIN)/%=%.sh) $@
+diff -up /dev/null bltk/tools/bltk/parseconf.c
+--- /dev/null	2009-07-29 07:53:51.640007938 +0200
++++ bltk/tools/bltk/parseconf.c	2009-07-29 11:14:00.921494700 +0200
+@@ -0,0 +1,299 @@
++/*
++ *  Copyright (c) 2009 Red Hat Inc.
++ *  Copyright (c) 2009 Jiri Skala <jskala@redhat.com>
++ *  All rights reserved.
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ *
++ *  Redistribution and use in source and binary forms, with or without
++ *  modification, are permitted provided that the following conditions
++ *  are met:
++ *
++ *    Redistributions of source code must retain the above copyright notice,
++ *    this list of conditions and the following disclaimer.
++ *
++ *    Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ *    Neither the name of Intel Corporation nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
++ *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
++ *  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++ *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
++ *  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
++ *  DAMAGE.
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ */
++
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <errno.h>
++#include <ctype.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++
++#include "bltk.h"
++
++#define BLTK_CONF                   "/etc/bltk.conf"
++
++typedef struct para_item_str_t
++{
++	const char *name;
++	char **val;
++	size_t len;
++} para_item_str;
++
++typedef struct para_item_int_t
++{
++	const char *name;
++	int *val;
++} para_item_int;
++
++typedef struct para_item_bool_t
++{
++	const char *name;
++	int *val;
++} para_item_bool;
++
++char *bltk_home;
++char *soffice_prog;
++char *wl_office_working_dir;
++char *bltk_player_prog;
++char *bltk_player_file;
++char *bltk_reader_prog;
++char *bltk_reader_file;
++
++int wl_developer_enabled;
++int wl_developer_extern;
++int wl_game_enabled;
++int wl_game_extern;
++int wl_office_enabled;
++int wl_office_extern;
++int wl_player_enabled;
++int wl_player_extern;
++int wl_reader_enabled;
++int wl_reader_extern;
++
++static para_item_str params_str[] =
++{
++	{ "BLTK_HOME", &bltk_home, 0 },
++	{ "SOFFICE_PROG", &soffice_prog, 0 },
++	{ "WL_OFFICE_WORKING_DIR", &wl_office_working_dir, 0 },
++	{ "BLTK_PLAYER_PROG", &bltk_player_prog, 0 },
++	{ "BLTK_PLAYER_FILE", &bltk_player_file, 0 },
++	{ "BLTK_READER_PROG", &bltk_reader_prog, 0 },
++	{ "BLTK_READER_FILE", &bltk_reader_file, 0 },
++  { NULL, NULL, 0 }
++};
++
++static para_item_int params_int[] =
++{
++  { NULL, 0 }
++};
++
++static para_item_bool params_bool[] =
++{
++	{ "WL_DEVELOPER_ENABLED", &wl_developer_enabled },
++	{ "WL_DEVELOPER_EXTERN", &wl_developer_extern },
++	{ "WL_GAME_ENABLED", &wl_game_enabled },
++	{ "WL_GAME_EXTERN", &wl_game_extern },
++	{ "WL_OFFICE_ENABLED", &wl_office_enabled },
++	{ "WL_OFFICE_EXTERN", &wl_office_extern },
++	{ "WL_PLAYER_ENABLED", &wl_player_enabled },
++	{ "WL_PLAYER_EXTERN", &wl_player_extern },
++	{ "WL_READER_ENABLED", &wl_reader_enabled },
++	{ "WL_READER_EXTERN", &wl_reader_extern },
++  { NULL, 0 }
++};
++
++
++char *
++strupper(char *str)
++{
++  int i;
++  for (i=0; i < strlen(str); i++)
++    str[i] = (char)toupper(str[i]);
++  return str;
++}
++
++int
++param_find_str(const char *name)
++{
++  int i;
++  for (i=0;
++    params_str[i].name != NULL && strcmp(name, params_str[i].name) != 0;
++    i++) ;
++  return params_str[i].name == NULL ? -1 : i;
++}
++
++int
++param_find_int(const char *name)
++{
++  int i;
++  for (i=0;
++    params_int[i].name != NULL && strcmp(name, params_int[i].name) != 0;
++    i++) ;
++  return params_int[i].name == NULL ? -1 : i;
++}
++
++int
++param_find_bool(const char *name)
++{
++  int i;
++  for (i=0;
++    params_bool[i].name != NULL && strcmp(name, params_bool[i].name) != 0;
++    i++) ;
++  return params_bool[i].name == NULL ? -1 : i;
++}
++
++int
++line_empty_or_spaces(const char *line)
++{
++  int i;
++  for (i=0; line[i] > 0 && line[i] <= ' ' && i < strlen(line); i++) ;
++  return line[i] == 0;
++}
++
++int
++line_commented(const char *line)
++{
++  int i;
++  for (i=0; line[i] > 0 && line[i] <= ' ' && i < strlen(line); i++) ;
++  return line[i] == '#';
++}
++
++int
++param_parse_line(const char *line, char *name, char *val)
++{
++  char *str, *str1;
++  int ret=-1;
++
++  str = strdup(line);
++  if ((str1 = strchr(str, '=')) != NULL)
++  {
++    *str1 = 0;
++    str1++;
++    strcpy(val, str1);
++    strcpy(name, str);
++    ret = 0;
++  }
++  else
++  {
++    fprintf(stderr, "Incorrect line in the %s\n", BLTK_CONF);
++  } 
++  free (str);
++  return ret;
++}
++
++void
++param_export_value(const char *name)
++{
++	char expval[STR_LEN];
++  int index;
++
++  if ((index = param_find_str(name)) > -1)
++	  snprintf(expval, STR_LEN, "%s=%s", name, *(params_str[index].val));
++  else if ((index = param_find_int(name)) > -1)
++	  snprintf(expval, STR_LEN, "%s=%d", name, *(params_int[index].val));
++  else if ((index = param_find_bool(name)) > -1)
++	  snprintf(expval, STR_LEN, "%s=%s", name, *(params_bool[index].val) ? "YES": "NO");
++
++  if (index > -1)
++    putenv(strdup(expval));
++  else
++    fprintf(stderr, "Undefined parameter (%s)\n", name);
++}
++
++void
++param_load_conf()
++{
++  char str[STR_LEN];
++  char name[STR_LEN], val[STR_LEN];
++  int index, len;
++	FILE *f;
++
++  if ((f = fopen(BLTK_CONF, "rt")) != NULL)
++  {
++    while (fgets(str, STR_LEN, f) != NULL)
++    {
++      if ((len = strlen(str)) > 0 && str[len-1] == '\n')
++        str[len-1] = 0;
++      if (line_empty_or_spaces(str) || line_commented(str))
++        continue;
++
++      param_parse_line(str, name, val);
++
++      if ((index = param_find_str(name)) > -1)
++        *(params_str[index].val) = strdup(val);
++      else if ((index = param_find_int(name)) > -1)
++        *(params_int[index].val) = atoi(val);
++      else if ((index = param_find_bool(name)) > -1)
++      {
++        if (!strcmp(strupper(val), "YES") ||
++            !strcmp(strupper(val), "TRUE") ||
++            val[0] == '1')
++          *(params_bool[index].val) = 1;
++        else if (!strcmp(strupper(val), "NO") ||
++            !strcmp(strupper(val), "FALSE") ||
++            val[0] == '0')
++          *(params_bool[index].val) = 0;
++      }
++    }
++
++    fclose(f);
++  }
++}
++
++void
++param_load_defaults()
++{
++  char str[STR_LEN];
++
++  if (bltk_home == NULL)
++  {
++    sprintf(str, "%s/.bltk", getenv("HOME"));
++    bltk_home = strdup(str);
++  } else if (bltk_home[0] == '~') {
++    sprintf(str, "%s%s", getenv("HOME"), bltk_home+1);
++    free(bltk_home);
++    bltk_home = strdup(str);
++  }
++
++  if (access(bltk_home, 0) != 0)
++    mkdir(bltk_home, 0700);
++
++  if (wl_office_working_dir == NULL)
++    wl_office_working_dir = strdup(bltk_home);
++
++  if (access(wl_office_working_dir, 0) != 0)
++  {
++    if (wl_office_working_dir[0] == '~')
++    {
++      sprintf(str, "%s%s", getenv("HOME"), wl_office_working_dir+1);
++      free(wl_office_working_dir);
++      wl_office_working_dir = strdup(str);
++    }
++    mkdir(wl_office_working_dir, 0700);
++  }
++}
++
++void
++param_init()
++{
++  param_load_conf();
++  param_load_defaults();
++}
++
diff --git a/SOURCES/bltk-1.0.9-conf_home.patch b/SOURCES/bltk-1.0.9-conf_home.patch
new file mode 100644
index 0000000..d8fd3bf
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-conf_home.patch
@@ -0,0 +1,48 @@
+diff -up bltk-1.0.9/tools/bltk/parseconf.c.conf_home bltk-1.0.9/tools/bltk/parseconf.c
+--- bltk-1.0.9/tools/bltk/parseconf.c.conf_home	2009-07-31 10:11:51.812041537 +0200
++++ bltk-1.0.9/tools/bltk/parseconf.c	2009-07-31 10:14:00.747294693 +0200
+@@ -47,7 +47,8 @@
+ 
+ #include "bltk.h"
+ 
+-#define BLTK_CONF                   "/etc/bltk.conf"
++#define BLTK_CONF                   "bltk.conf"
++#define BLTK_HOME                   ".bltk"
+ 
+ typedef struct para_item_str_t
+ {
+@@ -221,12 +222,24 @@ void
+ param_load_conf()
+ {
+   char str[STR_LEN];
++  char conf_file[STR_LEN];
+   char name[STR_LEN], val[STR_LEN];
+   int index, len;
+ 	FILE *f;
+ 
+-  if ((f = fopen(BLTK_CONF, "rt")) != NULL)
++
++  sprintf(conf_file, "%s/%s/%s", getenv("HOME"), BLTK_HOME, BLTK_CONF);
++  if ((f = fopen(conf_file, "rt")) == NULL)
+   {
++    sprintf(conf_file, "/etc/%s", BLTK_CONF);
++    f = fopen(conf_file, "rt");
++  }
++
++  if (f != NULL)
++  {
++    sprintf(str, "BLTK_CONF=%s", conf_file);
++    putenv(strdup(str));
++
+     while (fgets(str, STR_LEN, f) != NULL)
+     {
+       if ((len = strlen(str)) > 0 && str[len-1] == '\n')
+@@ -264,7 +277,7 @@ param_load_defaults()
+ 
+   if (bltk_home == NULL)
+   {
+-    sprintf(str, "%s/.bltk", getenv("HOME"));
++    sprintf(str, "%s/%s", getenv("HOME"), BLTK_HOME);
+     bltk_home = strdup(str);
+   } else if (bltk_home[0] == '~') {
+     sprintf(str, "%s%s", getenv("HOME"), bltk_home+1);
diff --git a/SOURCES/bltk-1.0.9-home_dir.patch b/SOURCES/bltk-1.0.9-home_dir.patch
new file mode 100644
index 0000000..8dfac79
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-home_dir.patch
@@ -0,0 +1,44 @@
+--- orig-1.0.9/tools/bltk/bltk_get_dmidecode.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_get_dmidecode.sh	2009-07-17 11:03:54.741146665 +0200
+@@ -76,7 +76,7 @@
+ 	shift $((OPTIND-1))
+ 
+ 	DMIDECODE=$*
+-	TMP_FILE=$BLTK_ROOT/tmp/dmidecode
++	TMP_FILE=$BLTK_HOME/tmp/dmidecode
+ 
+ 	if [[ -z $DMIDECODE ]]
+ 	then
+--- orig-1.0.9/tools/bltk/bltk_get_lspci.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_get_lspci.sh	2009-07-17 11:03:54.739159007 +0200
+@@ -56,7 +56,7 @@
+ 	echo "$PROG: Warning: $*" >&2
+ }
+ 
+-TMP_FILE=$BLTK_ROOT/tmp/lspci
++TMP_FILE=$BLTK_HOME/tmp/lspci
+ 
+ if [[ -z $LSPCI ]]
+ then
+--- orig-1.0.9/tools/bltk/bltk_get_user_field.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_get_user_field.sh	2009-07-17 11:03:54.789920943 +0200
+@@ -57,7 +57,7 @@
+ FIELD_NO=$1
+ DELIM=$1
+ 
+-TMP_FILE=$BLTK_ROOT/tmp/hdparm
++TMP_FILE=$BLTK_HOME/tmp/hdparm
+ 
+ #str=`df -lk / | grep -v ^Filesystem`
+ str=`df -lk / | grep ^/dev/`
+--- orig-1.0.9/tools/bltk/bltk_get_xdpyinfo.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_get_xdpyinfo.sh	2009-07-17 11:03:54.764879831 +0200
+@@ -42,7 +42,7 @@
+ unalias -a
+ 
+ XDPYINFO=$1
+-TMP_FILE=$BLTK_ROOT/tmp/xdpyinfo
++TMP_FILE=$BLTK_HOME/tmp/xdpyinfo
+ 
+ if [[ -z $XDPYINFO ]]
+ then
diff --git a/SOURCES/bltk-1.0.9-installed.patch b/SOURCES/bltk-1.0.9-installed.patch
new file mode 100644
index 0000000..d9d6d34
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-installed.patch
@@ -0,0 +1,30 @@
+--- orig-1.0.9/tools/bltk/bltk_check.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_check.sh	2009-07-17 11:03:54.764879831 +0200
+@@ -38,6 +38,7 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
+ 
+ source `dirname $0`/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+@@ -120,7 +121,7 @@
+ 	wl=${WLA[wl_cnt]}
+ 	WL_RES=$RES/$wl.results
+ 	echo "=== Workload '$wl'"
+-	if [[ ! -f $BLTK_ROOT/wl_$wl/.installed && $wl != idle && $wl != reader ]]
++	if [[ $CHK_INSTALLED = "YES" && ! -f $BLTK_ROOT/wl_$wl/.installed && $wl != idle && $wl != reader ]]
+ 	then
+ 		echo "not installed";
+ 		WLR[wl_cnt]="not installed"
+--- orig-1.0.9/tools/bltk/bltk_wl_common.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_wl_common.sh	2009-07-17 11:03:54.742158129 +0200
+@@ -374,7 +375,7 @@
+ {
+ 	typeset wl=$1
+ 
+-	if [[ ! -a $BLTK_WL_INSTALL_FILE ]]
++	if [[ $CHK_INSTALLED = "YES" && ! -a $BLTK_WL_INSTALL_FILE ]]
+ 	then
+ 		wl_error_msg "Installation is not completed, perform 'make install-$wl'"
+ 		return 1
diff --git a/SOURCES/bltk-1.0.9-man.patch b/SOURCES/bltk-1.0.9-man.patch
new file mode 100644
index 0000000..3056d70
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-man.patch
@@ -0,0 +1,562 @@
+--- curr-1.0.9/doc/bltk.1	1970-01-01 01:00:00.000000000 +0100
++++ curr-1.0.9-1/doc/bltk.1	2009-07-21 14:17:29.191118317 +0200
+@@ -0,0 +1,313 @@
++.TH BLTK 1 "15 July 2008" "BLTK" "Battery life tool kit"
++.SH NAME
++bltk \- tool kit is used to measure battery life and performance under
++different workloads on Linux.
++.SH SYNOPSIS
++.B bltk
++[\-hVvaNAcCBXswiIRDPGOYZyQzxul] [\-t sec] [\-r results_dir]
++[\-m {0,1}] [\-U path] [\-g setup] [\-J pid] [\-T time]
++[\-F file] [\-W app] [\-L title] [\-K comment] [\-e app]
++[\-E app] [\-p percent] [\-d percent] [\-o {0,1,2}] [\-q file]
++[\-b percent] [\-f command] [\-k num]
++.SH DESCRIPTION
++\fBThe BLTK\fR can be used with various workloads to simulate different types of laptop usage.  The following workloads are currently implemented:
++.RS
++.TP
++\fBIdle workload\fR
++collect statistics only (mostly used to measure battery life)
++.TP
++\fBDeveloper workload\fR
++simulates code development in Linux environment
++.TP
++\fBReader workload\fR
++simulates text reading on laptop (mostly used to measure battery life)
++.TP
++\fBPlayback workload\fR
++simulates laptop entertaining usage (produces constant average load on the system)
++.TP
++\fB3d game workload\fR
++simulates 3D-gaming on laptop (Unreal Tournament demo is used to create this workload)
++.TP
++\fBOffice Activity workload\fR
++simulates laptop usage for different office activities (based on OpenOffice.org office suit)
++.RE
++.PP
++When started, test collects platform/OS initial info and if it's OK prompts
++user to unplug AC adapter. After cable unplugged, workload started. During the
++workload execution test harness collects various system information (e.g.
++CPU load, battery drain, display state, CPU frequency, etc...). After battery
++completely discharged user should plug the AC cable back and boot the system.
++When it is done the results are available.
++.PP
++There are several tools for result evaluation. They allow creating report file
++for test run, to gather results into a table for system comparison, and
++to draw graphs for different purposes.
++.PP
++\fBResults\fR \- after the battery dies and the system booted back, the results are
++available. They are stored in 'bltk/<wokload_name>.results' directory (or in the directory, specified in \-r option). If target directory already exist the tool
++will add numeric extension to its name (.001, .002 e.t.c.) The results consist of the
++following files (see below for detailed description):
++.TP
++.B cmd
++In this file 'bltk' command with arguments are stored
++.TP
++.B infoi<N>.log (info1.log, info2.log, ...)
++Here initial system info is stored. Another two files (info1.log,
++info2.log) contains system info after AC adapter was unplugged, and on 5%
++battery capacity remained. They are used to check whether any changes occurred
++during test execution.
++.TP
++.B stat.log
++Statistics generated by bltk harness are stored here. One statistic line generated per 1 minute (or per number of seconds, specified in -t option).
++.TP
++.B system<N>
++When -k 1 is used, the system information is stored under this directory. The numbers at the end of directory name have the following meanings:
++.RS
++.TP
++.B 0
++initial system info 
++.TP
++.B 1
++system info after AC adapter was unplugged
++.TP
++.B 2
++system info on 5% battery capacity remained
++.RE
++.TP
++.B version
++this file contains version information
++.TP
++.B workload
++the file contains info about workload
++.TP
++.B work_out.log
++.TP
++.B err.log
++There are stored any error messages
++.TP
++.B warning.log
++Contains warnings
++.TP
++.B work.log
++Strings generated by USR1, USR2 signals from workload. String format is the same as in the 'stat.log' file.
++.TP
++.B fail
++when test fails
++.TP
++.B score
++.TP
++.B Report
++.TP
++.B Report.table
++.SH OPTIONS
++.TP
++.BR "\-h" , " \--help"
++Help; display a help message and then exits.
++.TP
++.BR "\-V", " \--version"
++Version; display version number and then exits.
++.TP
++.BR "\-v", " \--verbose"
++Verbose
++.TP
++.BR "\-a", " \--ac-ignore"
++ignore ac adapter state check (on/off)
++.TP
++.BR "\-N", " \--time-stat-ignore"
++disable time statistics
++.TP
++.BR "\-A", " \--ac-stat-ignore"
++disable ac adapter statistics
++.TP
++.BR "\-c", " \--cpu-stat-ignore"
++disable cpu load statistics
++.TP
++.BR "\-C", " \--cpu-add-stat-ignore"
++disable cpu additional statistics
++.TP
++.BR "\-B", " \--bat-stat-ignore"
++disable battery statistics
++.TP
++.BR "\-X", " \--disp-stat-ignore"
++Disable display state statistics
++.TP
++.BR "\-H", " \--hd-stat-ignore"
++disable hard drive state statistics
++.TP
++.BR "\-t " seconds, " \--report-time " seconds
++frequency of report line generation in seconds
++.TP
++.BR "\-r " results_dir, " \--results " results_dir
++name of results directory
++.TP
++.BR "\-s", " \--stat-ignore"
++disable all statistics
++.TP
++.BR "\-w", " \--work-stat-ignore"
++disable workload statistics
++.TP
++.BR "\-m " {0,1}, " \--stat-memory " {0,1}
++dump statistics directly on disk or keep in memory, if statistics are kept in memory, it will be dumped	on disk at low battery capacity, or at the test end
++.RS
++.TP
++.B 0
++disk
++.TP
++.B 1
++memory (by default)
++.RE
++.TP
++.BR "\-i", " \--idle-test"
++idle test
++.TP
++.BR "\-I", " \--idle"
++idle workload
++.TP
++.BR "\-R", " \--reader"
++reader workload
++.TP
++.BR "\-D", " \--developer"
++developer workload
++.TP
++.BR "\-P", ' \--player"
++playback workload
++.TP
++.BR "\-G", " \--game"
++3D-gaming workload
++.TP
++.BR "\-O", " \--office"
++office productivity workload
++.TP
++.BR "\-U " path, " \--user " path
++user-specified workload (path to executable)
++.TP
++.BR "\-g " routine, " \--user-init " routine"
++setup routines for user-specified workload
++.TP
++.BR "\-Y", " \--discharging"
++battery discharge mode
++.TP
++.BR "\-Z", " \--charging"
++battery charge mode
++.TP
++.BR "\-J " pid, " \--jobs " pid
++make jobs number
++.TP
++.BR "\-T " seconds, " \--time " seconds
++workload time
++.TP
++.BR "\-F", " \--file"
++workload file
++.TP
++.BR "\-W", " \--prog"
++workload program
++	name of player (player workload, default 'mplayer')
++	name of web-browser (reader workload, default 'firefox')
++.TP
++.BR "\-L", " \--title"
++title of web-browser document
++.TP
++.BR "\-M", " \--manufacturer"
++enable time and cpu load statistics only
++.TP
++.BR "\-S", " \--show"
++demo/debug mode, one iteration only
++.TP
++.BR "\-n", " \--show-num"
++demo/debug mode, 'show-num' iteration
++.TP
++.BR "\-j", " \--show-cnt"
++demo/debug mode, 'show-cnt' sub iteration
++.TP
++.BR "\-T " seconds, " \--show-time " seconds
++demo/debug mode, debug time
++.TP
++.BR "\-K " comment, " \--comment " comment
++user comment for report
++.TP
++.BR "\-e " application, " \--init-prog " application
++run program before test starting
++.TP
++.BR "\-E " application, " \--init-prog-su " application
++run program as root before test starting
++.TP
++.BR "\-y", " \--yes"
++auto 'yes' answer to all questions
++.TP
++.BR "\-Q", " \--debug"
++debug workload (see cpu-load and disp-load below)
++.TP
++.BR "\-p " percent, " \--cpu-load " percent
++debug workload, the time cpu loaded in percent
++.TP
++.BR "\-d " percent, " \--disp-load " percent
++Debug workload, the time display on in percent
++.TP
++.BR "\-o " {0,1,2}, " \--output " {0,1,2}
++direct workload output:
++.RS
++.TP
++.B 0
++file
++.TP
++.B 1
++file and console
++.TP
++.B 2
++/dev/null, other - console
++.RE
++.TP
++.BR "\-z", " \--debug-vars"
++debug option
++.TP
++.BR "\-q " file, " \--debug-vars-file " file
++debug option - debug variables file
++.TP
++.BR "\-x", " \--dpms"
++debug option - try to use display power management
++.TP
++.BR "\-u", " \--spy"
++debug option - try to find out unexpected system activity
++.TP
++.BR "\-l", " \--simul-laptop"
++debug option, laptop simulation
++.TP
++.BR "\-b " percent, " \--bat-sync " percent
++debug option, battery critical capacity, default 5%
++.TP
++.BR "\-f " command, " \--user-field " command
++the output of user-specified command being added to statistics
++Example:
++	-f "cat /proc/acpi/thermal_zone/TZ01/temperature | awk '{print \$2}'"
++.TP
++.BR "\-k " num, " \--stat-system " num
++debug option, save system files, default 0
++.SH EXAMPLES
++.TP
++bltk -I or --idle
++idle workload running
++.TP
++bltk -R or --reader
++reader workload running
++.TP
++bltk -D or --developer
++developer workload running
++.TP
++bltk -O or --office
++office workload running
++.TP
++bltk -P or --player
++player workload running
++.TP
++bltk -G or --game
++game workload running
++.TP
++bltk -i or --idle-test -T 60 -t 1
++idle test running for 60 seconds, stats interval 1 second
++.SH SEE ALSO
++\fBbltk.conf\fR(5), \fBbltk_report\fR(1)
++.SH AUTHOR
++.nf
++Konstantin Karasyov   <konstantin.a.karasyov@intel.com>
++Vladimir Lebedev      <vladimir.p.lebedev@intel.com>
++.fi
+--- curr-1.0.9/doc/bltk_report.1	1970-01-01 01:00:00.000000000 +0100
++++ curr-1.0.9-1/doc/bltk_report.1	2009-07-21 15:31:40.943332988 +0200
+@@ -0,0 +1,167 @@
++.TH BLTK_REPORT 1 "15 July 2008" "BLTK_REPORT" 
++.SH NAME
++bltk_report \- automated report creation
++bltk_report_table \- summary table creation from several results folders
++bltk_plot \- graph drawing
++.SH SYNOPSIS
++.B bltk_report
++[\-hdofI013EiS] [\-r ] [\-s ] [\-b ] [\-c ]
++[\-U ] [\-B ] [\-D ] [\-C ] [\-P ] [\-K ] [\-R ]
++[\-2 ] [\-4 ] directory...
++.PP
++.B
++bltk_report_table
++[\-hdstfuEe13SR] [\-2 ] [\-4 ] [\-F ] directory ...
++.PP
++.B bltk_plot
++[\-hDswy1vnr] [\-d ] [\-f ] [\-x ] [\-X ] [\-Y ]
++[\-t ] [\-o ] [\-2 ] [\-p ] results_dir ...
++.SH DESCRIPTION
++The following tools are implemented for results analysis:
++.TP
++.B bltk_report
++automated report creation
++.TP
++.B bltk_report_table
++summary table creation from several results folders
++.TP
++.B bltk_plot
++graph drawing
++.SH GENERAL OPTIONS
++.TP
++.B \-h
++theis help
++.TP
++.B \-1
++first statistic item of score file is ignored
++.TP
++.BR "\-2 " item:num
++statistic from item 'item', 'num' number of score file
++.TP
++.B -f
++statistics file name
++.SH SPECIFIC OPTIONS
++.B bltk_report
++.RS
++.TP
++.B \-o
++print report to output
++.TP
++.BR "\-K " string
++comment string
++.TP
++.BR "\-R " filename
++argument will be used as report file name
++.TP
++.B \-3 
++first statistic item of stat.log file is ignored
++.TP
++.BR "\-4 " item:num
++statistic from item 'item', 'num' number of stat.log file
++.TP
++.B \-E
++errors being ignored (allows to create report file anyway)
++.TP
++.B \-i
++idle mode
++.RE
++.PP
++.B bltk_report_table
++.RS
++.TP
++.B \-d
++debugging mode
++.TP
++.B \-s
++sort result lines
++.TP
++.B \-t
++Excel-compatible file format
++.TP
++.B \-3
++first statistic item of stat.log file is ignored
++.TP
++.BR "\-4 " item:num
++statistic from item 'item', 'num' number of stat.log file
++.TP
++.B \-u
++only columns which contain different values will be included into table
++.TP
++.B \-E
++errors being ignored (allows to create result table anyway)
++.TP
++.B \-e
++skip error results
++.TP
++.BR "\-F " filter
++only fields from filter file will be included into table (see doc/filter as an example)
++.TP
++.B \-S
++split mode - split multiple values to columns
++.TP
++.B \-R
++analyze all results dirs under passed directories
++.RE
++.PP
++.B bltk_plot
++.RS
++.TP
++.B \-D
++debugging mode
++.TP
++.BR "\-d " results_dir
++results directory name. This option could be passed several times default is current directory.
++.TP
++.B \-s
++use stat.log file
++.TP
++.B \-w
++use work.log file
++.TP
++.BR "\-x " name
++argument is used to be an X parameter default is 'time' field
++.TP
++.BR "\-y " name ...
++argument is used to be an Y parameter this option could be passed several times default is 'cap' field
++.TP
++.BR "\-X " x1:x2
++x range from x1 to x2
++.TP
++.BR "\-Y " y1:y2
++y range from y1 to y2
++.TP
++.B \-t title
++graph title
++.TP
++.BR "\-o " options
++options passed to 'plot' command
++.TP
++.B \-v
++print current variables
++.TP
++.BR "\-p " file
++save graph to specified file
++.TP
++.B \-n
++print available field's names
++.TP
++.B \-R
++analyze all results dirs under passed directories
++.RE
++.SH EXAMPLE
++.TP
++bltk_report_table <results1> ... <resultsn> >sum
++Common results table will be generated in 'sum' file for <results1> ... <resultsn> directories.
++.TP
++bltk_report result
++\'Report\' file will be generated in results directory
++.TP
++bltk_plot -y bat -x N <results_dir1> ... <results_dir>
++Common graph will be generated for <results_dir1> ... <results_dirn>
++.SH SEE ALSO
++\fBbltk\fR(1), \fBbltk.conf\fR(5)
++.SH AUTHOR
++.nf
++Konstantin Karasyov   <konstantin.a.karasyov@intel.com>
++Vladimir Lebedev      <vladimir.p.lebedev@intel.com>
++.fi
+--- curr-1.0.9/doc/bltk.conf.5	1970-01-01 01:00:00.000000000 +0100
++++ curr-1.0.9-1/doc/bltk.conf.5	2009-07-17 11:03:54.891127310 +0200
+@@ -0,0 +1,73 @@
++.TH BLTK.CONF 5 "15 July 2009" "BLTK.CONF" "Battery life tool kit configuration"
++.SH NAME
++bltk.conf - config file for bltk
++.SH DESCRIPTION
++bltk.conf may be used to control particular features of bltk. By default, bltk looks for the file in /etc direcotry.
++.SH FORMAT
++The format of bltk.conf is very simple. Each line is either a comment or a directive. Comment lines start with a # and are ignored. A directive line has the format:
++.PP
++option=value
++.PP
++It is important to note that it is an error to put any space between the option, = and value.
++.PP
++Each setting has a compiled in default which may be modified in the configuration file.
++.SH .BOOLEAN OPTIONS
++Below is a list of boolean options. The value for a boolean option may be set to YES or NO.
++.TP
++.B CHK_INSTALLED
++If set to YES, existance of .installed files is checked for.
++.TP
++.B WL_DEVELOPER_ENABLED
++Controls whether developer workload is enabled.
++.TP
++.B WL_DEVELOPER_EXTERN
++Controls whether external sources are used to build workload application.
++.TP
++.B WL_GAME_ENABLED
++Controls whether game workload is enabled.
++.TP
++.B WL_GAME_EXTERN
++Controls whether external sources are used to build workload application.
++.TP
++.B WL_OFFICE_ENABLED
++Controls whether office workload is enabled.
++.TP
++.B WL_OFFICE_EXTERN
++Controls whether external sources are used to build workload application.
++.TP
++.B WL_PLAYER_ENABLED
++Controls whether player workload is enabled
++.TP
++.B WL_PLAYER_EXTERN
++Controls whether external sources are used to build workload application.
++.TP
++.B WL_READER_ENABLED
++Controls whether reader workload is enabled.
++.TP
++.B WL_READER_EXTERN
++Controls whether external sources are used to build workload application.
++.SH .STRING OPTIONS
++.B BLTK_HOME
++This option specifies the location of BLTK's home directory. This directory is used as starting directory for saving results and temporary files.
++.TP
++.B SOFFICE_PROG
++This option specifies an application to be started when office workload is used.
++.TP
++.B WL_OFFICE_WORKING_DIR
++The option specifies working directory for office workload.
++.TP
++.B BLTK_PLAYER_PROG
++The option replaces default aplication to be used for playing audio/video
++.TP
++.B BLTK_PLAYER_FILE
++The option replaces default source to be played.
++.TP
++.B BLTK_READER_PROG
++The option replaces default aplication to be used for reading a document.
++.TP
++.B BLTK_READER_FILE
++The option replaces default document to be read.
++.SH SEE ALSO
++\fBbltk\fR(1)
++.SH AUTHOR
++jskala@redhat.com
diff --git a/SOURCES/bltk-1.0.9-opt_developer.patch b/SOURCES/bltk-1.0.9-opt_developer.patch
new file mode 100644
index 0000000..4ad1652
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-opt_developer.patch
@@ -0,0 +1,58 @@
+--- orig-1.0.9/wl_developer/bltk_wl_developer.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_developer/bltk_wl_developer.sh	2009-07-17 11:03:54.857887762 +0200
+@@ -38,9 +38,13 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+ 
++export USER_DELAY_TMP=$BLTK_HOME/user_delay.tmp
++
+ startup()
+ {
+ 	trap 'cleanup 1; exit 1' 1 2 3 15
+@@ -174,18 +176,18 @@
+ {
+ 	ST_TIME=`$BLTK_TIME_CMD`
+ 
+-	rm -f ./user_delay.tmp
++	rm -f $USER_DELAY_TMP
+ 	if [[ $BLTK_WL_FILE != DEBUG && $BLTK_WL_FILE != DEBUG1 ]]
+ 	then
+ 		run_cscope_vi
+ 		wl_check_error $?
+ 	else
+ 		sleep 1
+-		echo 1.11 >./user_delay.tmp
+-		wl_check_error $? "echo 0.11 >./user_delay.tmp failed"
++		echo 1.11 > $USER_DELAY_TMP
++		wl_check_error $? "echo 0.11 > $USER_DELAY_TMP failed"
+ 	fi
+ 
+-	CMD="cat ./user_delay.tmp"
++	CMD="cat $USER_DELAY_TMP"
+ 	DELAY_TIME=`$CMD`
+ 	wl_check_error $? "$CMD failed"
+ 
+@@ -281,7 +283,15 @@
+ 	exit $1
+ }
+ 
+-startup
+-run
+-cleanup 0
++if [ $WL_DEVELOPER_ENABLED = "YES" ]
++then
++	startup
++	run
++	cleanup 0
++else
++  TTY=`tty`
++  echo "WARNING!!!" > $TTY 2>&1
++  echo "The developer workload is disabled. See manual and use external package." > $TTY 2>&1
++	exit 0
++fi
+ 
diff --git a/SOURCES/bltk-1.0.9-opt_game.patch b/SOURCES/bltk-1.0.9-opt_game.patch
new file mode 100644
index 0000000..b434088
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-opt_game.patch
@@ -0,0 +1,56 @@
+--- orig-1.0.9/wl_game/bltk_wl_game.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_game/bltk_wl_game.sh	2009-07-17 11:03:54.891881334 +0200
+@@ -22,16 +22,16 @@
+ #    may be used to endorse or promote products derived from this software
+ #    without specific prior written permission.
+ #
+-#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBGMORS
+-#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BGM NOT
++#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+-#  OWNER OR CONTRIBGMORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BGM NOT LIMITED
+-#  TO, PROCUREMENT OF SUBSTITGME GOODS OR SERVICES;
++#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
++#  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ #  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ #  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+-#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OGM OF
++#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ #  DAMAGE.
+ #
+@@ -40,8 +40,11 @@
+ 
+ set -x 
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
++
+ startup()
+ {
+ 	trap 'cleanup 1; exit 1' 1 2 3 15
+@@ -186,7 +189,15 @@
+ 	exit $1
+ }
+ 
+-startup
+-run
+-cleanup 0
++if [ $WL_GAME_ENABLED = "YES" ]
++then
++	startup
++	run
++	cleanup 0
++else
++  TTY=`tty`
++  echo "WARNING!!!" > $TTY 2>&1
++  echo "The game workload is disabled. Read manual and use external package." > $TTY 2>&1
++	exit 0
++fi
+ 
diff --git a/SOURCES/bltk-1.0.9-opt_office.patch b/SOURCES/bltk-1.0.9-opt_office.patch
new file mode 100644
index 0000000..dcd458a
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-opt_office.patch
@@ -0,0 +1,210 @@
+--- orig-1.0.9/wl_office/bltk_wl_office_run_app.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_office/bltk_wl_office_run_app.sh	2009-07-17 11:03:54.896922872 +0200
+@@ -38,12 +38,14 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
+ 
+ unalias -a
+ 
+ SOFFICE_FLG="-minimized -invisible -norestore -quickstart -nologo -nolockcheck -nodefault"
++WL_OFFICE_WORKING_DIR=${WL_OFFICE_WORKING_DIR:-"~/.bltk"}
+ 
+-$SOFFICE_PROG $SOFFICE_FLG $1 &
++$SOFFICE_PROG $SOFFICE_FLG $WL_OFFICE_WORKING_DIR/$1 &
+ 
+ exit $?
+ 
+--- orig-1.0.9/wl_office/bltk_wl_office.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_office/bltk_wl_office.sh	2009-07-17 11:03:55.016999320 +0200
+@@ -38,11 +38,21 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+ 
+ XSE_PROG="bltk_wl_office_xse"
+ 
++WL_OFFICE_WORKING_DIR=${WL_OFFICE_WORKING_DIR:-"~/.bltk"}
++cd $WL_OFFICE_WORKING_DIR
++WL_OFFICE_WORKING_DIR=`pwd`
++cd $OLDPWD
++
++export USER_DELAY_TMP=$BLTK_HOME/user_delay.tmp
++
++
+ startup()
+ {
+ 	trap 'cleanup 1; exit 1' 1 2 3 15
+@@ -55,7 +65,14 @@
+ 	wl_check_install office
+ 	wl_check_error $?
+ 
+-	export SOFFICE_PROG=$HOME/soffice
++	wl_install_file 0644 text1 $WL_OFFICE_WORKING_DIR/text1
++	wl_check_error $?
++	wl_install_file 0644 text2 $WL_OFFICE_WORKING_DIR/text2
++	wl_check_error $?
++	wl_install_file 0644 text3 $WL_OFFICE_WORKING_DIR/text3
++	wl_check_error $?
++
++	export SOFFICE_PROG=${SOFFICE_PROG:-"$HOME/soffice"}
+ 
+ 	BLTK_WL_OFFICE_SCEN=$BLTK_WL_FILE
+ 
+@@ -82,39 +99,44 @@
+ {
+ 	ST_TIME=`$BLTK_TIME_CMD`
+ 
+-	wl_remove_file OOWRITER_FILE.odt
++	wl_remove_file $WL_OFFICE_WORKING_DIR/OOWRITER_FILE.odt
+ 	wl_check_error $?
+-	wl_copy_file OOWRITER_FILE_SAMPLE.odt OOWRITER_FILE.odt
++	wl_install_file 0644 OOWRITER_FILE_SAMPLE.odt $WL_OFFICE_WORKING_DIR/OOWRITER_FILE.odt
+ 	wl_check_error $?
+ 
+-	wl_remove_file OOCALC_FILE.ods
++	wl_remove_file O$WL_OFFICE_WORKING_DIR/OCALC_FILE.ods
+ 	wl_check_error $?
+-	wl_copy_file OOCALC_FILE_SAMPLE.ods OOCALC_FILE.ods
++	wl_install_file 0644 OOCALC_FILE_SAMPLE.ods $WL_OFFICE_WORKING_DIR/OOCALC_FILE.ods
+ 	wl_check_error $?
+ 
+-	wl_remove_file OODRAW_FILE.odg
++	wl_remove_file $WL_OFFICE_WORKING_DIR/OODRAW_FILE.odg
+ 	wl_check_error $?
+-	wl_copy_file OODRAW_FILE_SAMPLE.odg OODRAW_FILE.odg
++	wl_install_file 0644 OODRAW_FILE_SAMPLE.odg $WL_OFFICE_WORKING_DIR/OODRAW_FILE.odg
+ 	wl_check_error $?
+ 
+-	wl_remove_file ./user_delay.tmp
++	wl_remove_file $USER_DELAY_TMP
+ 	wl_check_error $?
+ 
+ 	if [[ $BLTK_WL_OFFICE_SCEN = DEBUG ]]
+ 	then
+ 		sleep 1
+-		echo 0.11 > ./user_delay.tmp
+-		wl_check_error $? "echo 1.11 >./user_delay.tmp failed"
++		echo 0.11 > $USER_DELAY_TMP
++		wl_check_error $? "echo 1.11 > $USER_DELAY_TMP failed"
+ 	elif [[ -f "$BLTK_WL_OFFICE_SCEN" ]]
+ 	then
+ 		CMD="$BLTK_WL_BIN/$XSE_PROG $BLTK_WL_OFFICE_SCEN"
+ #####		\time -p $CMD >./XSE.times 2>&1
+ 		$CMD
++		if [ -f $BLTK_STOP_FNAME ]
++		then
++			ps -eopid,cmd | grep $WL_OFFICE_WORKING_DIR | sed 's/^ *//' | sed 's/ .*$//' | xargs kill -s SIGKILL
++			exit 0
++		fi
+ 	else
+ 		wl_check_error 1 "Cannot access $BLTK_WL_OFFICE_SCEN"
+ 	fi
+ 
+-	CMD="cat ./user_delay.tmp"
++	CMD="cat $USER_DELAY_TMP"
+ 	DELAY_TIME=`$CMD`
+ 	wl_check_error $? "$CMD failed"
+ 
+@@ -159,6 +181,14 @@
+ 	echo "$CNT: Score $score" >$TTY 2>&1
+ }
+ 
++killchildproc()
++{
++	officeproc = ps -eopid,cmd | grep $WL_OFFICE_WORKING_DIR | sed 's/ .*$//'
++	for i in $officeproc; do
++           sudo kill -s SIFKILL $i
++	done
++}
++
+ run()
+ {
+ 	CNT=1
+@@ -167,6 +197,7 @@
+ 		run1
+ 		if [[ $BLTK_SHOW_DEMO = TRUE && $CNT = $BLTK_SHOW_DEMO_NUM ]]
+ 		then
++			killchildproc
+ 			break
+ 		fi
+ 		(( CNT++ ))
+@@ -179,7 +210,12 @@
+ 	exit $1
+ }
+ 
+-startup
+-run
+-cleanup 0
++if [ "$WL_OFFICE_ENABLED" = "YES" ]
++then
++	startup
++	run
++	cleanup 0
++else
++	exit 0
++fi
+ 
+--- orig-1.0.9/tools/bltk/bltk_wl_common.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/tools/bltk/bltk_wl_common.sh	2009-07-17 11:03:54.742158129 +0200
+@@ -38,6 +38,7 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
+ 
+ unalias -a
+ 
+@@ -130,7 +131,7 @@
+ 
+ 	export BLTK_BIN=$BLTK_ROOT/bin
+ 	export BLTK_LIB=$BLTK_ROOT/lib
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++	export BLTK_TMP=$HOME/.bltk/tmp
+ 
+ 	[[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo
+ 	[[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
+@@ -180,7 +181,7 @@
+ 
+ 	export BLTK_BIN=$BLTK_ROOT/bin
+ 	export BLTK_LIB=$BLTK_ROOT/lib
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++	export BLTK_TMP=$HOME/.bltk/tmp
+ 
+ 	export BLTK_EXTERN_SRC=$BLTK_ROOT/extern
+ #	export BLTK_EXTERN_TGT=$BLTK_ROOT/extern
+@@ -228,7 +229,7 @@
+ 		wl_error_msg "cd $BLTK_WL_ROOT failed"
+ 		return 1
+ 	fi
+-	rm -f fail
++	rm -f $BLTK_FAIL_NAME
+ 
+ 	RES_SCORE=$BLTK_RESULTS/score
+ 	[[ -a $RES_SCORE ]] && rm $RES_SCORE
+@@ -626,3 +627,20 @@
+ 	return 0
+ }
+ 
++wl_install_file()
++{
++  typeset access=$1
++	typeset	file1=$2
++	typeset	file2=$3
++
++	CMD="install -m $access $file1 $file2"
++	$CMD
++	if [[ $? != 0 ]]
++	then
++		wl_error_msg "$CMD failed"
++		wl_error_msg "Cannot copy $file1 to $file2"
++		return 1
++	fi
++	return 0
++}
++
diff --git a/SOURCES/bltk-1.0.9-opt_player.patch b/SOURCES/bltk-1.0.9-opt_player.patch
new file mode 100644
index 0000000..901ce53
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-opt_player.patch
@@ -0,0 +1,122 @@
+--- orig-1.0.9/wl_player/bltk_wl_player_make_binary.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_player/bltk_wl_player_make_binary.sh	2009-07-17 11:03:55.178141070 +0200
+@@ -108,9 +108,13 @@
+ 	return 0
+ }
+ 
+-{
+-startup
+-make_mplayer_bin
+-cleanup 0
+-}
+-
++if [[ "$WL_PLAYER_ENABLED" = "YES" && "$WL_PLAYER_EXTERN" = "YES" ]]
++then
++	{
++	startup
++	make_mplayer_bin
++	cleanup 0
++	}
++else
++	exit 0
++fi
+--- orig-1.0.9/wl_player/bltk_wl_player.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_player/bltk_wl_player.sh	2009-07-17 11:03:55.189691473 +0200
+@@ -38,6 +38,9 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++BLTK_PLAYER_PROG_FLG=
++
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
+ 
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+@@ -54,27 +57,22 @@
+ 	wl_check_install player
+ 	wl_check_error $?
+ 
+-	if [[ $BLTK_WL_FILE = DEBUG ]]
++	if [[ $BLTK_PLAYER_FILE = DEBUG ]]
+ 	then
+-		BLTK_WL_FILE=
++		BLTK_PLAYER_FILE=
+ 	fi
+-	if [ $PLAY_MD != "dvd://" -a $PLAY_MD != "vcd://" ]
++	if [[ -z $BLTK_PLAYER_FILE ]]
+ 	then
+-		BLTK_WL_FILE=$BLTK_EXTERN_SRC_WL_PLAYER/$PLAY_MD
+-	else 
+-		set_dvd_config
+-		BLTK_WL_FILE=$PLAY_MD
++		BLTK_PLAYER_FILE="dvd://"
+ 	fi
+ 
+-echo ALEX DEBUG BLTK_WL_FILE is $BLTK_WL_FILE 
+-
+-	if [[ -z $BLTK_WL_PROG ]]
+-	then
+-		BLTK_WL_PROG=$BLTK_EXTERN_TGT_WL_PLAYER/mplayer/bin/mplayer
+-	fi
+-	if [[ -z $BLTK_WL_PROG_FLG ]]
++	if [[ -z $BLTK_PLAYER_PROG ]]
+ 	then
+-		BLTK_WL_PROG_FLG="-fs -quiet"
++		BLTK_PLAYER_PROG=$BLTK_EXTERN_TGT_WL_PLAYER/mplayer/bin/mplayer
++		if [[ -z $BLTK_PLAYER_PROG_FLG ]]
++		then
++			BLTK_PLAYER_PROG_FLG="-fs -quiet"
++		fi
+ 	fi
+ 
+ 	if [[ -z $BLTK_SHOW_DEMO_NUM ]]
+@@ -86,13 +84,13 @@
+ 		export BLTK_SHOW_DEMO_TIME=60
+ 	fi
+ 
+-	wl_check_prog $BLTK_WL_PROG
++	wl_check_prog $BLTK_PLAYER_PROG
+ 	wl_check_error $?
+ 
+-	wl_check_run_prog $BLTK_WL_PROG
++	wl_check_run_prog $BLTK_PLAYER_PROG
+ 	wl_check_error $?
+ 
+-	wl_check_all_run_prog $BLTK_WL_PROG
++	wl_check_all_run_prog $BLTK_PLAYER_PROG
+ 	wl_check_error $?
+ ###	env | sort >env.log
+ }
+@@ -122,14 +120,14 @@
+ {
+ 	ST_TIME=`$BLTK_TIME_CMD`
+ 
+-	CMD="$BLTK_WL_PROG $BLTK_WL_PROG_FLG $BLTK_WL_FILE"
++	CMD="$BLTK_PLAYER_PROG $BLTK_WL_PROG_FLG $BLTK_PLAYER_FILE"
+ 	if [[ $BLTK_SHOW_DEMO = TRUE && $BLTK_SHOW_DEMO_TIME != 0 ]]
+ 	then
+ 		$CMD &
+ 		wl_check_error $? "CMD failed"
+ 		pid=$!
+ 		sleep $BLTK_SHOW_DEMO_TIME
+-		prog=`basename $BLTK_WL_PROG`
++		prog=`basename $BLTK_PLAYER_PROG`
+ 		pgrep $prog
+ 		wl_check_error $? "$prog is not running"
+ 		/bin/kill -QUIT $pid >/dev/null 2>&1
+@@ -180,7 +178,12 @@
+ 	exit $1
+ }
+ 
+-startup
+-run
+-cleanup 0
++if [ "$WL_PLAYER_ENABLED" = "YES" ]
++then
++	startup
++	run
++	cleanup 0
++else
++	exit 0
++fi
+ 
diff --git a/SOURCES/bltk-1.0.9-opt_reader.patch b/SOURCES/bltk-1.0.9-opt_reader.patch
new file mode 100644
index 0000000..1a235f1
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-opt_reader.patch
@@ -0,0 +1,135 @@
+--- orig-1.0.9/wl_reader/bltk_wl_reader.sh	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_reader/bltk_wl_reader.sh	2009-07-17 11:03:55.065881503 +0200
+@@ -38,6 +38,7 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
+ 
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+@@ -48,6 +49,13 @@
+ 
+ XSE_PROG="bltk_wl_reader_xse"
+ 
++WL_READER_WORKING_DIR=${WL_READER_WORKING_DIR:-"~/.bltk"}
++cd $WL_READER_WORKING_DIR
++WL_READER_WORKING_DIR=`pwd`
++cd $OLDPWD
++
++export USER_DELAY_TMP=$BLTK_HOME/user_delay.tmp
++
+ startup()
+ {
+ 	trap 'cleanup 1; exit 1' 1 2 3 15
+@@ -58,35 +66,35 @@
+ ###	wl_check_install reader
+ ###	wl_check_error $?
+ 
+-	if [[ -z $BLTK_WL_PROG ]]
++	if [[ -z $BLTK_READER_PROG ]]
+ 	then
+-		export BLTK_WL_PROG=$DEF_BROWSER
+-		export BLTK_WL_PROG_FLG=
++		export BLTK_READER_PROG=$DEF_BROWSER
++		export BLTK_READER_PROG_FLG=
+ 	fi
+ 
+-	wl_check_prog $BLTK_WL_PROG
++	wl_check_prog $BLTK_READER_PROG
+ 	wl_check_error $?
+ 
+-	wl_check_run_prog $BLTK_WL_PROG
++	wl_check_run_prog $BLTK_READER_PROG
+ 	wl_check_error $?
+ 
+-	echo "Browser	$BLTK_WL_PROG"
++	echo "Browser	$BLTK_READER_PROG"
+ 
+-	wl_check_all_run_prog $BLTK_WL_PROG
++	wl_check_all_run_prog $BLTK_READER_PROG
+ 	wl_check_error $?
+ 
+ 	tmp_reader_file=/tmp/$DEF_FILE
+ 
+-	if [[ $BLTK_WL_FILE = DEBUG ]]
++	if [[ $BLTK_READER_FILE = DEBUG ]]
+ 	then
+-		BLTK_WL_FILE=
++		BLTK_READER_FILE=
+ 	fi
+ 
+-	if [[ ! -z $BLTK_WL_FILE ]]
++	if [[ ! -z $BLTK_READER_FILE ]]
+ 	then
+-		reader_file=$BLTK_WL_FILE
++		reader_file=$BLTK_READER_FILE
+ 		title="$BLTK_WL_TITLE"
+-		flags="$BLTK_WL_PROG_FLG"
++		flags="$BLTK_READER_PROG_FLG"
+ 	else
+ 		default_flg=TRUE
+ 		reader_file=$DEF_FILE
+@@ -139,13 +147,13 @@
+ {
+ 	ST_TIME=`$BLTK_TIME_CMD`
+ 
+-	rm -f ./user_delay.tmp
++	rm -f $USER_DELAY_TMP
+ 
+-	CMD="$BLTK_WL_PROG $BLTK_WL_PROG_FLG $reader_file"
++	CMD="$BLTK_READER_PROG $BLTK_WL_PROG_FLG $reader_file"
+ 	$CMD &
+ 	wl_check_error $? "$CMD failed"
+ 
+-	BLTK_WL_ALL_PROC_NAME="$BLTK_WL_ALL_PROC_NAME $BLTK_WL_PROG"
++	BLTK_WL_ALL_PROC_NAME="$BLTK_WL_ALL_PROC_NAME $BLTK_READER_PROG"
+ 
+ 	windowid=`bltk_winid -S "$title"`
+ 	wl_check_error $? "Cannot get windowid of $BLTK_WL_PRO"
+@@ -157,11 +165,17 @@
+ 
+ 	CMD="$BLTK_WL_BIN/$XSE_PROG"
+ 	$CMD
++	if [ -f $BLTK_STOP_FNAME ]
++	then
++		ps -eopid,cmd | grep $BLTK_READER_PROG | sed 's/^ *//' | sed 's/ .*$//' | xargs kill -s SIGKILL
++		exit 0
++	fi
++
+ 	wl_check_error $? "$CMD failed"
+ 
+ 	BLTK_WL_PROC_NAME="$BLTK_WL_PROC_NAME $XSE_PROG"
+ 
+-	CMD="cat ./user_delay.tmp"
++	CMD="cat $USER_DELAY_TMP"
+ 	DELAY_TIME=`$CMD`
+ 	wl_check_error $? "$CMD failed"
+ 
+@@ -200,7 +214,12 @@
+ 	exit $1
+ }
+ 
+-startup
+-run
+-cleanup 0
++if [ "$WL_READER_ENABLED" = "YES" ]
++then
++	startup
++	run
++	cleanup 0
++else
++	exit 0
++fi
+ 
+--- orig-1.0.9/wl_reader/bltk_wl_reader_xse.c	2009-04-10 09:14:20.000000000 +0200
++++ curr-1.0.9-1/wl_reader/bltk_wl_reader_xse.c	2009-07-17 11:03:55.065881503 +0200
+@@ -108,7 +108,7 @@
+ 		}
+ 	}
+ 
+-	env = getenv("BLTK_WL_PROG");
++	env = getenv("BLTK_READER_PROG");
+ 	if (env && strcmp(env, "konqueror") == 0) {
+ 		scen[LINE_QUIT].string = "Q";
+ 	}
diff --git a/SOURCES/bltk-1.0.9-plot-path.patch b/SOURCES/bltk-1.0.9-plot-path.patch
new file mode 100644
index 0000000..41b3b47
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-plot-path.patch
@@ -0,0 +1,30 @@
+diff -up bltk-1.0.9/tools/analyzer/bltk_plot.sh.plot-path bltk-1.0.9/tools/analyzer/bltk_plot.sh
+--- bltk-1.0.9/tools/analyzer/bltk_plot.sh.plot-path	2011-02-23 09:12:31.497394001 +0100
++++ bltk-1.0.9/tools/analyzer/bltk_plot.sh	2011-02-23 09:22:48.063394001 +0100
+@@ -78,7 +78,7 @@ set_bltk_paths()
+   return $RETCODE
+ }
+ 
+-set_bltk_root
++set_bltk_paths
+ 
+ BLTK_GET_STAT_CMD=$BLTK_BIN/bltk_get_stat
+ BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
+@@ -88,7 +88,7 @@ BLTK_PLOT_TMP=$BLTK_TMP/bltk_plot.$$
+ ARGS_FILE=$BLTK_PLOT_TMP/bltk_plot.cmd
+ ARGS_FILE_SAVED=$BLTK_PLOT_TMP/bltk_plot.cmd.saved
+ 
+-OPTIONS="hDd:f:swx:yX:Y:t:o:12:vp:nR"
++OPTIONS="hDd:f:swx:y:X:Y:t:o:12:vp:nR"
+ 
+ command_line()
+ {
+@@ -637,7 +637,7 @@ startup()
+ {
+ 	CMD="type -p gnuplot"
+ 	$CMD >/dev/null 2>&1
+-	[[ $? != 0 ]] && error "$CMD failed, cannot accces gnuplot program"
++	[[ $? != 0 ]] && error "$CMD failed, cannot access gnuplot program"
+ 
+ 	CMD="rm -rf $BLTK_PLOT_TMP"
+ 	$CMD
diff --git a/SOURCES/bltk-1.0.9-rpm.patch b/SOURCES/bltk-1.0.9-rpm.patch
new file mode 100644
index 0000000..c705318
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-rpm.patch
@@ -0,0 +1,47 @@
+diff -up bltk/tools/analyzer/bltk_get_hd_rpm.sh.rpm bltk/tools/analyzer/bltk_get_hd_rpm.sh
+--- bltk/tools/analyzer/bltk_get_hd_rpm.sh.rpm	2010-01-07 19:21:38.000000000 +0100
++++ bltk/tools/analyzer/bltk_get_hd_rpm.sh	2010-10-25 09:27:38.070983166 +0200
+@@ -46,25 +46,29 @@ model="$*"
+ 
+ set_bltk_root()
+ {
+-	PROG=`basename $0`
++  BLTK_BIN=`which bltk 2> /dev/null`
++  RETCODE=$?
+ 
+-	BLTK_ROOT=`dirname $0`
+-	if [[ ! -a $BLTK_ROOT/.bltk ]]
+-	then
+-		BLTK_ROOT=`dirname $BLTK_ROOT`
+-		if [[ ! -a $BLTK_ROOT/.bltk ]]
+-		then
+-			echo "Cannot determine bltk root, bltk tree corrupted."
+-			exit 2
+-		fi
+-	fi
+-	export BLTK_ROOT
+-	export BLTK_BIN=$BLTK_ROOT/bin
+-	export BLTK_TMP=$BLTK_ROOT/tmp
++  if [[ $RETCODE = 0 ]]
++  then
++    if [[ -L $BLTK_BIN ]]
++    then
++      BLTK_BIN=`readlink -f $BLTK_BIN`
++    fi
++    BLTK_ROOT=${BLTK_BIN%/bin/*}
++    export BLTK_ROOT
++  fi
++
++  return $RETCODE
+ }
+ 
+ set_bltk_root
+ 
++if [[ $? -ne 0 ]]; then 
++  echo "Cannot determine bltk root, bltk tree corrupted."
++  exit 2
++fi
++
+ RPM_FILE=$BLTK_ROOT/data/hd_rpm.data
+ 
+ MODEL=
diff --git a/SOURCES/bltk-1.0.9-xse.patch b/SOURCES/bltk-1.0.9-xse.patch
new file mode 100644
index 0000000..ec17047
--- /dev/null
+++ b/SOURCES/bltk-1.0.9-xse.patch
@@ -0,0 +1,251 @@
+diff -up bltk/include/xse.h.xse bltk/include/xse.h
+--- bltk/include/xse.h.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/include/xse.h	2009-07-29 11:14:00.971521183 +0200
+@@ -87,7 +87,8 @@
+ #define	DELAY_1_MIN	(1 * 60 * 1000)
+ #define	DELAY_2_MIN	(2 * 60 * 1000)
+ #define	WINDOWID	"WINDOWID"
+-#define	DELAY_FILE	"./user_delay.tmp"
++#define	DELAY_FILE	"user_delay.tmp"
++#define WINID_FILE	"winid.tmp"
+ #define	VI_CMD		"vi"
+ #define	CSCOPE_CMD	"cscope"
+ #define	F4		"F4"
+diff -up bltk/tools/bltk/main.c.xse bltk/tools/bltk/main.c
+--- bltk/tools/bltk/main.c.xse	2009-07-29 11:14:00.915494499 +0200
++++ bltk/tools/bltk/main.c	2009-07-29 11:14:00.989494544 +0200
+@@ -329,6 +329,7 @@ static void create_version_file(char *wl
+ static void get_info(int no);
+ 
+ static int sig_abort_flg = 0;
++static int sig_hup_flg = 0;
+ static int help_cnt = 0;
+ static int version_flg = 0;
+ 
+@@ -540,7 +541,7 @@ void handler(int sig)
+ 	turn_off_stat_memory();
+ 
+ 	if (sig == SIGHUP) {
+-		set_signal(SIGHUP);
++		create_stop_file();
+ 		return;
+ 	}
+ 
+diff -up bltk/tools/xse/Makefile.xse bltk/tools/xse/Makefile
+--- bltk/tools/xse/Makefile.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/tools/xse/Makefile	2009-07-29 11:14:00.972554857 +0200
+@@ -1,10 +1,10 @@
+ 
+ CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I ../../include -fPIC
+-LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11
++LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -Wl,-soname -Wl,libxse.so.0
+ 
+ LIB		= ../../lib
+ 
+-LIBNAME		= libxse.so
++LIBNAME		= libxse.so.0
+ TARGET		= $(LIB)/$(LIBNAME)
+ FILES		= xse
+ OFILES		= ${FILES:=.o}
+diff -up bltk/tools/xse/xse.c.xse bltk/tools/xse/xse.c
+--- bltk/tools/xse/xse.c.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/tools/xse/xse.c	2009-07-29 11:14:00.970496029 +0200
+@@ -52,16 +52,20 @@
+ #include <time.h>
+ #include <sys/wait.h>
+ #include <signal.h>
++#include <sys/prctl.h>
+ 
+ #include <xse.h>
+ 
+ char *progname = "xse";
+ char *xchg_buf = NULL;
+ char *scen_file = NULL;
++char *stop_name = "NULL";
+ int default_release_flg = 0;
+ int check_delay_time_flg = 0;
+ int correct_delay_time_flg = 0;
+ 
++char winid_tmp[STR_LEN];
++
+ long double user_delay = 0;
+ 
+ static Display *display = NULL;
+@@ -412,8 +416,10 @@ void write_delay(char *fname)
+ 	char string[STR_LEN];
+ 
+ 	if (fname == 0) {
+-		fname = DELAY_FILE;
++		snprintf(string, STR_LEN, "%s/%s", getenv("BLTK_HOME"), DELAY_FILE);
++		fname = strdup(string);
+ 	}
++	fprintf(stderr, "user delay file: %s\n", fname);
+ 
+ 	fd = open(fname, O_RDWR | O_TRUNC | O_CREAT, 0666);
+ 	if (fd < 0) {
+@@ -504,8 +510,8 @@ static int x_get_winid_action(char *titl
+ 	int ret = 0;
+ 	char cmd[STR_LEN];
+ 
+-	(void)sprintf(cmd, "bltk_winid -S -t %d -s %d \"%s\" >./winid.tmp",
+-		      wait_time, sleep_time, title);
++	(void)sprintf(cmd, "bltk_winid -S -t %d -s %d \"%s\" > %s",
++		      wait_time, sleep_time, title, winid_tmp);
+ 	ret = system(cmd);
+ 	if (ret != 0) {
+ 		(void)fprintf(stderr, "%s failed\n", cmd);
+@@ -519,7 +525,7 @@ static int get_winid_action(char *title)
+ 	int ret = 0;
+ 	char cmd[STR_LEN];
+ 
+-	(void)sprintf(cmd, "bltk_winid -S \"%s\" >./winid.tmp", title);
++	(void)sprintf(cmd, "%s/bin/bltk_winid -S \"%s\" > %s", getenv("BLTK_ROOT"), title, winid_tmp);
+ 	ret = system(cmd);
+ 	if (ret != 0) {
+ 		(void)fprintf(stderr, "%s failed\n", cmd);
+@@ -549,7 +555,7 @@ static int end_winid_action(char *title)
+ 	int ret = 0;
+ 	char cmd[STR_LEN];
+ 
+-	(void)sprintf(cmd, "bltk_winid -F \"%s\"", title);
++	(void)sprintf(cmd, "%s/bin/bltk_winid -F \"%s\"", getenv("BLTK_ROOT"), title);
+ 	ret = system(cmd);
+ 	if (ret != 0) {
+ 		(void)fprintf(stderr, "%s failed\n", cmd);
+@@ -562,6 +568,18 @@ static int end_winid_action(char *title)
+ static pid_t pid_array[1024];
+ static int pid_cnt = 0;
+ 
++void chk_stop_file()
++{
++	int i;
++
++	if (access(stop_name, F_OK) == 0) {
++		for (i = 0; i < pid_cnt; i++) {
++			(void)kill(pid_array[i], SIGTERM);
++		}
++		xse_exit(0);
++	}
++}
++
+ static int runcmd_action(char *name, int wait_time, int state)
+ {
+ 	int ret = 0;
+@@ -1096,7 +1114,7 @@ static void run_scen1(xse_scen_t * scen1
+ 			} else {
+ 				get_winid_action(string);
+ 			}
+-			readf_action("./winid.tmp", count, delay_time);
++			readf_action(winid_tmp, count, delay_time);
+ 			setwinid_action(string, xchg_buf, delay_time);
+ 			delay_time = 0;
+ 			break;
+@@ -1189,11 +1207,24 @@ static void run_scen1(xse_scen_t * scen1
+ 		if (break_flg) {
+ 			break;
+ 		}
++		chk_stop_file();
+ 	}
+ }
+ 
+ void init_xse()
+ {
++	if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0) != 0)
++	{
++		xse_exit(2);
++	}
++	if (prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0) != 0)
++	{
++		xse_exit(2);
++	}
++
++	stop_name = getenv("BLTK_STOP_FNAME");
++	
++	snprintf(winid_tmp, sizeof winid_tmp, "%s/%s", getenv("BLTK_HOME"), WINID_FILE);
+ 	display = XOpenDisplay(NULL);
+ 	if (display == NULL) {
+ 		(void)fprintf(stderr, "%s: Cannot open Display\n", progname);
+diff -up bltk/wl_developer/Makefile.xse bltk/wl_developer/Makefile
+--- bltk/wl_developer/Makefile.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/wl_developer/Makefile	2009-07-29 11:14:00.975524925 +0200
+@@ -1,6 +1,6 @@
+ 
+ CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
+-LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lxse -L../lib
++LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+ 
+@@ -15,7 +15,7 @@ SHFILES		= bltk_wl_developer_install blt
+ SHFILES_SH	= ${SHFILES:=.sh}
+ SHTARGETS	= $(SHFILES:%=$(BIN)/%)
+ 
+-EXTERN_DEPS	=  $(HIDERS) ../lib/libxse.so
++EXTERN_DEPS	=  $(HIDERS) ../lib/libxse.so.0
+ 
+ 
+ all : $(BIN) $(SUBDIRS) $(TARGET) $(SHTARGETS) FORCE
+diff -up bltk/wl_game/Makefile.xse bltk/wl_game/Makefile
+--- bltk/wl_game/Makefile.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/wl_game/Makefile	2009-07-29 11:14:00.978525164 +0200
+@@ -1,6 +1,6 @@
+ 
+ CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
+-LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lxse -L../lib
++LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+ 
+@@ -18,7 +18,7 @@ SHTARGETS	= $(SHFILES:%=$(BIN)/%)
+ DATAFILES	=
+ DATATARGETS	= $(DATAFILES:%=$(BIN)/%)
+ 
+-EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so
++EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so.0
+ 
+ 
+ all : $(BIN) $(SUBDIRS) $(TARGET) $(TARGET1) $(TARGET2) $(SHTARGETS) $(DATATARGETS)
+diff -up bltk/wl_office/Makefile.xse bltk/wl_office/Makefile
+--- bltk/wl_office/Makefile.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/wl_office/Makefile	2009-07-29 11:14:00.982494753 +0200
+@@ -1,6 +1,6 @@
+ 
+ CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
+-LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lxse -L../lib
++LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+ 
+@@ -15,10 +15,10 @@ SHFILES		= bltk_wl_office_install bltk_w
+ SHFILES_SH	= ${SHFILES:=.sh}
+ SHTARGETS	= $(SHFILES:%=$(BIN)/%)
+ 
+-DATAFILES	= scen_install 
++DATAFILES	= scen_install
+ DATATARGETS	= $(DATAFILES:%=$(BIN)/%)
+ 
+-EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so
++EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so.0
+ 
+ 
+ all : $(BIN) $(SUBDIRS) $(TARGET) $(TARGET1) $(TARGET2) $(SHTARGETS) $(DATATARGETS)
+diff -up bltk/wl_reader/Makefile.xse bltk/wl_reader/Makefile
+--- bltk/wl_reader/Makefile.xse	2009-04-10 09:14:20.000000000 +0200
++++ bltk/wl_reader/Makefile	2009-07-29 11:14:00.985519159 +0200
+@@ -1,6 +1,6 @@
+ 
+ CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
+-LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -lxse -L ../lib
++LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+ 
+@@ -17,7 +17,7 @@ SHFILES		= bltk_wl_reader_install bltk_w
+ SHFILES_SH	= ${SHFILES:=.sh}
+ SHTARGETS	= $(SHFILES:%=$(BIN)/%)
+ 
+-EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so
++EXTERN_DEPS	= $(HIDERS) ../lib/libxse.so.0
+ 
+ 
+ all : $(BIN) $(SUBDIRS) $(TARGETS) $(SHTARGETS) FORCE
diff --git a/SOURCES/bltk-1.1.0-cflags-override.patch b/SOURCES/bltk-1.1.0-cflags-override.patch
new file mode 100644
index 0000000..67ed015
--- /dev/null
+++ b/SOURCES/bltk-1.1.0-cflags-override.patch
@@ -0,0 +1,143 @@
+diff --git a/tools/analyzer/Makefile b/tools/analyzer/Makefile
+index 16f2485..68d044c 100644
+--- a/tools/analyzer/Makefile
++++ b/tools/analyzer/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/bat_drain/Makefile b/tools/bat_drain/Makefile
+index 19bfd59..ea4898d 100644
+--- a/tools/bat_drain/Makefile
++++ b/tools/bat_drain/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/bltk/Makefile b/tools/bltk/Makefile
+index 8ab4c4f..8a80543 100644
+--- a/tools/bltk/Makefile
++++ b/tools/bltk/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../../include
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I../../include
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/get_realpath/Makefile b/tools/get_realpath/Makefile
+index 6402cf9..e62558e 100644
+--- a/tools/get_realpath/Makefile
++++ b/tools/get_realpath/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/sudo/Makefile b/tools/sudo/Makefile
+index 30bc7c6..3cea1d8 100644
+--- a/tools/sudo/Makefile
++++ b/tools/sudo/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/time/Makefile b/tools/time/Makefile
+index cf89d0d..60074a1 100644
+--- a/tools/time/Makefile
++++ b/tools/time/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/type_command/Makefile b/tools/type_command/Makefile
+index 61f082e..60c48bc 100644
+--- a/tools/type_command/Makefile
++++ b/tools/type_command/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ #LDFLAGS	= -L/usr/X11R6/lib -lX11
+ 
+ BIN		= ../../bin
+diff --git a/tools/xse/Makefile b/tools/xse/Makefile
+index a416e94..0c72872 100644
+--- a/tools/xse/Makefile
++++ b/tools/xse/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I ../../include -fPIC
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I ../../include -fPIC
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -Wl,-soname -Wl,libxse.so.0
+ 
+ LIB		= ../../lib
+diff --git a/wl_developer/Makefile b/wl_developer/Makefile
+index 373a1ca..280e2b0 100644
+--- a/wl_developer/Makefile
++++ b/wl_developer/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I../include
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+diff --git a/wl_game/Makefile b/wl_game/Makefile
+index 4114322..2590925 100644
+--- a/wl_game/Makefile
++++ b/wl_game/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I../include
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+diff --git a/wl_office/Makefile b/wl_office/Makefile
+index 39d5783..2caa9ba 100644
+--- a/wl_office/Makefile
++++ b/wl_office/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I../include
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
+diff --git a/wl_player/Makefile b/wl_player/Makefile
+index 486bb11..f218f2b 100644
+--- a/wl_player/Makefile
++++ b/wl_player/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11
+ 
+ BIN		= bin
+diff --git a/wl_reader/Makefile b/wl_reader/Makefile
+index c73c1ca..9e40033 100644
+--- a/wl_reader/Makefile
++++ b/wl_reader/Makefile
+@@ -1,5 +1,5 @@
+ 
+-CFLAGS		= -Wall -pedantic -std=c99 -g -O2 -I../include
++override CFLAGS	+= -Wall -pedantic -std=c99 -g -O2 -I../include
+ LDFLAGS		= -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ../lib/libxse.so.0 -Wl,-rpath,/usr/lib/bltk
+ 
+ BIN		= bin
diff --git a/SOURCES/bltk-1.1.0-cond_install.patch b/SOURCES/bltk-1.1.0-cond_install.patch
new file mode 100644
index 0000000..4f72f50
--- /dev/null
+++ b/SOURCES/bltk-1.1.0-cond_install.patch
@@ -0,0 +1,138 @@
+diff -up bltk-1.0.9/wl_developer/bltk_wl_developer_install.sh.cond_install bltk-1.0.9/wl_developer/bltk_wl_developer_install.sh
+--- bltk-1.0.9/wl_developer/bltk_wl_developer_install.sh.cond_install	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.0.9/wl_developer/bltk_wl_developer_install.sh	2009-07-29 14:54:40.878602487 +0200
+@@ -38,6 +38,8 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+ 
+@@ -139,9 +141,14 @@ else
+ 	exit 1
+ fi
+ 
+-{
+-startup
+-$work
+-cleanup 0
+-}  2>&1 | tee -i $work.log
++if [[ "$WL_DEVELOPER_ENABLED" = "YES" && "$WL_DEVELOPER_EXTERN" = "YES" ]]
++then
++	{
++	startup
++	$work
++	cleanup 0
++	}  2>&1 | tee -i $work.log
++else
++	exit 0
++fi
+ 
+diff -up bltk-1.0.9/wl_office/bltk_wl_office_install.sh.cond_install bltk-1.0.9/wl_office/bltk_wl_office_install.sh
+--- bltk-1.0.9/wl_office/bltk_wl_office_install.sh.cond_install	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.0.9/wl_office/bltk_wl_office_install.sh	2009-07-29 15:00:59.406496688 +0200
+@@ -38,6 +38,8 @@
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ #
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+ 
+@@ -80,7 +81,6 @@ cleanup()
+ 
+ install_ooo()
+ {
+-
+ 	wl_remove_file ${HOME}/.sversionrc
+ 	wl_check_error $?
+ 
+@@ -188,23 +188,27 @@
+ 
+ }
+ 
+-if [[ $# = 0 || $1 = i || $1 = install ]]
++if [[ "$WL_OFFICE_ENABLED" = "YES" && "$WL_OFFICE_EXTERN" = "YES" ]]
+ then
+-	work=install
+-elif [[ $1 = install-loc ]]
+-then
+-	work=install-loc
+-elif [[ $1 = u || $1 = uninstall ]]
+-then
+-	work=uninstall
++	if [[ $# = 0 || $1 = i || $1 = install ]]
++	then
++		work=install
++	elif [[ $1 = install-loc ]]
++	then
++		work=install-loc
++	elif [[ $1 = u || $1 = uninstall ]]
++	then
++		work=uninstall
++	else
++		echo "Invalid parameter"
++		exit 1
++	fi
++
++	{
++		startup
++		$work
++		cleanup 0
++	}  2>&1 | tee -i $work.log
+ else
+-	echo "Invalid parameter"
+-	exit 1
++	exit 0
+ fi
+-
+-{
+-startup
+-$work
+-cleanup 0
+-}  2>&1 | tee -i $work.log
+-
+--- bltk-1.0.9/wl_player/bltk_wl_player_install.sh.cond_install	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.0.9/wl_player/bltk_wl_player_install.sh	2009-07-29 15:06:43.249585854 +0200
+@@ -41,6 +41,8 @@
+ 
+ PLAYER_INSTALL_FLAGS=" --disable-ivtv"
+ 
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
++
+ source `dirname $0`/../../bin/bltk_wl_common
+ [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
+ 
+@@ -286,17 +288,21 @@ else
+ 	exit 1
+ fi
+ 
++if [[ "$WL_PLAYER_ENABLED" = "YES" && "$WL_PLAYER_EXTERN" = "YES" ]]
++then
+ {
+-
+ #If there is a ENV variable named CFLAGS, the CFLAGS value in wl_player/Makefile
+ #will be set to this ENV variable. Since the MPlayer will inherit the ENV CFLAGS
+ #value, the compiling will failed for "-pedantic -std=c99" in CFLAGS. So we need
+ #to unset the variable here.
+ 
+-CFLAGS=
+-LDFLAGS=
+-startup
+-$work
+-cleanup 0
+-}  2>&1 | tee -i $work.log
+-
++	CFLAGS=
++	LDFLAGS=
++	startup
++	$work
++	cleanup 0
++	}  2>&1 | tee -i $work.log
++}
++else
++	exit 0
++fi
diff --git a/SOURCES/bltk-1.1.0-fix-tmp-files.patch b/SOURCES/bltk-1.1.0-fix-tmp-files.patch
new file mode 100644
index 0000000..4d5b4c2
--- /dev/null
+++ b/SOURCES/bltk-1.1.0-fix-tmp-files.patch
@@ -0,0 +1,15 @@
+diff --git a/tools/bltk/bltk_get_hdparm.sh b/tools/bltk/bltk_get_hdparm.sh
+index 4f6a53b..72ca33d 100644
+--- a/tools/bltk/bltk_get_hdparm.sh
++++ b/tools/bltk/bltk_get_hdparm.sh
+@@ -57,8 +57,8 @@ PARTITIONS=$1
+ 
+ FOUND=0
+ READING=0
+-TMP_FILE=$BLTK_ROOT/tmp/hdparm
+-DEV_INFO=$BLTK_HOME/tmp/dev_info
++TMP_FILE=`mktemp`.hdparm
++DEV_INFO=`mktemp`.dev_info
+ 
+ /usr/bin/udisksctl dump > $TMP_FILE
+ 
diff --git a/SOURCES/bltk-1.1.0-rm_sudo.patch b/SOURCES/bltk-1.1.0-rm_sudo.patch
new file mode 100644
index 0000000..7537d89
--- /dev/null
+++ b/SOURCES/bltk-1.1.0-rm_sudo.patch
@@ -0,0 +1,788 @@
+diff -up bltk-1.1.0/include/bltk.h.sec_sudo bltk-1.1.0/include/bltk.h
+--- bltk-1.1.0/include/bltk.h.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/include/bltk.h	2009-12-08 14:28:23.868162165 +0100
+@@ -429,8 +429,6 @@ extern int dpms_proc_flg;
+ 
+ extern char *results;
+ 
+-extern char *bltk_sudo;
+-
+ extern int abort_flg;
+ extern int ac_ignore;
+ 
+diff -up bltk-1.1.0/Makefile.sec_sudo bltk-1.1.0/Makefile
+--- bltk-1.1.0/Makefile.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/Makefile	2009-12-08 14:28:23.868162165 +0100
+@@ -89,10 +89,6 @@ clean : FORCE
+ 	@$(RM) *~ last_cmd last_results history
+ 	@$(RM) .bltk install.log uninstall.log .plot_history
+ 
+-su : pre-install
+-	$(MAKE) -C tools/sudo install
+-	@touch .bltk
+-
+ _lazy : FORCE
+ 	@for f in $(CMDS); \
+ 	do \
+diff -up bltk-1.1.0/tools/analyzer/bltk_report.sh.sec_sudo bltk-1.1.0/tools/analyzer/bltk_report.sh
+diff -up bltk-1.1.0/tools/bat_drain/bat_drain.sh.sec_sudo bltk-1.1.0/tools/bat_drain/bat_drain.sh
+--- bltk-1.1.0/tools/bat_drain/bat_drain.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/tools/bat_drain/bat_drain.sh	2009-12-10 13:55:46.454371019 +0100
+@@ -100,16 +100,12 @@ set_bltk_root()
+ set_bltk_root
+ 
+ export BLTK_BIN=$BLTK_ROOT/bin
+-export BLTK_SUDO=$BLTK_BIN/bltk_sudo
+ export BLTK_GET_DMIDECODE=$BLTK_BIN/bltk_get_dmidecode
+ export BLTK_GET_SYSTEM_RELEASE=$BLTK_BIN/bltk_get_system_release
+ 
+-if [[ -x $BLTK_SUDO ]]
+-then
+-	MANUFACTURER=`$BLTK_SUDO $BLTK_GET_DMIDECODE -m`
+-	PRODUCT_NAME=`$BLTK_SUDO $BLTK_GET_DMIDECODE -p`
+-	SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v`
+-fi
++MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor`
++PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name`
++SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v`
+ 
+ # percents
+ BAT_CRITICAL=5
+@@ -1874,16 +1870,6 @@ fini_user()
+ 	$fini_user_cmd
+ }
+ 
+-bat_startup()
+-{
+-	if [[ -x $BLTK_SUDO ]]
+-	then
+-		$BLTK_SUDO modprobe cpufreq_stats >/dev/null 2>&1
+-	fi
+-}
+-
+-bat_startup
+-
+ init_srgs "$@"
+ 
+ if [[ $left_work_flg = TRUE ]]
+diff -up bltk-1.1.0/tools/bltk/bltk_check.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_check.sh
+--- bltk-1.1.0/tools/bltk/bltk_check.sh.sec_sudo	2009-12-08 14:28:23.846162271 +0100
++++ bltk-1.1.0/tools/bltk/bltk_check.sh	2009-12-08 14:28:23.876162742 +0100
+@@ -85,14 +85,6 @@ command_line()
+ cmd_startup
+ [[ $? != 0 ]] && exit 1
+ 
+-$BLTK_SUDO_CMD
+-if [[ $? != 0 ]]
+-then
+-	echo "Cannot run $BLTK_SUDO_CMD"
+-	echo "Please perform 'make su' command"
+-	exit 2
+-fi
+-
+ command_line "$@"
+ 
+ #rm -rf $RES
+diff -up bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh
+--- bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh.sec_sudo	2009-12-08 14:28:23.825191233 +0100
++++ bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh	2009-12-08 14:28:23.877162125 +0100
+@@ -74,65 +74,13 @@ command_line()
+ 	done
+ 
+ 	shift $((OPTIND-1))
+-
+-	DMIDECODE=$*
+-	TMP_FILE=$BLTK_HOME/tmp/dmidecode
+-
+-	if [[ -z $DMIDECODE ]]
+-	then
+-		type -p dmidecode >/dev/null 2>&1
+-		if [[ $? = 0 ]]
+-		then
+-			rm -f $TMP_FILE
+-			$BLTK_SUDO_CMD dmidecode >$TMP_FILE
+-			DMIDECODE=$TMP_FILE
+-		else
+-			if [[ $manufacturer_flg = TRUE ]]
+-			then
+-				:
+-			elif [[ $product_name_flg = TRUE ]]
+-			then
+-				:
+-			else
+-				echo "MANUFACTURER ="
+-				echo "PRODUCT_NAME ="
+-			fi
+-			exit 1
+-		fi
+-	fi
+-
+-	MANUFACTURER=
+-	PRODUCT_NAME=
+ }
+ 
+ command_line "$@"
+ 
+-while read line
+-do
+-	if [[ "$line" == *"System Information"* ]]
+-	then
+-		read line_m
+-		read line_p
+-		break
+-	fi
+-done < $DMIDECODE
+-
+-
+-if [[ ! -z "$line_m" ]]
+-then
+-	if [[ "$line_m" == *"Manufacturer: "* ]]
+-	then
+-		MANUFACTURER=${line_m#Manufacturer: }
+-	fi
+-fi
++MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor`
+ 
+-if [[ ! -z "$line_p" ]]
+-then
+-	if [[ "$line_p" == *"Product Name: "* ]]
+-	then
+-		PRODUCT_NAME=${line_p#Product Name: }
+-	fi
+-fi
++PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name`
+ 
+ if [[ $manufacturer_flg = TRUE ]]
+ then
+@@ -145,6 +93,4 @@ else
+ 	echo "PRODUCT_NAME = $PRODUCT_NAME"
+ fi
+ 
+-rm -f $TMP_FILE
+-
+ exit 0
+diff -up bltk/tools/bltk/bltk_get_hdparm.sh.orig bltk/tools/bltk/bltk_get_hdparm.sh
+--- bltk/tools/bltk/bltk_get_hdparm.sh.orig	2010-08-18 08:35:02.000000000 +0200
++++ bltk/tools/bltk/bltk_get_hdparm.sh	2012-05-07 16:22:43.000000000 +0200
+@@ -44,39 +44,64 @@ PROG=$0
+ 
+ error()
+ {
+-	echo "$PROG: ERROR: $*" >&2
+-	exit 1
++  echo "$PROG: ERROR: $*" >&2
++  exit 1
+ }
+ 
+ warning()
+ {
+-	echo "$PROG: Warning: $*" >&2
++  echo "$PROG: Warning: $*" >&2
+ }
+ 
+ PARTITIONS=$1
+ 
++FOUND=0
++READING=0
+ TMP_FILE=$BLTK_ROOT/tmp/hdparm
++DEV_INFO=$BLTK_HOME/tmp/dev_info
++
++/usr/bin/udisksctl dump > $TMP_FILE
+ 
+ #str=`df -lk / | grep -v ^Filesystem`
+ str=`df -lk / | grep ^/dev/`
+ DF_DEV_NAME=${str%% *}
+-if [  -L $DF_DEV_NAME ];then 
+-	realname="`readlink $DF_DEV_NAME`"
+-	DF_NAME="`basename ${realname}`"
+-	HD_NAME=${DF_NAME}
+-	DISK_CK_TOOL="lvdisplay -a"
+-	HD_DEV_NAME=$DF_DEV_NAME
+-else 
+-	DF_NAME=${DF_DEV_NAME#/dev/}
+-	HD_NAME=${DF_NAME%%[0-9]*}
+-	DISK_CK_TOOL="hdparm -iI"
+-	HD_DEV_NAME=/dev/$HD_NAME
++if [  -L $DF_DEV_NAME ];then
++  realname="`readlink $DF_DEV_NAME`"
++  DF_NAME="`basename ${realname}`"
++  HD_NAME=${DF_NAME}
++else
++  DF_NAME=${DF_DEV_NAME#/dev/}
++  HD_NAME=${DF_NAME%%[0-9]*}
+ fi
+ 
++HD_DEV_NAME=/dev/$HD_NAME
++
++while read line
++do
++  if [[ $READING -eq 0 && `echo $line | grep '^/'` ]]; then
++    READING=1
++  elif [[ $READING -eq 1 && -z "$line" ]]; then
++    READING=0
++    if [ $FOUND -eq 1 ]; then
++      break;
++    else
++      rm $DEV_INFO
++    fi
++  fi
++
++  if [[ $READING -eq 1 ]]; then
++    echo $line >> $DEV_INFO
++  fi
++
++  if [[ `echo $line | grep "Device: *$HD_DEV_NAME"` ]]; then
++    FOUND=1
++  fi
++done < $TMP_FILE
++
+ grep -w "$HD_NAME" "$PARTITIONS" >/dev/null 2>&1
+ if [[ $? != 0 ]]
+ then
+-	warning "Cannot determine hard disk $HD_NAME statistics"
++  warning "Cannot determine hard disk $HD_NAME statistics"
+ fi
+ 
+ echo "DF_NAME = $DF_NAME"
+@@ -85,34 +110,17 @@ echo "HD_NAME = $HD_NAME"
+ echo "HD_DEV_NAME = $HD_DEV_NAME"
+ 
+ rm -f $TMP_FILE
+-BLTK_SUDO_CMD=sudo
+-$BLTK_SUDO_CMD $DISK_CK_TOOL "$HD_DEV_NAME" >$TMP_FILE 2>&1
+-if [  -L $DF_DEV_NAME ];then 
+-	echo "HD_MODEL = Logical volume"
+-
+-	str=`grep 'LV Size' $TMP_FILE`
+-	str=${str#*LV Size*}
+-	str=`echo $str`
+-	echo "HD_SIZE = $str"
+-else 
+-	
+-	str=`grep '^ Model=' $TMP_FILE`
+-	str=${str# Model=}
+-	str=${str%%, *}
+-	if [[ -z "$str" ]]
+-	then
+-		str=`grep '^	Model Number:' $TMP_FILE`
+-		str=${str#*Model Number:}
+-		str=`echo $str`
+-	fi
+-	echo "HD_MODEL = $str"
+-	
+-	str=`grep 'device size with M = 1000' $TMP_FILE`
+-	str=${str#*device size with M = 1000*:}
+-	str=`echo $str`
+-	echo "HD_SIZE = $str"
++if [  -L $DF_DEV_NAME ];then
++  echo "HD_MODEL = Logical volume"
++
++  str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
++  echo "HD_SIZE = $((str/1048576)) MBytes ($((str/1073741824)) GB)"
++else
++  echo "HD_MODEL = `grep '^Model:' $DEV_INFO | sed 's/^Model: *//'`"
++  str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
++  echo "HD_SIZE = $((str/1000000)) MBytes ($((str/1000000000)) GB)"
+ fi
+ 
+-rm -f $TMP_FILE
++rm -f $DEV_INFO
+ 
+ exit 0
+diff -up bltk/tools/bltk/bltk_get_user_field.sh.orig bltk/tools/bltk/bltk_get_user_field.sh
+--- bltk/tools/bltk/bltk_get_user_field.sh.orig	2012-05-07 16:23:42.925939779 +0200
++++ bltk/tools/bltk/bltk_get_user_field.sh	2012-05-07 16:22:43.000000000 +0200
+@@ -45,19 +45,24 @@ PROG=$0
+ 
+ error()
+ {
+-	echo "$PROG: ERROR: $*" >&2
+-	exit 1
++  echo "$PROG: ERROR: $*" >&2
++  exit 1
+ }
+ 
+ warning()
+ {
+-	echo "$PROG: Warning: $*" >&2
++  echo "$PROG: Warning: $*" >&2
+ }
+ 
+ FIELD_NO=$1
+ DELIM=$1
+ 
++FOUND=0
++READING=0
+ TMP_FILE=$BLTK_HOME/tmp/hdparm
++DEV_INFO=$BLTK_HOME/tmp/dev_info
++
++/usr/bin/udisksctl dump > $TMP_FILE
+ 
+ #str=`df -lk / | grep -v ^Filesystem`
+ str=`df -lk / | grep ^/dev/`
+@@ -69,35 +74,45 @@ HD_NAME=${DF_NAME%%[0-9]*}
+ grep -w "$HD_NAME" "$PARTITIONS" >/dev/null 2>&1
+ if [[ $? != 0 ]]
+ then
+-	warning "Cannot determine hard disk $HD_NAME statistics"
++  warning "Cannot determine hard disk $HD_NAME statistics"
+ fi
+ 
+ HD_DEV_NAME=/dev/$HD_NAME
+ 
++while read line
++do
++  if [[ $READING -eq 0 && `echo $line | grep '^/'` ]]; then
++    READING=1
++  elif [[ $READING -eq 1 && -z "$line" ]]; then
++    READING=0
++    if [ $FOUND -eq 1 ]; then
++      break;
++    else
++      rm $DEV_INFO
++    fi
++  fi
++
++  if [[ $READING -eq 1 ]]; then
++    echo $line >> $DEV_INFO
++  fi
++
++  if [[ `echo $line | grep "Device: *$HD_DEV_NAME"` ]]; then
++    FOUND=1
++  fi
++done < $TMP_FILE
++
+ rm -f $TMP_FILE
+-$BLTK_SUDO_CMD /sbin/hdparm -iI "$HD_DEV_NAME" >$TMP_FILE 2>&1
+ 
+ echo "DF_NAME = $DF_NAME"
+ echo "DF_DEV_NAME = $DF_DEV_NAME"
+ echo "HD_NAME = $HD_NAME"
+ echo "HD_DEV_NAME = $HD_DEV_NAME"
+ 
+-str=`grep '^ Model=' $TMP_FILE`
+-str=${str# Model=}
+-str=${str%%, *}
+-if [[ -z "$str" ]]
+-then
+-	str=`grep '^	Model Number:' $TMP_FILE`
+-	str=${str#*Model Number:}
+-	str=`echo $str`
+-fi
+-echo "HD_MODEL = $str"
++echo "HD_MODEL = `grep '^Model:' $DEV_INFO | sed 's/^Model: *//'`"
+ 
+-str=`grep 'device size with M = 1000' $TMP_FILE`
+-str=${str#*device size with M = 1000*:}
+-str=`echo $str`
+-echo "HD_SIZE = $str"
++str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
++echo "HD_SIZE = $((str/1000000)) MBytes ($((str/1000000000)) GB)"
+ 
+-rm -f $TMP_FILE
++rm $DEV_INFO
+ 
+ exit 0
+diff -up bltk-1.1.0/tools/bltk/bltk_hd_state.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_hd_state.sh
+diff -up bltk-1.1.0/tools/bltk/bltk_install.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_install.sh
+--- bltk-1.1.0/tools/bltk/bltk_install.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/tools/bltk/bltk_install.sh	2009-12-08 14:28:23.879167455 +0100
+@@ -100,18 +100,6 @@ done
+ cd $BLTK_ROOT
+ [[ $? != 0 ]] && exit 1
+ 
+-$BLTK_SUDO_CMD >/dev/null 2>&1
+-if [[ $? != 0 ]]
+-then
+-	SU=TRUE
+-fi
+-
+-if [[ $SU = TRUE ]]
+-then
+-	make su
+-	[[ $? != 0 ]] && exit 1
+-fi
+-
+ CWD=$PWD
+ 
+ for work in $WORK
+diff -up bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh
+--- bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh	2009-12-08 14:28:23.880163066 +0100
+@@ -48,13 +48,6 @@ group=`id -gn`
+ 
+ trap 'trap_action 1; exit 1' 1 2 3 6 15
+ #trap 'echo trap 11 >&2' 11
+-trap_action()
+-{
+-	[[ ! -a "$SAVEDIR" ]] && return
+-	$BLTK_SUDO_CMD chown -h -R $user:$group $SAVEDIR
+-	$BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR
+-	$BLTK_SUDO_CMD rm -rf $SAVEDIR
+-}
+ 
+ PROG=$0
+ 
+@@ -102,10 +95,7 @@ SAVELIST="
+ 
+ if [[ -a $SAVEDIR ]]
+ then
+-	CMD="$BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR"
+-	$CMD
+-	[[ $? != 0 ]] && error "$CMD failed"
+-	CMD="$BLTK_SUDO_CMD rm -rf $SAVEDIR"
++	CMD="rm -rf $SAVEDIR"
+ 	$CMD
+ 	[[ $? != 0 ]] && error "$CMD failed"
+ fi
+@@ -122,13 +112,13 @@ do
+ 	CMD="mkdir -p -m 0777 $dstdir"
+ 	$CMD
+ 	[[ $? != 0 ]] && error "$CMD failed"
+-	CMD="$BLTK_SUDO_CMD cp -d -r $src $dst"
++	CMD="cp -d -r $src $dst"
+ 	$CMD
+ 	[[ $? != 0 ]] && warning "$CMD failed"
+-	CMD="$BLTK_SUDO_CMD chown -h -R $user:$group $dst"
++	CMD="chown -h -R $user:$group $dst"
+ 	$CMD
+ 	[[ $? != 0 ]] && warning "$CMD failed"
+-	CMD="$BLTK_SUDO_CMD chmod -R a+rw $dst"
++	CMD="chmod -R a+rw $dst"
+ 	$CMD
+ 	[[ $? != 0 ]] && warning "$CMD failed"
+ done >>$SAVEDIR/err.log 2>&1
+@@ -144,21 +134,9 @@ free >$SAVEDIR/free 2>&1
+ df -lk >$SAVEDIR/df 2>&1
+ ps -lef >$SAVEDIR/ps 2>&1
+ ###	glxinfo >$SAVEDIR/glxinfo 2>&1
+-$BLTK_SUDO_CMD dmidecode >$SAVEDIR/dmidecode 2>&1
+ xset q >$SAVEDIR/xset 2>&1
+ 
+ HDPARM=hdparm
+ 
+-for h in hda hdb hdc hdd sda sdb sdc sdd
+-do
+-	grep " $h " /proc/diskstats >/dev/null 2>&1
+-	if [[ $? = 0 ]]
+-	then
+-		$BLTK_SUDO_CMD $HDPARM /dev/$h >$SAVEDIR/hdparm.$h 2>&1
+-		$BLTK_SUDO_CMD $HDPARM -iI /dev/$h >>$SAVEDIR/hdparm.$h 2>&1
+-		$BLTK_SUDO_CMD $HDPARM -C /dev/$h >>$SAVEDIR/hdparm.$h 2>&1
+-	fi
+-done
+-
+ exit 0
+ 
+diff -up bltk-1.1.0/tools/bltk/bltk_wl_common.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_wl_common.sh
+--- bltk-1.1.0/tools/bltk/bltk_wl_common.sh.sec_sudo	2009-12-08 14:28:23.847162491 +0100
++++ bltk-1.1.0/tools/bltk/bltk_wl_common.sh	2009-12-08 14:28:23.881171389 +0100
+@@ -133,7 +133,6 @@ cmd_startup()
+ 	export BLTK_LIB=$BLTK_ROOT/lib
+ 	export BLTK_TMP=$HOME/.bltk/tmp
+ 
+-	[[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo
+ 	[[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
+ 	[[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time
+ 	[[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command
+@@ -211,7 +210,6 @@ wl_startup()
+ 
+ 	export BLTK_WL_INSTALL_FILE=$BLTK_WL_ROOT/.installed
+ 
+-	[[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo
+ 	[[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
+ 	[[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time
+ 	[[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command
+@@ -540,27 +538,6 @@ wl_remove_dir()
+ 	return 0
+ }
+ 
+-wl_remove_dir_su()
+-{
+-	typeset	dir=$1
+-
+-	if [[ -a $dir ]]
+-	then
+-		CMD="$BLTK_SUDO_CMD rm -rf $dir"
+-		$CMD
+-		if [[ $? != 0 ]]
+-		then
+-			wl_error_msg "$CMD failed"
+-			wl_error_msg "Cannot remove $dir"
+-			return 1
+-		fi
+-	fi
+-#	CMD="rmdir -p `dirname $dir`"
+-#	$CMD >/dev/null 2>&1
+-#	return 0
+-	return 0
+-}
+-
+ wl_move_dir()
+ {
+ 	typeset	dir1=$1
+diff -up bltk-1.1.0/tools/bltk/main.c.sec_sudo bltk-1.1.0/tools/bltk/main.c
+--- bltk-1.1.0/tools/bltk/main.c.sec_sudo	2009-12-08 14:28:23.852162407 +0100
++++ bltk-1.1.0/tools/bltk/main.c	2009-12-08 14:28:23.883191456 +0100
+@@ -215,8 +215,6 @@ int stat_system = 0;
+ int comment_cnt = 0;
+ char *comment[MAX_LINES];
+ 
+-char *bltk_sudo = "bltk_sudo_NOT_SET";
+-
+ char stop_fname[STR_LEN];
+ 
+ int show_demo = 0;
+@@ -250,7 +248,6 @@ int debug_workload_flg = 0;
+ 
+ int start_prog_flg = 0;
+ char *start_prog = NULL;
+-int start_prog_su_flg = 0;
+ 
+ xtime_t arg_time = EMPTY_VALUE;
+ xtime_t idle_test_time = EMPTY_VALUE;
+@@ -946,15 +943,6 @@ static void start_warning2(void)
+ 	write_to_stdout_work_out_log("Do NOT touch anything\n");
+ }
+ 
+-static void pre_init_vars(void)
+-{
+-	char cmd[STR_LEN];
+-
+-	(void)sprintf(cmd, "%s modprobe cpufreq_stats >>%s 2>&1",
+-		      bltk_sudo, warning_log_fname);
+-	(void)prog_system(cmd);
+-}
+-
+ static int environment_init(int argc, char **argv)
+ {
+ 	char cmdline[STR_LEN];
+@@ -1056,26 +1044,6 @@ static int environment_init(int argc, ch
+ 	(void)sprintf(cmd, "%s >%s/cmd", cmdline, results);
+ 	(void)prog_system(cmd);
+ 
+-	(void)sprintf(str, "%s/bin/bltk_sudo", bltk_root);
+-	bltk_sudo = strdup(str);
+-	if (access(str, X_OK) != 0) {
+-		(void)sprintf(prt_str, "Cannot access %s\n", str);
+-		write_to_err_log(prt_str);
+-		(void)sprintf(prt_str, "Please perform 'make su' command\n");
+-		write_to_err_log(prt_str);
+-		prog_exit(1);
+-	}
+-	(void)sprintf(cmd, "%s/bin/bltk_sudo", bltk_root);
+-	ret = prog_system(cmd);
+-	if (ret != 0) {
+-		(void)sprintf(prt_str, "Cannot run %s\n", str);
+-		write_to_err_log(prt_str);
+-		(void)sprintf(prt_str, "Please perform 'make su' command\n");
+-		write_to_err_log(prt_str);
+-		prog_exit(1);
+-	}
+-	prog_putenv("BLTK_SUDO_CMD", str);
+-
+ 	set_signal(SIGTERM);
+ 	set_signal(SIGINT);
+ 	set_signal(SIGQUIT);
+@@ -1092,8 +1060,6 @@ static int environment_init(int argc, ch
+ 		prog_exit(1);
+ 	}
+ 
+-	pre_init_vars();
+-
+ 	init_vars();
+ 
+ 	return (0);
+@@ -2021,11 +1987,6 @@ int main(int argc, char **argv)
+ 		case 'e':
+ 			start_prog_flg = 1;
+ 			start_prog = optarg;
+-			start_prog_su_flg = 1;
+-			break;
+-		case 'E':
+-			start_prog_flg = 1;
+-			start_prog = optarg;
+ 			break;
+ 		case 'y':
+ 			yes = 1;
+@@ -2449,11 +2410,7 @@ int main(int argc, char **argv)
+ 	}
+ 
+ 	if (start_prog_flg) {
+-		if (start_prog_su_flg) {
+-			(void)sprintf(cmd, "%s '%s'", bltk_sudo, start_prog);
+-		} else {
+-			(void)sprintf(cmd, "%s", start_prog);
+-		}
++		(void)sprintf(cmd, "%s", start_prog);
+ 		(void)sprintf(prt_str, "Start prog %s\n", cmd);
+ 		write_to_stdout_work_out_log(prt_str);
+ 		ret = prog_system(cmd);
+diff -up bltk-1.1.0/tools/bltk/Makefile.sec_sudo bltk-1.1.0/tools/bltk/Makefile
+--- bltk-1.1.0/tools/bltk/Makefile.sec_sudo	2009-12-08 14:28:23.806162596 +0100
++++ bltk-1.1.0/tools/bltk/Makefile	2009-12-08 14:28:23.875173697 +0100
+@@ -14,7 +14,7 @@ HIDERS		= ../../include/bltk.h ../../inc
+ TARGETS		= $(BIN)/bltk
+ 
+ SHFILES		= \
+-		bltk_hd_state bltk_save_sys_info bltk_get_info \
++		bltk_save_sys_info bltk_get_info \
+ 		bltk_get_ac_adapter bltk_get_bat bltk_get_cpustat \
+ 		bltk_get_cpufreq bltk_get_cpuinfo bltk_get_cpustate \
+ 		bltk_get_dmidecode bltk_get_hdparm \
+diff -up bltk-1.1.0/tools/bltk/stat.c.sec_sudo bltk-1.1.0/tools/bltk/stat.c
+--- bltk-1.1.0/tools/bltk/stat.c.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/tools/bltk/stat.c	2009-12-08 14:28:23.886191838 +0100
+@@ -205,24 +205,6 @@ void turn_off_stat_memory(void)
+ 	}
+ }
+ 
+-#define	LAPTOP_MODE	"laptop_mode"
+-
+-static int laptop_mode_stop_done = 0;
+-
+-void laptop_mode_stop(void)
+-{
+-	char cmd[STR_LEN];
+-
+-	if (!stat_log_proc_flg || laptop_mode_stop_done) {
+-		return;
+-	}
+-
+-	laptop_mode_stop_done = 1;
+-	debug("laptop_mode_stop()");
+-	(void)sprintf(cmd, "%s %s >/dev/null 2>&1", bltk_sudo, LAPTOP_MODE);
+-	(void)prog_system(cmd);
+-}
+-
+ void stat_sync(char *why)
+ {
+ 	debug("stat_sync() by %s", why);
+@@ -320,7 +302,6 @@ void check_critical_state(void)
+ 				if (stat_memory_saved) {
+ 					send_sighup();
+ 				}
+-				laptop_mode_stop();
+ 				if (!idle_test_mode) {
+ 					save_sys_info_2();
+ 				}
+@@ -438,34 +419,6 @@ get_percentage_delta(ll_t val_100, ll_t 
+ 	return (ret);
+ }
+ 
+-void hd_state(char *str)
+-{
+-	char cmd[STR_LEN];
+-	int ret;
+-
+-	if (hd_stat_ignore) {
+-		(void)sprintf(str, "  -");
+-		return;
+-	}
+-
+-	(void)sprintf(cmd, "./bin/bltk_hd_state %s >>%s 2>&1",
+-		      hd_dev_name, "/dev/null");
+-
+-	ret = prog_system(cmd);
+-	ret = WEXITSTATUS(ret);
+-	if (ret == 100) {
+-		(void)sprintf(str, "err");
+-	} else if (ret == 101) {
+-		(void)sprintf(str, "a/i");
+-	} else if (ret == 102) {
+-		(void)sprintf(str, " st");
+-	} else if (ret == 103) {
+-		(void)sprintf(str, " sl");
+-	} else {
+-		(void)sprintf(str, "err");
+-	}
+-}
+-
+ static int get_display_state(void)
+ {
+ 	char cmd[STR_LEN];
+@@ -1129,7 +1082,7 @@ void write_report_str(char *work_type, c
+ 	if (hd_stat_ignore == 0) {
+ 		int del_rd = 0, del_wr = 0;
+ 
+-		hd_state(shd);
++		sprintf(shd, "a/i");
+ 
+ 		if (hd_stat_rd_wr_ignore == 0) {
+ 			get_hd_stat(1, &c_hd_stat);
+diff -up bltk-1.1.0/tools/Makefile.sec_sudo bltk-1.1.0/tools/Makefile
+--- bltk-1.1.0/tools/Makefile.sec_sudo	2009-07-29 11:38:48.000000000 +0200
++++ bltk-1.1.0/tools/Makefile	2009-12-08 14:28:23.869162456 +0100
+@@ -1,5 +1,5 @@
+ 
+-SUBDIRS = xse bltk sudo get_realpath type_command analyzer time bat_drain
++SUBDIRS = xse bltk get_realpath type_command analyzer time bat_drain
+ 
+ all : FORCE
+ 	@for dir in $(SUBDIRS); \
+@@ -19,8 +19,5 @@ install :
+ 
+ uninstall :
+ 
+-su sudo : FORCE
+-	$(MAKE) -C sudo
+-
+ FORCE :
+ 
+diff -up bltk-1.1.0/tools/sudo/bltk_sudo.c.sec_sudo bltk-1.1.0/tools/sudo/bltk_sudo.c
+diff -up bltk-1.1.0/tools/sudo/Makefile.sec_sudo bltk-1.1.0/tools/sudo/Makefile
+diff -up bltk-1.1.0/wl_game/bltk_wl_game.sh.sec_sudo bltk-1.1.0/wl_game/bltk_wl_game.sh
+--- bltk-1.1.0/wl_game/bltk_wl_game.sh.sec_sudo	2009-12-08 14:28:23.797167456 +0100
++++ bltk-1.1.0/wl_game/bltk_wl_game.sh	2009-12-08 14:28:23.887196668 +0100
+@@ -81,7 +81,7 @@ clean_gmhome()
+ {
+ 	if [[ -d $GMHOME ]]
+ 	then
+-		CMD="$BLTK_SUDO_CMD rm -rf $GMHOME"
++		CMD="rm -rf $GMHOME"
+ 		$CMD
+ 		wl_check_error $? "$CMD failed"
+ 	fi
+diff -up bltk-1.1.0/wl_player/bltk_wl_player.sh.sec_sudo bltk-1.1.0/wl_player/bltk_wl_player.sh
+--- bltk-1.1.0/wl_player/bltk_wl_player.sh.sec_sudo	2009-12-08 14:28:23.821177150 +0100
++++ bltk-1.1.0/wl_player/bltk_wl_player.sh	2009-12-08 14:28:23.888191092 +0100
+@@ -95,27 +95,6 @@ startup()
+ ###	env | sort >env.log
+ }
+ 
+-set_dvd_config()
+-{
+-	typeset dvd
+-
+-	for d in /dev/cdrom /dev/hdc /dev/hdd /dev/sr0
+-	do
+-		if [[ -a $d ]]
+-		then
+-			dvd=$d
+-			break
+-		fi
+-	done
+-
+-	if [[ ! -a /dev/dvd && ! -z $dvd ]]
+-	then
+-		$BLTK_SUDO_CMD ln -s $dvd /dev/dvd
+-		$BLTK_SUDO_CMD chmod a+r /dev/dvd
+-		$BLTK_SUDO_CMD hdparm -d1 /dev/dvd
+-	fi
+-}
+-
+ run1()
+ {
+ 	ST_TIME=`$BLTK_TIME_CMD`
+diff -up bltk-1.1.0/wl_reader/bltk_wl_reader.sh.sec_sudo bltk-1.1.0/wl_reader/bltk_wl_reader.sh
+--- bltk-1.1.0/wl_reader/bltk_wl_reader.sh.sec_sudo	2009-12-08 14:28:23.841162495 +0100
++++ bltk-1.1.0/wl_reader/bltk_wl_reader.sh	2009-12-08 14:28:23.889162188 +0100
+@@ -103,7 +103,7 @@ startup()
+ 	fi
+ 	if [[ $default_flg = TRUE ]]
+ 	then
+-		CMD="$BLTK_SUDO_CMD rm -f $tmp_reader_file"
++		CMD="rm -f $tmp_reader_file"
+ 		$CMD
+ 		wl_check_error $? "$CMD fialed"
+ 
diff --git a/SOURCES/bltk.conf b/SOURCES/bltk.conf
new file mode 100644
index 0000000..3efe87a
--- /dev/null
+++ b/SOURCES/bltk.conf
@@ -0,0 +1,68 @@
+# ***********************************
+# BLTK configuration file
+# 
+# ***********************************
+
+BLTK_HOME=~/.bltk
+CHK_INSTALLED=NO
+
+# ***********************************
+# *****    BLTK_WL_DEVELOPER    *****
+#************************************
+# Enables developer workload
+WL_DEVELOPER_ENABLED=NO
+
+# Enables external downloaded binary used by developer workload
+WL_DEVELOPER_EXTERN=YES
+
+
+# ***********************************
+# *****      BLTK_WL_GAME       *****
+# ***********************************
+# Enables game workload
+WL_GAME_ENABLED=NO
+
+# Enables external downloaded binary used by game workload
+WL_GAME_EXTERN=YES
+
+
+# ***********************************
+# *****     BLTK_WL_OFFICE      *****
+# ***********************************
+# Enables developer workload 
+WL_OFFICE_ENABLED=YES
+
+# Enables external downloaded binary used by office workload
+WL_OFFICE_EXTERN=NO
+
+# Path to OpenOffice binary
+SOFFICE_PROG=ooffice
+WL_OFFICE_WORKING_DIR=~/.bltk/wl_office
+
+
+# ***********************************
+# *****      BLTK_WL_PLAYER     *****
+# ***********************************
+# Enables player workload
+WL_PLAYER_ENABLED=YES
+
+# Enables external downloaded binary used by player workload
+WL_PLAYER_EXTERN=NO
+
+BLTK_PLAYER_PROG=totem
+BLTK_PLAYER_FILE=dvd://
+
+
+# ***********************************
+# *****      BLTK_WL_READER     *****
+# ***********************************
+# Enables reader workload
+WL_READER_ENABLED=YES
+
+# Enables external downloaded binary used by reader workload
+WL_READER_EXTERN=NO
+
+BLTK_READER_PROG=firefox
+#BLTK_READER_FILE=
+
+
diff --git a/SPECS/bltk.spec b/SPECS/bltk.spec
new file mode 100644
index 0000000..4132f72
--- /dev/null
+++ b/SPECS/bltk.spec
@@ -0,0 +1,327 @@
+Name:		bltk
+Version:	1.1.0
+Release:	10%{?dist}
+Summary:	The BLTK measures notebook battery life under any workload
+
+Group:		Applications/System
+License:	BSD
+URL:			http://www.lesswatts.org/projects/bltk/
+Source0:	http://www.lesswatts.org/patches/bltk/%{name}-%{version}.tar.gz
+Source1:	bltk.conf
+Source2:  OOCALC_FILE_SAMPLE.ods
+Source3:  OODRAW_FILE_SAMPLE.odg
+Source4:  OOWRITER_FILE_SAMPLE.odt
+
+Patch1:  bltk-1.0.9-man.patch
+Patch3:  bltk-1.0.9-bltk_paths.patch
+Patch4:  bltk-1.0.9-opt_developer.patch
+Patch5:  bltk-1.1.0-cond_install.patch
+Patch6:  bltk-1.0.9-opt_game.patch
+Patch7:  bltk-1.0.9-conf.patch
+Patch8:  bltk-1.0.9-opt_office.patch
+Patch10: bltk-1.0.9-opt_player.patch
+Patch11: bltk-1.0.9-home_dir.patch
+Patch12: bltk-1.0.9-opt_reader.patch
+Patch13: bltk-1.0.9-installed.patch
+Patch15: bltk-1.0.9-xse.patch
+Patch16: bltk-1.0.9-conf_home.patch
+Patch17: bltk-1.1.0-rm_sudo.patch
+Patch18: bltk-1.0.9-plot-path.patch
+Patch19: bltk-1.0.9-rpm.patch
+Patch20: bltk-1.1.0-cflags-override.patch
+Patch21: bltk-1.1.0-fix-tmp-files.patch
+
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires:	libX11-devel
+
+Requires: udisks2 gnuplot
+
+%description
+This tool kit is used to measure battery life and performance under
+different workloads on Linux. Test can be used with various workloads to
+simulate different types of laptop usage.
+The following workloads are currently implemented:
+	a) Idle workload - collect statistics only
+	b) Developer workload - simulates code development in Linux environment
+	c) Reader workload - simulates text reading on laptop
+	d) DVD playback workload - simulates laptop entertaining usage
+	e) 3d game workload - simulates 3D-gaming on laptop
+	f) Office Activity workload - simulates laptop usage for different
+		office activities (based on OpenOffice.org office suit)
+
+%prep
+%setup -q -n bltk
+
+# %patch0 -p1 -b .all
+%patch1 -p1 -b .man
+%patch3 -p1 -b .bltk_paths
+%patch4 -p1 -b .opt_developer
+%patch5 -p1 -b .cond_install
+%patch6 -p1 -b .opt_game
+%patch7 -p1 -b .conf
+%patch8 -p1 -b .opt_office
+%patch10 -p1 -b .opt_player
+%patch11 -p1 -b .home_dir
+%patch12 -p1 -b .opt_reader
+%patch13 -p1 -b .installed
+%patch15 -p1 -b .xse
+%patch16 -p1 -b .conf_home
+%patch17 -p1 -b .rm_sudo
+%patch18 -p1 -b .plot-path
+%patch19 -p1 -b .rpm
+%patch20 -p1 -b .cflags-override
+%patch21 -p1 -b .fix-tmp-files
+
+%build
+make CFLAGS="$RPM_OPT_FLAGS"
+#make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make install DESTDIR=$RPM_BUILD_ROOT PACKAGE_BUILD=y
+
+mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/{bin,lib,doc,wl_developer,wl_game,wl_office,wl_player,wl_reader}
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_developer/bin
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_game/bin
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office/bin
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_player/bin
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_reader/bin
+mkdir -p ${RPM_BUILD_ROOT}/etc
+mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man{1,5}
+
+install -m 644 %{SOURCE1}	${RPM_BUILD_ROOT}/etc
+install -m 644 doc/bltk.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1
+install -m 644 doc/bltk_report.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1
+install -m 644 doc/bltk.conf.5 ${RPM_BUILD_ROOT}/%{_mandir}/man5
+
+install -m 755 bin/bat_drain	${RPM_BUILD_ROOT}%{_libdir}/bltk/bin/bat_drain
+install -m 755 bin/bat_drain_table	${RPM_BUILD_ROOT}%{_libdir}/bltk/bin/bat_drain_table
+
+install -m 755 bin/bltk	${RPM_BUILD_ROOT}%{_libdir}/bltk/bin
+
+install -m 755 lib/libxse.so.0	${RPM_BUILD_ROOT}%{_libdir}/bltk/lib/libxse.so.0
+
+install -m 755 bin/bltk_*	${RPM_BUILD_ROOT}%{_libdir}/bltk/bin/
+install -m 755 bin/bat_*	${RPM_BUILD_ROOT}%{_libdir}/bltk/bin/
+
+install -m 755 wl_developer/bin/bltk_wl_developer ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_developer/bin
+install -m 755 wl_developer/bin/bltk_wl_developer_xse ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_developer/bin
+install -m 755 wl_developer/bin/bltk_wl_developer_spy ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_developer/bin
+
+install -m 755 wl_game/bin/bltk_wl_game ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_game/bin
+install -m 755 wl_game/bin/bltk_wl_game_xse ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_game/bin
+
+install -m 755 wl_office/bin/bltk_wl_office ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office/bin
+install -m 755 wl_office/bin/bltk_wl_office_xse ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office/bin
+install -m 755 wl_office/bin/bltk_wl_office_run_app ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office/bin
+install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 wl_office/scen ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 wl_office/scen_install ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 wl_office/response_install ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+install -m 644 wl_office/text* ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_office
+
+install -m 755 wl_player/bin/bltk_wl_player ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_player/bin
+install -m 755 wl_player/bin/bltk_wl_player_make_binary ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_player/bin
+
+install -m 755 wl_reader/bin/bltk_wl_reader ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_reader/bin
+install -m 755 wl_reader/bin/bltk_wl_reader_xse ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_reader/bin
+install -m 644 wl_reader/war_and_peace.html ${RPM_BUILD_ROOT}%{_libdir}/bltk/wl_reader
+
+cat << ":EOF" > ${RPM_BUILD_ROOT}%{_bindir}/bltk
+#!/bin/sh
+
+bltk_native="$(rpm --eval '%%{_libdir}')/bltk/bin/$(basename $0)"
+
+[ -x "$bltk_native" ] && exec "$bltk_native" "$@"
+exec /usr/lib/bltk/bin/$(basename $0) "$@"
+:EOF
+chmod a+rx ${RPM_BUILD_ROOT}%{_bindir}/bltk
+pushd ${RPM_BUILD_ROOT}%{_bindir}
+for f in bltk_plot bltk_report bltk_report_compress bltk_report_table bltk_report_uncompress;
+do
+  ln -s bltk $f
+done
+popd
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc doc/HOWTO doc/Manual doc/README
+%config(noreplace) %attr(0644,root,root) /etc/bltk.conf
+
+%{_libdir}/bltk/bin/bltk
+%{_bindir}/bltk
+%{_bindir}/bltk_plot
+%{_bindir}/bltk_report
+%{_bindir}/bltk_report_compress
+%{_bindir}/bltk_report_table
+%{_bindir}/bltk_report_uncompress
+
+%{_mandir}/man1/bltk*
+%{_mandir}/man5/bltk.conf.*
+
+%{_libdir}/bltk/lib/libxse.so.0
+
+%{_libdir}/bltk/bin/bat_drain
+%{_libdir}/bltk/bin/bat_drain_table
+%{_libdir}/bltk/bin/bltk_calc
+%{_libdir}/bltk/bin/bltk_check
+%{_libdir}/bltk/bin/bltk_display_state
+%{_libdir}/bltk/bin/bltk_get_ac_adapter
+%{_libdir}/bltk/bin/bltk_get_bat
+%{_libdir}/bltk/bin/bltk_get_cpufreq
+%{_libdir}/bltk/bin/bltk_get_cpuinfo
+%{_libdir}/bltk/bin/bltk_get_cpustat
+%{_libdir}/bltk/bin/bltk_get_cpustate
+%{_libdir}/bltk/bin/bltk_get_dmidecode
+%{_libdir}/bltk/bin/bltk_get_hdparm
+%{_libdir}/bltk/bin/bltk_get_hd_rpm
+%{_libdir}/bltk/bin/bltk_get_info
+%{_libdir}/bltk/bin/bltk_get_kernel_release
+%{_libdir}/bltk/bin/bltk_get_lspci
+%{_libdir}/bltk/bin/bltk_get_meminfo
+%{_libdir}/bltk/bin/bltk_get_realpath
+%{_libdir}/bltk/bin/bltk_get_stat
+%{_libdir}/bltk/bin/bltk_get_system_release
+%{_libdir}/bltk/bin/bltk_get_timer
+%{_libdir}/bltk/bin/bltk_get_user_field
+%{_libdir}/bltk/bin/bltk_get_xdpyinfo
+
+%{_libdir}/bltk/bin/bltk_install
+%{_libdir}/bltk/bin/bltk_func
+%{_libdir}/bltk/bin/bltk_plot
+%{_libdir}/bltk/bin/bltk_report
+%{_libdir}/bltk/bin/bltk_report_check
+%{_libdir}/bltk/bin/bltk_report_compress
+%{_libdir}/bltk/bin/bltk_report_table
+%{_libdir}/bltk/bin/bltk_report_uncompress
+%{_libdir}/bltk/bin/bltk_save_sys_info
+%{_libdir}/bltk/bin/bltk_spy
+%{_libdir}/bltk/bin/bltk_time
+%{_libdir}/bltk/bin/bltk_type_command
+%{_libdir}/bltk/bin/bltk_winid
+%{_libdir}/bltk/bin/bltk_wl_common
+
+%{_libdir}/bltk/wl_developer/bin/bltk_wl_developer
+%{_libdir}/bltk/wl_developer/bin/bltk_wl_developer_spy
+%{_libdir}/bltk/wl_developer/bin/bltk_wl_developer_xse
+
+%{_libdir}/bltk/wl_game/bin/bltk_wl_game
+%{_libdir}/bltk/wl_game/bin/bltk_wl_game_xse
+
+%{_libdir}/bltk/wl_office/bin/bltk_wl_office
+%{_libdir}/bltk/wl_office/bin/bltk_wl_office_xse
+%{_libdir}/bltk/wl_office/bin/bltk_wl_office_run_app
+%{_libdir}/bltk/wl_office/OOCALC_FILE_SAMPLE.ods
+%{_libdir}/bltk/wl_office/OODRAW_FILE_SAMPLE.odg
+%{_libdir}/bltk/wl_office/OOWRITER_FILE_SAMPLE.odt
+%{_libdir}/bltk/wl_office/scen
+%{_libdir}/bltk/wl_office/scen_install
+%{_libdir}/bltk/wl_office/response_install
+%{_libdir}/bltk/wl_office/text1
+%{_libdir}/bltk/wl_office/text2
+%{_libdir}/bltk/wl_office/text3
+
+%{_libdir}/bltk/wl_player/bin/bltk_wl_player
+%{_libdir}/bltk/wl_player/bin/bltk_wl_player_make_binary
+
+%{_libdir}/bltk/wl_reader/bin/bltk_wl_reader
+%{_libdir}/bltk/wl_reader/bin/bltk_wl_reader_xse
+%{_libdir}/bltk/wl_reader/war_and_peace.html
+
+%changelog
+* Tue Mar 21 2017 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-10
+- Fixed temporary files creation
+  Resolves: rhbz#1102089
+
+* Wed Mar  5 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-9
+- Improved multilib
+  Related: rhbz#1057086
+
+* Wed Mar  5 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-8
+- Fixed multilib
+  Resolves: rhbz#1057086
+
+* Mon Mar  3 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-7
+- Fixed application of CFLAGS
+  Resolves: rhbz#1070787
+
+* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.1.0-6
+- Mass rebuild 2014-01-24
+
+* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1.0-5
+- Mass rebuild 2013-12-27
+
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon May  7 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-2
+- Switched to udisks2
+
+* Thu Mar 29 2012 Jaroslav Škarvada <jskarvad@redhat.com> - 1.1.0-1
+- New version
+- Dropped office_scen patch (upstreamed)
+- Dropped hdparm patch (upstream added support for LVM)
+- Reworked rm_sudo patch
+
+* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.9-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Wed Feb 23 2011 Jiri Skala <jskala@redhat.com> 1.0.9-11
+- fixes #679022 - bltk_plot is broken
+- fixes paths in bltk_get_hd_rpm
+
+* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.9-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Mon May 10 2010 Jiri Skala <jskala@redhat.com> 1.0.9-9
+- added udisks dependency
+
+* Thu Feb 04 2010 Jiri Skala <jskala@redhat.com> 1.0.9-8
+- removed requires openoffice
+
+* Fri Dec 11 2009 Jiri Skala <jskala@redhat.com> 1.0.9-7
+- fixes #542688 - bltk will run any command as root
+
+* Thu Sep 03 2009 Jiri Skala <jskala@redhat.com> 1.0.9-6
+- fixed misspelled bash variable with stop file
+
+* Fri Jul 31 2009 Jiri Skala <jskala@redhat.com> 1.0.9-5
+- bltk.conf can be located in ~/.bltk
+
+* Tue Jul 28 2009 Jiri Skala <jskala@redhat.com> 1.0.9-4
+- added man mages
+- splitted patch to more files
+- filled up scen file of office workload
+- updated to latest upstream sources
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.9-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jul 14 2009 Jiri Skala <jskala@redhat.com> 1.0.9-1
+- merged with latest upstream sources
+
+* Fri Apr 10 2009 Jiri Skala <jskala@redhat.com> 1.0.8-2
+- optimized bltk.conf - SOFFICE_PROG
+- fixed working dir in reports
+- fixed SIGHUP handling
+- finalized implementation of stop file in office and reader WLs
+
+* Thu Jan 29 2009 Jiri Skala <jskala@redhat.com> 1.0.8-1
+- assembling package